Material Design Get Started

Source: Internet
Author: User

Design your application with material:

      1. Take a look at the material design specification.
      2. Apply the material theme to your app.
      3. Define additional styles to customize the material theme.
      4. Create your layouts following material design guidelines.
      5. Specify the elevation of your views to cast appropriate shadows.
      6. Use the new widgets to complex views, such as lists and cards.
      7. Use the new APIs to customize the animations in your app.

Update Your App for the Android L Developer Preview

To upgrade existing apps for Android L Developer Preview, you can refer to the material Design guidelines for designing new layouts that enhance the user experience with touch feedback and UI animations.

Create New Apps for the Android L Developer Preview

For the Android L Developer Preview new app, the Material design guidelines provide a cohesive framework for your app to comply with these guidelines and new features in your app design and development.

Apply the Material Theme

To use Material theme in your app, you must declare android:Theme.Material in style:

[HTML]View Plaincopyprint?
  1. <!--Res/values/styles.xml--
  2. <resources>
  3. <!--your app ' s theme inherits from the Material theme -
  4. <style name= "apptheme" parent="android:Theme.Material">
  5. <!--Theme Customizations --
  6. </style>
  7. </Resources>

Material Theme provides a new system widgets that lets you use the color palette and default animations in touch feedback, activity switching. For more details, refer to material Theme.

Design Your Layouts

In addition to using or customizing the material theme, your layout must be aligned with the material theme guidelines. When you design your application, pay attention to the following points:

      • Baseline grids
      • Keylines
      • Spacing
      • Touch Target Size
      • Layout structure

Specify elevation in Your views

The view can cast shadows, the elevation value of the view determines its shadow size and its drawing order, and in your layout you can set the Android:elevation property to define the elevation of the projection.

[HTML]View Plaincopyprint?
  1. <TextView
  2. android:id="@+id/my_textview"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:text="@string/next"
  6. android:background="@color/white"
  7. android:elevation="5DP" />



The new Translationz property allows you to create an animation that reflects a temporary change in elevation for the view, which is useful for touch gestures. For more details, please refer to views and Shadows.

Use the New UI Widgets


Recyclerview improves display dynamic view performance for ListView and is easier to use. CardView is a card.

View, which displays information within the card. You can create CardView in the following ways.

[HTML]View Plaincopyprint?
    1. < android.support.v7.widget.cardview  
    2.      android:id= "@+id/card_view" &NBSP;&NBSP;
    3.     android:layout_width= "200DP" &NBSP;&NBSP;
    4.     android:layout_height= "200DP "&NBSP;&NBSP;
    5.     card_view: Cardcornerradius= "3DP" >  
    6.     ...  
    7. </ android.support.v7.widget.cardview>  


For more details, refer to UI Widgets.

Customize Your Animations

The Android L Developer Preview provides new APIs to support the creation of custom animations. You can create activation transitions and exit transitions for activity.

[Java]View Plaincopyprint?
    1. Inside your Activity
    2. GetWindow (). Requestfeature (window.feature_content_transitions);
    3. Set an exit transition
    4. GetWindow (). Setexittransition (new Explode ());


When you start another activity, the exit transition is active.

To learn more about new features, please refer to: animations.

Reference:

Http://developer.android.com/preview/material/get-started.htm

Material Design Get Started

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.