diff --git a/app/build.gradle b/app/build.gradle index fae865a..bedc30f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { applicationId "de.dlyt.yanndroid.notinotes" minSdk 26 targetSdk 34 - versionCode 13 - versionName "1.7.2" + versionCode 14 + versionName "1.7.3" resConfigs locales } @@ -30,6 +30,10 @@ android { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } + debug { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/app/release/app-release.aab b/app/release/app-release.aab index f1f9059..0bbd9fd 100644 Binary files a/app/release/app-release.aab and b/app/release/app-release.aab differ diff --git a/app/release/app-release.apk b/app/release/app-release.apk index d7c7a82..970b204 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 6d4d77a..5c5d623 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 13, - "versionName": "1.7.2", + "versionCode": 14, + "versionName": "1.7.3", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/java/de/dlyt/yanndroid/notinotes/DialogActivity.kt b/app/src/main/java/de/dlyt/yanndroid/notinotes/DialogActivity.kt index b6fffa4..be72f20 100644 --- a/app/src/main/java/de/dlyt/yanndroid/notinotes/DialogActivity.kt +++ b/app/src/main/java/de/dlyt/yanndroid/notinotes/DialogActivity.kt @@ -55,9 +55,12 @@ class DialogActivity : AppCompatActivity() { } } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { + try { sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) + } catch (e: SecurityException) { + e.printStackTrace() } + mKeyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager mKeyguardManager.requestDismissKeyguard(this, null) diff --git a/app/src/main/java/de/dlyt/yanndroid/notinotes/Notification.kt b/app/src/main/java/de/dlyt/yanndroid/notinotes/Notification.kt index 143fa71..2ec2cb6 100644 --- a/app/src/main/java/de/dlyt/yanndroid/notinotes/Notification.kt +++ b/app/src/main/java/de/dlyt/yanndroid/notinotes/Notification.kt @@ -2,7 +2,9 @@ package de.dlyt.yanndroid.notinotes import android.app.NotificationChannel import android.app.NotificationManager +import android.app.PendingIntent import android.content.Context +import android.content.Intent import android.content.res.Configuration import android.graphics.Color import android.view.LayoutInflater @@ -50,7 +52,7 @@ class Notification { .addAction( R.drawable.ic_edit, context.getString(R.string.edit), - ActionReceiver.getPendingIntent(context, note, ActionReceiver.ACTION_EDIT) + getPendingIntentActivity(context, note, ActionReceiver.ACTION_EDIT) ) .addAction( R.drawable.ic_delete, @@ -58,7 +60,7 @@ class Notification { ActionReceiver.getPendingIntent(context, note, ActionReceiver.ACTION_DELETE) ) .setContentIntent( - ActionReceiver.getPendingIntent(context, note, ActionReceiver.ACTION_SHOW) + getPendingIntentActivity(context, note, ActionReceiver.ACTION_SHOW) ) .setDeleteIntent( ActionReceiver.getPendingIntent(context, note, ActionReceiver.ACTION_DISMISS) @@ -117,5 +119,18 @@ class Notification { ) } + private fun getPendingIntentActivity(context: Context, note: Notes.Note, action: String): PendingIntent { + val intent = Intent(context, DialogActivity::class.java) + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + intent.action = action + intent.putExtra(ActionReceiver.EXTRA_NOTE, note) + return PendingIntent.getActivity( + context, + note.id, + intent, + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT + ) + } + } } \ No newline at end of file