What are the sizes of the icons in Android notifications action-buttons?

后端 未结 5 1140
灰色年华
灰色年华 2020-12-24 05:26

In expandable Notifications: what dimensions (in dp) should the icons have? Like the Icons for Snooze and Email here:

5条回答
  •  天命终不由人
    2020-12-24 05:58

    So to clarify this, I found the following in the Javadoc within the Android support library:

    Add an action to this notification. Actions are typically displayed by the system as a button adjacent to the notification content.

    Every action must have an icon (32dp square and matching the Holo Dark action bar visual style, a textual label, and a PendingIntent.

    A notification in its expanded form can display up to 3 actions, from left to right in the order they were added. Actions will not be displayed when the notification is collapsed, however, so be sure that any essential functions may be accessed by the user in some other way.

    So these should be identical to your action bar icons (for the Holo Dark theme), which is:

    Asset Size: 32dp x 32dp
    Optical Square: 24dp x 24dp
    Color (Enabled): #FFFFFF 80% opacity
    Color (Disabled): #FFFFFF 30% opacity

提交回复
热议问题