2

On a wearable my app displays a rest timer as shown in the picture. It simply counts down and is updated each second.

My problem is that since it is updated each second, it creates a flickering effect.

  • The icon is hidden for just long enough for you to be able to notice it.

  • The actions related to the card (accessible through swiping) also flicker similarly, and at times display the totally wrong information such as another items icon and text. The actions are same for the whole duration of the rest timer.

Ive tried updating it each 5 seconds or so but it unfortunately ruins the whole thing and makes it very unintuitive. Its my best option at the moment though.

Is it possible to update the notification each second without causing the flicker?

Wearable app

zoltish
  • 2,122
  • 19
  • 37

1 Answers1

0

If you want to show a notification with a timer, either counting up or down, that's a built-in feature for that. Here's some code I wrote that puts it all together for Android Wear:

https://github.com/danwallach/XStopwatch/blob/master/wear/src/main/java/org/dwallach/xstopwatch/NotificationHelper.java

Notably, you'll want your notification builder to do something like this: builder.addAction(android.R.drawable.ic_media_pause, "", clickPendingIntent) .setWhen(eventTime) .setUsesChronometer(true) .setShowWhen(true);

  • This is what I also found shortly after posting the question, superb solution and they should really highlight this in the documentation. Thank you Dan & fingers crossed that others will have use of this. – zoltish May 16 '15 at 17:57