Skip to content

Commit

Permalink
v1.7.3
Browse files Browse the repository at this point in the history
- fix dialog not showing
  • Loading branch information
Yanndroid committed Dec 22, 2023
1 parent da5ac8b commit 4a4a299
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 13,
"versionName": "1.7.2",
"versionCode": 14,
"versionName": "1.7.3",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
19 changes: 17 additions & 2 deletions app/src/main/java/de/dlyt/yanndroid/notinotes/Notification.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,15 +52,15 @@ 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,
context.getString(R.string.del),
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)
Expand Down Expand Up @@ -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
)
}

}
}

0 comments on commit 4a4a299

Please sign in to comment.