I'm a little confused about what size an icon should be for my application's notification action items. I want to make the action items compatible for Android wear, but there is no documentation (that I can find) on what size to make the icons.
Looking at sample android wear projects, I see that the icon sizes for the android wear action items are 64dp x 64dp (for instance, reply). Looking from google source examples, I'm seeing that icon sizes for action items on phones match those of the action bar, with 32dp x 32dp size and a 24dp x 24dp optical square, also specified here.
When I keep the icons at 32x32, they look terrible on the android wear device, and when I keep them as 64x64, they are too large for the action item bar on the phone.
Is there a way (different res folder? using the WearableExtender?) to have the phone use a different icon for action items than the wearable?
You need to specify the actions once again using the WearableExtender
class. It will allow you to set a set of actions that will be visible only on Android Wear device (the original actions added to NotificationCompat.Builder
will not be visible if you set at least one action via WearableExtender
. So basically you just need to "repeat" all the actions in WearableExtender
and specify different (bigger) icons there.
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.addAction(new NotificationCompat.Action(R.drawable.reply_phone, "Reply", pendingIntent));
builder.extend(new NotificationCompat.WearableExtender()
.addAction(new NotificationCompat.Action(R.drawable.reply_wear, "Reply", pendingIntent))
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With