Ashish Kudale
Ashish Kudale

Reputation: 1260

Ripple Effect Duration in Android XML

I am Learning Material Design. I tried ripple effect on button using this gradle

dependencies {
compile 'com.github.traex.rippleeffect:library:1.3'
}

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

there are many attribute which are not working such as

app:rv_rippleDuration="1200"
app:rv_color="#d3d3d3"

I have event on button and ripple effect but when I click on button method is get called. What I want is first ripple effect should get complete then action should occur.

XML code

    <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>

user cannot experience animation.

Upvotes: 0

Views: 1942

Answers (2)

Zahidul Islam
Zahidul Islam

Reputation: 3190

You need to add xmlns:app="http://schemas.android.com/apk/res-auto" as an xmlns in your RippleView before using the app resource.

Upvotes: 1

Evgeniy Mandro
Evgeniy Mandro

Reputation: 1

Problem in the example on the page of description in GitHab. Change

rv_centered="true"

to

app:rv_centered="true"

and all will be done. All attribute of ReppleView must contain app:

Upvotes: 0

Related Questions