Design your application with material:
- Take a look at the material design specification.
- Apply the material theme to your app.
- Define additional styles to customize the material theme.
- Create your layouts following material design guidelines.
- Specify the elevation of your views to cast appropriate shadows.
- Use the new widgets to complex views, such as lists and cards.
- 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?
- <!--Res/values/styles.xml--
- <resources>
- <!--your app ' s theme inherits from the Material theme -
- <style name= "apptheme" parent="android:Theme.Material">
- <!--Theme Customizations --
- </style>
- </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?
- <TextView
- android:id="@+id/my_textview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/next"
- android:background="@color/white"
- 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?
- < android.support.v7.widget.cardview
- android:id= "@+id/card_view" &NBSP;&NBSP;
- android:layout_width= "200DP" &NBSP;&NBSP;
- android:layout_height= "200DP "&NBSP;&NBSP;
- card_view: Cardcornerradius= "3DP" >
- ...
- </ 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?
- Inside your Activity
- GetWindow (). Requestfeature (window.feature_content_transitions);
- Set an exit transition
- 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