在Android 5.X的UI射击Material Design中,更是使用了大量的动画效果,同事Google也在官方文档上增加了对动画的设计指导。

Ripple效果

在Android 5.0后,material Design大量使用了Ripple效果,那就是点击后的波纹效果。

//波纹有边界
android:background=”?android:attr/selectableItemBackground”

//波纹超出边界
android:background=”?android:attr/selectableItemBackgroundBorderless”

在Drawable里面创建XML实现Ripple效果

<?xml version="1.0" encoding="utf-8"?><ripple xmlns:android="http://schemas.android.com/apk/res/android"        android:color="@color/text_sub_other_color">    <item>        <shape android:shape="rectangle">            <solid android:color="?android:colorAccent"/>        shape>    item>ripple>

使用方法所示

 "@+id/ll_home"                android:layout_width="0dp"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="@drawable/bg_ripple_btn"                android:gravity="center"                android:orientation="vertical">                "@+id/tv_home_text"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_marginTop="@dimen/dp_2"                    android:drawablePadding="@dimen/dp_3"                    android:drawableTop="@drawable/main_bottom_tab_home"                    android:text="@string/menu_text_home"                    android:textColor="@drawable/event_select_text"                    android:textSize="@dimen/font_size_12"/>            </LinearLayout>

如果觉得我的文章对您有用,请点顶。您的支持将鼓励我继续码蛋!

更多相关文章

  1. Android学习之 UI效果
  2. android手势操作滑动效果触摸屏事件处理
  3. android UI进阶之弹窗的使用(2)--实现通讯录的弹窗效果
  4. Android中利用GridView实现水平和垂直均有滚动条的表格效果
  5. LottieAnimationView 使用无法显示效果
  6. android 按钮背景色的渐变效果实现
  7. Android之——史上最简单最酷炫的3D图片浏览效果的实现
  8. android之字体阴影效果
  9. android资讯类软件框架

随机推荐

  1. php上传图片无法显示的问题
  2. 详解php中整数判断的方法(附代码)
  3. php中的绘图技术详解
  4. PHP如何实现支付宝支付功能(图文详解)
  5. PHP 数组常用函数总结
  6. PHP重置数组为连续数字索引的三种方式
  7. PHP中箭头函数的实例详解
  8. PHP根据键值合并数组
  9. php单例模式 使用场景和使用方法
  10. 学习PHP死循环写法和作用