Website address: https://developer.android.com/intl/zh-tw/training/material/get-started.html
Apply the Material Theme material theme
<!--res/values/styles.xml --<resources> <!--your theme inherits from the material theme - <style name="Apptheme" Parent="Android:Theme.Material"> <!--Theme Customizations - </style></resources>
Design Your Layouts Designing your layout
in addition to applying and customizing the material theme, your layout should conform to the material design guidelines. When you design your layout , you need to pay special attention to the following :
Baseline grid
Keylines
Spacing
Touch Target Size
Layout structure
Specify elevation in Your viewsspecifying the Elevation property in viewView can cast a shadow, the elevation value of a view determines its shadow size and the order in which it is drawn. You can set the elevation of a view, inuse in layoutsProperties: Android:elevation
<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 enables you to create an animation that reflects a transient elevation change. Elevation'sChangecan be inResponsemay be useful when touching gestures.
Customize Your Animations Custom animations can be customized animations, such as animating transition animations and ending transitions animations for activity
Public class myactivity extends Activity { @Override protected voidonCreate(Bundlesavedinstancestate) { Super.onCreate(savedinstancestate); //Enable TransitionsGetWindow().requestfeature(Window.feature_content_transitions);Setcontentview(R.Layout.activity_my); } Public voidonsomebuttonclicked(ViewView) {GetWindow().setexittransition(New Explode()); IntentIntent= New Intent( This, myotheractivity.class);startactivity(Intent, activityoptions .makescenetransitionanimation( This).Tobundle()); }}When you start other activity in this activity, exit transition will be activated
Android (lollipop/5.0) Material Design (ii) Getting Started Guide