I am working on a Pomodoro app for Android Wear.
I want to make it look like a standard UI / UX timer , I assume that it is implemented using a notification display / update with a timer as a header, so I'm showing a notification and periodically updating it from the Service:
private void updateNotification() { Intent stopActionIntent = new Intent(this, PomodoroActivity.class); stopActionIntent.setAction(PomodoroActivity.ACTION_STOP); PendingIntent stopActionPendingIntent = PendingIntent.getActivity(this, 0, stopActionIntent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Action stopAction = new NotificationCompat.Action.Builder( R.drawable.ic_stop, getString(R.string.stop_pomodoro), stopActionPendingIntent) .build(); Notification notification = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.bg_pomodoro_timer)) .setContentTitle(convertDiffToTimer(System.currentTimeMillis(), timerDeadlineMs)) .setPriority(Notification.PRIORITY_MAX) .setOngoing(true) .extend(new NotificationCompat.WearableExtender().addAction(stopAction)) .build(); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); notificationManager.notify(1, notification); }
The problem of dissatisfaction with such a solution blinks from notificaiton.
Any ideas how the escape blinks? Or maybe another way to achieve targeted behavior?
android android wear
AlexKorovyansky Aug 26 '14 at 6:59 a.m. 2014-08-26 06:59
source share