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="#Elevation"></a></li> 10 <li><a href="#Shadows"></a></li> 11 <li><a href="#Clip"></a></li> 12 </ol> 13 <h2></h2> 14 <ul> 15 <li><a href="http://www.google.com/design/spec"></a></li> 16 <li><a href="{@docRoot}design/material/index.html">Android </a></li> 17 </ul> 18 </div> 19 </div> 20 21 <p> UI 22 </p> 23 24 <p> Z Z 25 Z Z Z 26 </p> 27 28 <p> 29 </p> 30 31 <p> 32 </p> 33 34 <p> 35 <a href="http://www.google.com/design/spec/what-is-material/objects-in-3d-space.html">3D </a> 36 </p> 37 38 39 <h2 id="Elevation"></h2> 40 41 <p> Z 42 43 <ul> 44 <li></li> 45 <li></li> 46 </ul> 47 48 <p><code>Z = elevation + translationZ</code></p> 49 50 <img src="{@docRoot}training/material/images/shadows-depth.png" width="580" height="261" alt="" /> 51 <p class="img-caption"><strong> 1</strong> - </p> 52 53 <p> <code>android:elevation</code> 54 55 {@link android.view.View#setElevation View.setElevation()} </p> 56 57 <p> {@link android.view.View#setTranslationZ 58 View.setTranslationZ()} </p> 59 60 <p> {@link android.view.ViewPropertyAnimator#z ViewPropertyAnimator.z()} {@link 61 android.view.ViewPropertyAnimator#translationZ ViewPropertyAnimator.translationZ()} 62 63 {@link android.view.ViewPropertyAnimator} API <a href="{@docRoot}guide/topics/graphics/prop-animation.html"></a> 64 </p> 65 66 <p> {@link android.animation.StateListAnimator} 67 68 <a href="{@docRoot}training/material/animations.html#ViewState"></a> 69 </p> 70 71 <p>Z dp</p> 72 73 74 <h2 id="Shadows"></h2> 75 76 <p><strong></strong> 77 78 </p> 79 80 <p></p> 81 82 <pre> 83 <TextView 84 android:id="@+id/myview" 85 ... 86 android:elevation="2dp" 87 android:background="@drawable/myrect" /> 88 </pre> 89 90 <p></p> 91 92 <pre> 93 <!-- res/drawable/myrect.xml --> 94 <shape xmlns:android="http://schemas.android.com/apk/res/android" 95 android:shape="rectangle"> 96 <solid android:color="#42000000" /> 97 <corners android:radius="5dp" /> 98 </shape> 99 </pre> 100 101 <p> 102 </p> 103 104 <p><p> 105 106 <ol> 107 <li> {@link android.view.ViewOutlineProvider} </li> 108 <li> {@link android.view.ViewOutlineProvider#getOutline getOutline()} </li> 109 <li> {@link 110 android.view.View#setOutlineProvider View.setOutlineProvider()} </li> 111 </ol> 112 113 <p> 114 {@link android.graphics.Outline} 115 <code>null</code> 116 </p> 117 118 119 <h2 id="Clip"></h2> 120 121 <p> {@link android.view.View#setClipToOutline 122 View.setClipToOutline()} <code>android:clipToOutline</code> 123 124 125 {@link android.graphics.Outline#canClip Outline.canClip()} 126 </p> 127 128 <p> {@link android.view.View#setClipToOutline View.setClipToOutline()} 129 130 </p> 131 132 <p> 133 <a href="{@docRoot}training/material/animations.html#Reveal"></a></p> 134