【发布时间】:2015-09-23 22:51:30
【问题描述】:
我正在学习材料设计。我尝试使用这个 gradle 对按钮产生涟漪效应
dependencies {
compile 'com.github.traex.rippleeffect:library:1.3'
}
来自这个https://github.com/traex/RippleEffect链接
有很多属性不起作用 比如
app:rv_rippleDuration="1200"
app:rv_color="#d3d3d3"
我在按钮上有事件和涟漪效果,但是当我点击按钮时,方法被调用。我想要的是第一个涟漪效应应该完成,然后应该采取行动。
XML 代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<com.andexert.library.RippleView
android:id="@+id/ripple1"
android:layout_width="match_parent"
android:layout_height="match_parent"
rv_centered="true"
app:rv_rippleDuration="1800"
app:rv_color="#000000">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/fromDateButton" />
</com.andexert.library.RippleView>
</LinearLayout>
用户无法体验动画。
【问题讨论】:
-
直接在 repo 上打开一个问题。你会得到更好的回应。
-
不要在 XML 文件中添加,而是尝试在 java 代码中添加持续时间。
-
知道该怎么做。
-
github.com/traex/RippleEffect/issues/66 在 git hub 上打开问题
标签: android xml android-studio material-design ripple