-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lucky
committed
Jul 11, 2022
1 parent
fffaa5d
commit 70cf070
Showing
13 changed files
with
86 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.lucky.duress | ||
|
||
import android.content.Context | ||
import androidx.core.app.NotificationChannelCompat | ||
import androidx.core.app.NotificationCompat | ||
import androidx.core.app.NotificationManagerCompat | ||
|
||
class NotificationManager(private val ctx: Context) { | ||
companion object { | ||
const val CHANNEL_DEFAULT_ID = "default" | ||
private const val GROUP_KEY = "test" | ||
private const val NOTIFICATION_ID = 1000 | ||
} | ||
|
||
private val manager = NotificationManagerCompat.from(ctx) | ||
|
||
fun createNotificationChannels() { | ||
manager.createNotificationChannel( | ||
NotificationChannelCompat.Builder( | ||
CHANNEL_DEFAULT_ID, | ||
NotificationManagerCompat.IMPORTANCE_LOW, | ||
).setName(ctx.getString(R.string.notification_channel_default_name)).build()) | ||
} | ||
|
||
fun send() { | ||
manager.notify( | ||
NOTIFICATION_ID, | ||
NotificationCompat.Builder(ctx, CHANNEL_DEFAULT_ID) | ||
.setSmallIcon(R.drawable.ic_launcher_foreground) | ||
.setContentTitle(ctx.getString(R.string.notification_title)) | ||
.setContentText(ctx.getString(android.R.string.ok)) | ||
.setPriority(NotificationCompat.PRIORITY_LOW) | ||
.setCategory(NotificationCompat.CATEGORY_STATUS) | ||
.setShowWhen(true) | ||
.setAutoCancel(true) | ||
.setGroup(GROUP_KEY) | ||
.setGroupSummary(true) | ||
.build(), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/me/lucky/duress/DeviceAdminManager.kt → .../lucky/duress/admin/DeviceAdminManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/src/main/java/me/lucky/duress/admin/DeviceAdminReceiver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package me.lucky.duress.admin | ||
|
||
import android.app.admin.DeviceAdminReceiver | ||
|
||
class DeviceAdminReceiver : DeviceAdminReceiver() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test mode |
Binary file modified
BIN
+1.85 KB
(100%)
fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.