Android (Lollipop/5.0) Material Design (3) use Material themes

Source: Internet
Author: User

Android (Lollipop/5.0) Material Design (3) use Material themes

Address: https://developer.android.com/intl/zh-tw/training/material/theme.html

The new Material topic provides:

The system Widgets can set their color palette.

System Widgets touch feedback Animation

Activity transition Animation

You can customize a Material topic and use a palette to control it based on your brand logo.

You can use topic attributes to color the operation bar and status bar ,:



Definition of a Material topic:
@ Android: style/Theme. Material (dark version)
@ Android: style/Theme. Material. Light (light version)
@ Android: style/Theme. Material. Light. DarkActionBar

Note: Only 5.0 (api21) and above can be used for a Material topic? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> Custom +/custom + C52LXEU3R5bGU8L3A + custom =" ColorPalette "> Customize the Color Palette custom based on the color is suitable for the theme of your brand, when a Material topic is inherited, you can use the attributes in the Material topic to customize the color.

   
    
  
 
Customize the Status Bar custom Status Bar Material topic allows you to easily Customize the Status Bar, so you can specify a color suitable for your brand and provide sufficient contrast to display white Status icons,

When inherited from the Material topic and set the status bar, the custom color is android: statusBarColor. By default, android: statusBarColor inherits android: colorPrimaryDark.

You can draw the status bar by yourself. For example, if you want to clearly display the status bar in the photo, use a slight black gradient to make sure that the white status bar icon is visible. Therefore, set the attribute android: statusBarColor to @ android: color/transparent, and adjust the flags of the Window as needed. You can also use the Window. setStatusBarColor () method for animation or fading (fading ).

When you customize navigation and status bar, either make them transparent or modify the status bar only. The navigation bar must be black in all other cases.

Theme Individual Views: in layout's xml definition, you can use android: theme to specify the topic that the View applies, it will change the theme of the current View and its sub-View.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.