【开源】Material Ripple Layout
Material Ripple Layout
- https://github.com/balysv/material-ripple
介绍:
让指定View显示Material Ripple 效果的控件。很多Ripple效果都只针对一种特定的View,但是Material Ripple Layout可以通过简单的代码让任何view都显示Ripple效果。运行效果:
![]()
-
使用说明:
在代码中:
123MaterialRippleLayout.on(view).rippleColor(Color.BLACK).create();或者直接将需要ripple效果的view放在
MaterialRippleLayout的内部12345678910<com.balysv.materialripple.MaterialRippleLayoutandroid:id="@+id/ripple"android:layout_width="match_parent"android:layout_height="wrap_content"><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_gravity="center"android:text="Button inside a ripple"/></com.balysv.materialripple.MaterialRippleLayout>可以设置下列属性:
1234567891011app:rippleOverlay="true"// if true, ripple is drawn in foreground; false - backgroundapp:rippleColor="#ff0000"// color of rippleapp:rippleAlpha="0.1"// alpha of rippleapp:rippleDimension="10dp"// radius of hover and starting rippleapp:rippleHover="true"// if true, a hover effect is drawn when view is touchedapp:rippleInAdapter="true"// if true, MaterialRippleLayout will optimize for use in AdapterViewsapp:rippleDuration="350"// duration of ripple animationapp:rippleFadeDuration="75"// duration of fade out effect on rippleapp:rippleDelayClick="true"// if true, delays calls to OnClickListeners until ripple effect endsapp:rippleBackground="#FFFFFF"// background under ripple drawable; used with rippleOverlay="false"app:ripplePersistent="true"// if true, ripple background color persists after an如果你是想用在
AdapterView中,需要将rippleInAdapter设置为true
posted on 2015-04-01 15:55 wasdchenhao 阅读(618) 评论(0) 收藏 举报

浙公网安备 33010602011771号