Android XML中的涟漪效应持续时间



我正在学习材料设计。我用gradle

在按钮上尝试了涟漪效应
dependencies {
compile 'com.github.traex.rippleeffect:library:1.3'
}

from this https://github.com/traex/RippleEffect link

有许多不工作的属性例如

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>

用户无法体验动画。

在使用应用程序资源之前,您需要在RippleView中添加xmlns:app="http://schemas.android.com/apk/res-auto"作为xmlns

在GitHab的描述页面上的例子中的问题。把

rv_centered="true"

app:rv_centered="true"

,一切都将完成。ReppleView的所有属性必须包含app:

最新更新