Filter AOSP lockscreen notifications
This commit is contained in:
@@ -74,6 +74,7 @@ class MainActivity : AppCompatActivity() {
|
||||
"chronometer" -> postChronometer()
|
||||
"timeout" -> postTimeout()
|
||||
"group" -> postGroup()
|
||||
"group_exception" -> postGroup(exceptionText = true)
|
||||
"cancel_text" -> manager.cancel(TEXT_ID)
|
||||
"cancel_all" -> manager.cancelAll()
|
||||
}
|
||||
@@ -120,8 +121,9 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
private fun postTimeout() = manager.notify(TIMEOUT_ID, base().setContentTitle("Timeout test").setContentText("This should expire automatically.").setTimeoutAfter(2_000).build())
|
||||
|
||||
private fun postGroup() {
|
||||
manager.notify(GROUP_CHILD_ONE, base().setContentText("Grouped child one").setGroup(GROUP_KEY).build())
|
||||
private fun postGroup(exceptionText: Boolean = false) {
|
||||
val first = if (exceptionText) "Edited message" else "Grouped child one"
|
||||
manager.notify(GROUP_CHILD_ONE, base().setContentText(first).setGroup(GROUP_KEY).build())
|
||||
manager.notify(GROUP_CHILD_TWO, base().setContentText("Grouped child two").setGroup(GROUP_KEY).build())
|
||||
manager.notify(GROUP_SUMMARY, base().setContentTitle("Grouped summary").setGroup(GROUP_KEY).setGroupSummary(true).build())
|
||||
}
|
||||
@@ -150,6 +152,7 @@ class MainActivity : AppCompatActivity() {
|
||||
"Post very long text" to "very_long_text",
|
||||
"Post inbox" to "inbox", "Post progress" to "progress", "Update progress" to "progress_update",
|
||||
"Post chronometer" to "chronometer", "Post timeout" to "timeout", "Post group" to "group",
|
||||
"Post group with matching child" to "group_exception",
|
||||
"Cancel text" to "cancel_text", "Cancel all" to "cancel_all",
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user