Android statusbar icon color

Status Bar Icons

In this document

See also

New Guides for App Designers!

Check out the new documents for designers at Android Design, including more guidelines for Iconography.

Status bar icons are used to represent notifications from your application in the status bar.

As described in Providing Density-Specific Icon Sets and Supporting Multiple Screens, you should create separate icons for all generalized screen densities, including low-, medium-, high-, and extra-high-density screens. This ensures that your icons will display properly across the range of devices on which your application can be installed. See Tips for Designers for suggestions on how to work with multiple sets of icons.

Templates for creating icons in Adobe Photoshop are available in the Icon Templates Pack.

Warning:The style and dimensions of status bar icons have changed dramatically in Android 3.0 and 2.3 compared to previous versions. To provide support for all Android versions, developers should:

  1. Place status bar icons for Android 3.0 and later in the drawable-xhdpi-v11 , drawable-hdpi-v11 , drawable-mdpi-v11 , and drawable-ldpi-v11 directories.
  2. Place status bar icons for Android 2.3 in the drawable-xhdpi-v9 , drawable-hdpi-v9 , drawable-mdpi-v9 , and drawable-ldpi-v9 directories.
  3. Place status bar icons for previous versions in drawable-xhdpi , drawable-hdpi , drawable-mdpi , and drawable-ldpi directories.

Android 3.0 and Later

The following guidelines describe how to design status bar icons for Android 3.0 (API Level 11) and later.

Overview of changes

The design for status bar (notification) icons has been revised in Android 3.0. Status bar icons used in Android 3.0 and later are easier to create, and they allow for more flexible presentation in a variety of situations:

  • Status bar icons are composed simply of white pixels on a transparent backdrop, with alpha blending used for smooth edges and internal texture where appropriate.
  • Icons are square icon contents should fill the available space, although a small amount of internal padding can help maintain balance across status bar icons. See Size and format below for details.

These larger and brighter icons, while highly legible, are too intense for use on dark phone status bars. These icons would be too distracting if used directly in the status bar. Therefore:

  • The system automatically resizes and dims these icons in such situations and developers do not need to supply a separate icon for this purpose. See Automatic dimming below for more on this behavior.

Size and format

Status bar icons should be 32-bit PNGs with an alpha channel for transparency. The finished status bar icon dimensions corresponding to a given generalized screen density are shown in the table below.

Note: The system will shrink and dim status bar icons to minimize distractions, allowing users to focus on the foreground activity.

Читайте также:  Код элемента гугл хром андроид

Table 1. Summary of finished icon dimensions for each generalized screen density.

ldpi (120 dpi)
(Low density screen)
mdpi (160 dpi)
(Medium density screen)
hdpi (240 dpi)
(High density screen)
xhdpi (320 dpi)
(Extra-high density screen)
Status Bar Icon Size
(Android 3.0 and Later)
18 x 18 px 24 x 24 px 36 x 36 px 48 x 48 px

You can also include a few pixels of padding in status bar icons to maintain a consistent visual weight with adjacent icons. For example, a 48 x 48 pixel xhdpi status bar icon can contain a 44 x 44 pixel shape with 2 pixels on each side for padding.

Style, colors, and effects

Status bar icons are flat, pictured face on, and must be white on a transparent background.

In order to maintain consistency across all status bar notifications, status bar icons should use the styling shown in Figure 1.

Figure 1. Style for status bar icons.

1. Fill color: #ffffff
2. Inner content: Inner content should subtract from the outer shape and consist purely of transparent pixels.

Automatic dimming

The system may dim and shrink status bar icons to allow users to focus on the foreground activity. For example, in Android 4.0, the platform-standard status bar for handset-size devices reduces icons to 18 x 18 dip and 40% opacity in the status bar, while drawing them full-size and at full intensity in the expanded notification panel. An example of what this looks like is shown below in Figure 2.

Figure 2. Automatic shrinking and dimming behavior in Android 3.0 and later.

Example icons

Shown below are example extra-high-density status bar icons that are used throughout Android system applications.

Warning: Because resources can change between platform versions, you should not reference built-in icons using the Android platform resource IDs (i.e. status bar icons under android.R.drawable ). If you want to use any icons or other internal drawable resources, you should store a local copy of those icons or drawables in your application resources, then reference the local copy from your application code. In that way, you can maintain control over the appearance of your icons, even if the system’s copy changes. Note that the grid below is not intended to be complete.

Android 2.3

The following guidelines describe how to design status bar icons for Android 2.3 (API Levels 9 and 10).

Size and positioning

Status bar icons should use simple shapes and forms and those must be scaled and positioned inside the final asset.

Figure 3 illustrates various ways of positioning the icon inside the asset. You should size the icons smaller than the actual bounds of the asset. Status bar icons may vary in width, but only minimally.

In order to indicate the recommended size for the icon, each example in Figure 3 includes two different guide rectangles:

  • The red box is the bounding box for the full asset.
  • The blue box is the recommended bounding box for the actual icon. The icon box is sized smaller vertically than the full asset box to allow for varying icon shapes while maintaining a consistent visual weight.

Figure 3. Status bar icon sizing and positioning inside the bounds of the icon asset.

Style, colors, and effects

Status bar icons are flat, matte, and pictured face-on.

  1. Status bar icon dimensions for high-density ( hdpi ) screens:
    1. Full Asset: 24w x 38h px (preferred, width may vary)
    2. Icon: 24w x 24h px (preferred, width may vary)
  1. Status bar icon dimensions for medium-density ( mdpi ) screens:
    1. Full Asset: 16w x 25 px (preferred, width may vary)
    2. Icon: 16w x 16w px (preferred, width may vary)
  1. Status bar icon dimensions for low-density ( ldpi ) screens:
    1. Full Asset: 12w x 19h px (preferred, width may vary)
    2. Icon: 12w x 12h px (preferred, width may vary)

Figure 4. Style and effects for status icons.

Note: all pixel dimensions are for medium density and should be scaled appropriately for other densities.

1. Fill gradient: 90°, from #828282 to #919191
2. Inner shadow: #FFFFFF , 10% opacity
angle 90°
distance 1px
size 0px
3. Inner content: Inner content should subtract from the outer shape and consist purely of transparent pixels.

Do’s and don’ts

Below are some «do and don’t» examples to consider when creating status bar icons for your application.

Example icons

Shown below are standard high-density status bar icons that are used in the Android platform.

Warning: Because these resources can change between platform versions, you should not reference these icons using the Android platform resource IDs (i.e. status bar icons under android.R.drawable ). If you want to use any icons or other internal drawable resources, you should store a local copy of those icons or drawables in your application resources, then reference the local copy from your application code. In that way, you can maintain control over the appearance of your icons, even if the system’s copy changes. Note that the grid below is not intended to be complete.

Android 2.2 and Earlier

The following guidelines describe how to design status bar icons for Android 2.2 (API Level 8) and earlier.

Structure

  • Rounded corners must always be applied to the base shape and to the details of a status bar icon shown Figure 5.
  • All dimensions specified are based on a 25×25 pixel artboard size with a 2 pixel safeframe.
  • Status bar icons can overlap the safeframe to the left and right when necessary, but must not overlap the safeframe at the top and bottom.
  • Final art must be exported as a transparent PNG file.
  • Templates for creating status bar icons using Adobe Photoshop are available in the Icon Templates Pack.

Figure 5. Safeframe and corner-rounding for status bar icons. Icon size is 25×25.

Light, effects, and shadows

Status bar icons are slightly debossed, high in contrast, and pictured face-on to enhance clarity at small sizes.

Figure 6. Light, effects, and shadows for status bar icons.

1. Front part: Use fill gradient from primary color palette
2. Inner bevel: depth 100% | direction down
size 0px | angle 90° |
altitude 30°
highlight white 75% opacity
shadow black 75% opacity
3. Detail: white
4. Disabled detail: grey gradient from palette
+ inner bevel: smooth | depth 1% | direction down | size 0px | angle 117° |
altitude 42° | highlight white 70% | no shadow

Color palette

Only status bar icons related to the phone function use full color; all other status bar icons should remain monochromatic.

Источник

Status bar icons color #24472

Comments

shabib3 commented Nov 17, 2018

I defined my status bar color to transparent (also try it with white color), but the icons on the status bar are also white. how can I set another color to them?

I also took a look on this issue #17231

The text was updated successfully, but these errors were encountered:

zoechi commented Nov 17, 2018

Please add the output of flutter doctor -v
and a minimal runnable reproduction in a single file ( lib/main.dart )

shabib3 commented Nov 17, 2018

flutter doctor -v:

and a sample is:

take a look (on Android — didn’t try on IOS) that the icons is white like the status bar color so they are hidden. How can I change the icon and text color to be readable (black/grey)?

bugslab commented Nov 19, 2018 •

@shabib3
The AppBar widget automatically sets the system overlay style based on its brightness . So you can remove AppBar and try again.
However it seems cannot change the statusbar color no matter what pass in.
app_bar.dart/_AppBarState.build(..)

jonahwilliams commented Nov 19, 2018

You cannot provide a status bar color to the app bar, but you can create your own annotated region. It’s not very intuitive right now, but you can use sized: false to override the child annotated region created by the app bar.

Somewhere, perhaps as a child of the scaffold:

Note that not all Android versions support status bar color or icon brightness. See the documentation on SystemUiOverlayStyle for the caveats.

Источник

Android statusbar иконки цвет

мне было интересно, можно ли изменить строку состояния иконы цвета (не цвет строки состояния, colorPrimaryDark ) Допустим, я хочу эту строку состояния с:
@android:color/white

и значки в черный, это возможно?

EDIT:

новое в M developer preview: windowLightStatusBar. Включаю это в вашей теме говорится, что система использует темный передний план, полезен более светлые цветные строки состояния. Обратите внимание на предпросмотр м, кажется, есть ошибка где значки уведомлений остаются белыми, а значки состояния системы правильно измените на полупрозрачный черный.

от: Роман Нурик Google+ post

5 ответов:

не с Lollipop. Начиная с Android 5.0, в руководстве говорится:

значки уведомлений должны быть полностью белый.

даже если это не так, система будет рассматривать только альфа-канал вашего значка, делая их белыми

решение

единственный способ иметь цветной значок на леденец, чтобы опустить targetSdkVersion значения , но я думаю, что вам лучше следовать рекомендациям и использовать белые значки только.

Если вы все же решите, что хотите цветные значки, вы можете использовать DrawableCompat.setTint метод из новой библиотеки поддержки v4.

да, можно изменить его на серый (без пользовательских цветов), но это работает только с API 23 и выше вам нужно только добавить это в свои значения-v23/styles.xml

@eOnOe ответил, как мы можем изменить оттенок строки состояния через xml. Но мы также можем изменить его динамически в коде:

если у вас уровень API меньше 23, чем вы должны использовать его таким образом. он работал для меня объявить это под v21 / style.

задание windowLightStatusBar до true не работает с телефонами Mi, некоторыми телефонами Meizu, телефонами Blackview, WileyFox и т. д. Я нашел такой хак для устройств Mi и Meizu. Это не комплексное решение этой проблемы производительности, но, возможно, это было бы полезно для кого-то.

и я думаю, было бы лучше сказать вашему клиенту, что окраска строки состояния (например) белый — это не очень хорошая идея. вместо использования различных хаков было бы лучше определить соответствующие colorPrimaryDark по рекомендации

Источник

Читайте также:  Топ чисток для андроид
Оцените статью