Skip to content

Commit 0484c49

Browse files
authored
Merge pull request #375 from alabiaga/main
match live update codelab changes and update to use chronometer for c…
2 parents 54e8d1c + 652252a commit 0484c49

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

samples/user-interface/live-updates/src/main/java/com/example/platform/ui/live_updates/SnackbarNotificationManager.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ object SnackbarNotificationManager {
5555
.setSmallIcon(R.drawable.ic_launcher_foreground)
5656
.setContentTitle("You order is being placed")
5757
.setContentText("Confirming with bakery...")
58+
.setShortCriticalText("Placing")
5859
.setStyle(buildBaseProgressStyle(INITIALIZING).setProgressIndeterminate(true))
5960
}
6061
},
@@ -64,6 +65,7 @@ object SnackbarNotificationManager {
6465
return buildBaseNotification(appContext, FOOD_PREPARATION)
6566
.setContentTitle("Your order is being prepared")
6667
.setContentText("Next step will be delivery")
68+
.setShortCriticalText("Prepping")
6769
.setLargeIcon(
6870
IconCompat.createWithResource(
6971
appContext, R.drawable.cupcake
@@ -92,6 +94,9 @@ object SnackbarNotificationManager {
9294
appContext, R.drawable.cupcake
9395
).toIcon(appContext)
9496
)
97+
.setWhen(System.currentTimeMillis().plus(11 * 60 * 1000 /* 10 min */))
98+
.setUsesChronometer(true)
99+
.setChronometerCountDown(true)
95100
}
96101
},
97102
FOOD_ARRIVING(18000) {
@@ -114,6 +119,9 @@ object SnackbarNotificationManager {
114119
appContext, R.drawable.cupcake
115120
).toIcon(appContext)
116121
)
122+
.setWhen(System.currentTimeMillis().plus(11 * 60 * 500 /* 5 min */))
123+
.setUsesChronometer(true)
124+
.setChronometerCountDown(true)
117125
}
118126
},
119127
ORDER_COMPLETE(21000) {
@@ -131,6 +139,7 @@ object SnackbarNotificationManager {
131139
)
132140
.setProgress(100)
133141
)
142+
.setShortCriticalText("Arrived")
134143
.setLargeIcon(
135144
IconCompat.createWithResource(
136145
appContext, R.drawable.cupcake

0 commit comments

Comments
 (0)