一.如何引入这种效果:
使用Material主题后,App 就具有了RippleEffect效果即水波效果的touch feedback。
如果不是Material,也可以使用水波效果,需要手动配置。

三.下面使用demo 展示效果,demo中的布局文件如下所示:
Ripple 效果总结

code 1
系统有边界android:background="?android:attr/selectableItemBackground”      
Ripple 效果总结
code 2
系统无边界:android:background="?android:attr/selectableItemBackgroundBorderless"
Ripple 效果总结




code 3 
Ripple 效果总结

Ripple 效果总结



code 4
Ripple 效果总结

Ripple 效果总结




code 5

Ripple 效果总结
Ripple 效果总结

code 6

Ripple 效果总结
Ripple 效果总结

code 7
Ripple 效果总结

Ripple 效果总结

code 8
Ripple 效果总结

Ripple 效果总结

code 9
Ripple 效果总结

Ripple 效果总结

code 10
Ripple 效果总结
Ripple 效果总结

code 11
Ripple 效果总结
Ripple 效果总结

code 12

四 总结
1.有mask :背景不管设置什么都不显示
2.无mask:显示背景
3.设置了item:水波有范围
4.不设置item:水波扩散到view外
5.可以有多个item,RippleDrawable 继承自LayerDrawable




相关文章:

  • 2021-11-25
  • 2021-12-25
  • 2021-07-29
  • 2021-10-25
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-26
  • 2021-12-02
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案