Home | History | Annotate | Download | only in material
      1 page.title= 
      2 
      3 @jd:body
      4 
      5 <div id="tb-wrapper">
      6 <div id="tb">
      7 <h2>  </h2>
      8 <ol>
      9   <li><a href="#ApplyTheme">  Material Design</a></li>
     10   <li><a href="#Layouts"> </a></li>
     11   <li><a href="#Depth">  </a></li>
     12   <li><a href="#ListsCards">   </a></li>
     13   <li><a href="#Animations"> </a></li>
     14 </ol>
     15 <h2>. </h2>
     16 <ul>
     17   <li><a href="http://www.google.com/design/spec"> Material Design</a></li>
     18   <li><a href="{@docRoot}design/material/index.html">Material Design  Android</a></li>
     19 </ul>
     20 </div>
     21 </div>
     22 
     23 
     24 <p>     Material Design</p>
     25 
     26 <ol>
     27   <li style="margin-bottom:10px">
     28       <a href="http://www.google.com/design/spec"> Material Design</a>.</li>
     29   <li style="margin-bottom:10px">
     30      <strong> Material Design</strong>   .</li>
     31   <li style="margin-bottom:10px">
     32      <strong></strong>     Material Design.</li>
     33   <li style="margin-bottom:10px">
     34      <strong></strong>     .</li>
     35   <li style="margin-bottom:10px">
     36       <strong></strong>    .</li>
     37   <li style="margin-bottom:10px">
     38      <strong></strong>   .</li>
     39 </ol>
     40 
     41 <h3>  </h3>
     42 
     43 <p>      Material Design        Android,   5.0.
     44      
     45 <a href="{@docRoot}training/material/compatibility.html"> </a>.</p>
     46 
     47 <h3>     Material Design</h3>
     48 
     49 <p>       Material Design,       Material Design.
     50         ,     .
     51 </p>
     52 
     53 <h3>     Material Design</h3>
     54 
     55 <p>    ""   <a href="http://www.google.com/design/spec"> Material Design</a>,          .
     56                Android.
     57 </p>
     58 
     59 
     60 <h2 id="ApplyTheme">  Material Design</h2>
     61 
     62 <p>   Material Design   ,  ,    
     63 <code>android:Theme.Material</code>:</p>
     64 
     65 <pre>
     66 &lt;!-- res/values/styles.xml -->
     67 &lt;resources>
     68   &lt;!-- your theme inherits from the material theme -->
     69   &lt;style name="AppTheme" parent="android:Theme.Material">
     70     &lt;!-- theme customizations -->
     71   &lt;/style>
     72 &lt;/resources>
     73 </pre>
     74 
     75 <p>  Material Design    ,      ,          .
     76      
     77 <a href="{@docRoot}training/material/theme.html">  Material Design</a>.</p>
     78 
     79 
     80 <h2 id="Layouts"> </h2>
     81 
     82 <p>     Material Design,  
     83 <a href="http://www.google.com/design/spec"> Material Design</a>  .       :
     84 </p>
     85 
     86 <ul>
     87 <li>  ;</li>
     88 <li>;</li>
     89 <li>;</li>
     90 <li>   ;</li>
     91 <li> .</li>
     92 </ul>
     93 
     94 
     95 <h2 id="Depth">  </h2>
     96 
     97 <p>   ,          .
     98     ,    
     99 <code>android:elevation</code>:</p>
    100 
    101 <pre>
    102 &lt;TextView
    103     android:id="&#64;+id/my_textview"
    104     android:layout_width="wrap_content"
    105     android:layout_height="wrap_content"
    106     android:text="&#64;string/next"
    107     android:background="&#64;color/white"
    108     android:elevation="5dp" />
    109 </pre>
    110 
    111 <p>    <code>translationZ</code>   ,       .
    112       
    113 <a href="{@docRoot}training/material/animations.html#ViewState">  
    114 </a>.</p>
    115 
    116 <p>     <a href="{@docRoot}training/material/shadows-clipping.html">    </a>.
    117 </p>
    118 
    119 
    120 <h2 id="ListsCards">   </h2>
    121 
    122 <p>{@link android.support.v7.widget.RecyclerView}      {@link
    123 android.widget.ListView}.         .
    124 {@link android.support.v7.widget.CardView}          .
    125     ,  
    126 {@link android.support.v7.widget.CardView}  :</p>
    127 
    128 <pre>
    129 &lt;android.support.v7.widget.CardView
    130     android:id="&#64;+id/card_view"
    131     android:layout_width="200dp"
    132     android:layout_height="200dp"
    133     card_view:cardCornerRadius="3dp">
    134     ...
    135 &lt;/android.support.v7.widget.CardView>
    136 </pre>
    137 
    138 <p>     <a href="{@docRoot}training/material/lists-cards.html">   </a>.
    139 </p>
    140 
    141 
    142 <h2 id="Animations"> </h2>
    143 
    144 <p>  Android 5.0 ( API 21)   API      .
    145 ,           :
    146 </p>
    147 
    148 <pre>
    149 public class MyActivity extends Activity {
    150 
    151     &#64;Override
    152     protected void onCreate(Bundle savedInstanceState) {
    153         super.onCreate(savedInstanceState);
    154         // enable transitions
    155         getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    156         setContentView(R.layout.activity_my);
    157     }
    158 
    159     public void onSomeButtonClicked(View view) {
    160         getWindow().setExitTransition(new Explode());
    161         Intent intent = new Intent(this, MyOtherActivity.class);
    162         startActivity(intent,
    163                       ActivityOptions
    164                           .makeSceneTransitionAnimation(this).toBundle());
    165     }
    166 }
    167 </pre>
    168 
    169 <p>        .</p>
    170 
    171 <p>    API   .   <a href="{@docRoot}training/material/animations.html">  </a>.</p>
    172