Ym--android 5.0 Learning using material themes

Source: Internet
Author: User

Objective

After creating the simulator, I think we are already eager to develop the Android 5.0 project,

After reading this article we will be able to customize the material theme!

What does the new material theme offer?

A system control that lets you set the color palette.

The touch feedback animation for the control (designed).

Activity Transitions Animation

Let's have a look at how many material themes Android gives me!


it seems to give me a lot of commonly used themes, but these themes far enough to meet the needs of my big brothers! As for why, I think we all know. Let's customize the material theme.according to the official to provide the definition of the picture hintcolor Tone (Customize other things to the same principle)
let's start by defining several different colors.
then add a custom theme to inherit the material theme set the corresponding parts color
<?xml version= "1.0" encoding= "Utf-8"?><resources>    <!--inherit from the material theme    - <style name= "Apptheme" parent= "android:Theme.Material" >        <item name= "android:colorprimary" > @color/ Color1        </item>        <item name= "Android:colorprimarydark" > @color/color2        </item>        <item name= "Android:textcolorprimary" > @color/color3        </item>        <item name= "Android: Windowbackground "> @color/color4        </item>        <item name=" Android:navigationbarcolor "> @color/ Color5</item>    </style></resources>
Finally, configure the theme in Androidmanifast
run See effect
ok~! OK, very simple, everyone try it ~!

Ym--android 5.0 Learning using material themes

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.