Creating Apps with Material design--using the Material Theme

Source: Internet
Author: User

reprint Please specify Http://blog.csdn.net/eclipsexys translation from developer Android, time haste, there are translation questions please note that, thank you

using material Themes
The subject of this new material is:
Allows you to set your own custom color palette

To customize the theme's underlying colors to fit your brand, use the custom colors you define from the material theme Theme Inheritance property:


System components

Touch feedback animation for system parts

Activity Transitions Animation


You can customize the appearance of the material theme according to a color palette, which you control your brand image. You can adjust the action bar and use the theme properties of the status bar, 3.

The system components have a new design and a touch-feedback animation. You can customize color palette, touch feedback animations and activities to transform into your app.

The subject of the material is defined as:

    @android: style/theme.material (Dark Version)    @android: Style/theme.material.light (light version)    @android: Style/theme.material.light.darkactionbar

For a list of material styles that you can use, see the API reference for R.style.




Custom color palette
To customize the theme's underlying colors to fit your brand, use the custom colors you define from the material theme Theme Inheritance property:

<resources>  <!--inherit from the material theme to  <style name= "Apptheme" parent= "Android: Theme.material >    <!--Main Theme Colors--    <!--   your app branding color for the app bar-->
   <item name= "Android:colorprimary" > @color/primary</item>    <!--   Darker variant for the status Bar and contextual app bars-    <item name= "Android:colorprimarydark" > @color/primary_dark</item>    <!--   theme UI controls like checkboxes and text--    <item name= "Android:coloraccent" > @color/accent</item>  </style></resources>


Customizing the status bar
With the material theme, you can easily customize the status bar so you can specify a suitable actionbar and provide enough contrast to show the color of the white status icon. To set the custom color, status bar, use the Android:statusbarcolor property when you extend the material theme. By default, Android:statusbarcolor inherits the Android:colorprimarydark.

For example, if you want to display a photo on a transparent status bar, a subtle dark gradient to make sure that the White status icon is visible. To do this, set the Android:statusbarcolor property to @android:color/transparent and adjust the window's flags as needed. You can also use the Window.setstatusbarcolor () method to animate or fade.

Note: The status bar should almost always have a clear definition from the main toolbar, except here you show the edge of these bars to the edge of rich images or media content and situations when you use a gradient to make sure the icons are still visible.

When you customize the navigation bar and the status bar, you can make them both transparent or only modify the status bar. The navigation bar should remain black in all other cases.


Creating Apps with Material design--using the Material Theme

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.