Notifications on EPD

EPD is perfect for displaying notifications. Users like to hold YotaPhone with the EPD facing up and periodically check it. For YotaPhone user EPD is the usual place where he can check that something new happened.

To display EPD notification, you need to apply object com.yotadevices.sdk.EpdNotificationExtender to your standard Notification.Builder (https://developer.android.com/reference/android/app/Notification.Builder.html). You can do it using builder.extend(new EpdNotificationExtender()) method.

Notifications on EPD support many standard methods of Notification.Builder. Here is an example:

    Notification notification = new Notification.Builder(this)
            .setSmallIcon(Icon.createWithResource(this, R.drawable.ic_email_white_24dp))
            .setContentTitle("John Doe")
            .setContentText("YotaPhone2 updated to Android Marshmallow")
            .setSubText("Yay! This is so awesome!!!")
            .setContentIntent(contentPI)
            .setAutoCancel(true)
            .setDeleteIntent(deletePI)
            .addAction(new Notification.Action.Builder(
                    Icon.createWithResource(this, R.drawable.ic_drafts_white_24dp),
                    "Mark",
                    markPI).build())
            .addAction(new Notification.Action.Builder(
                    Icon.createWithResource(this, R.drawable.ic_reply_all_white_24dp),
                    "Reply",
                    replyPI).build())
            .extend(new EpdNotificationExtender())
            .build();
    NotificationManager noMan = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    noMan.notify(0, notification);

As a result, this notification will appear on EPD:

6_notifications+on+epd_notification.png

If you want to display full screen notification on EPD (occluding status-bar) please use EpdNotificationExtender#setEpdFullScreenOnly(boolean) method:

    builder.extend(new EpdNotificationExtender().setEpdFullScreenOnly(true))