1

How to change background color of button when click on it like ripple but after filling ripple effect a color of button also change.

My .xml file

<com.andexert.library.RippleView
        android:id="@+id/more"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        app:rv_alpha="250"
        app:rv_centered="true"
        app:rv_color="#008600"
        app:rv_framerate="20"
        app:rv_rippleDuration="600"
        app:rv_type="rectangle">

        <Button
            android:id="@+id/btn"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="Click He"
            android:textColor="#FFFFFF" />
</com.andexert.library.RippleView>

My java file

rippleView.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {

            @Override
            public void onComplete(RippleView rippleView) {
                btn.setBackgroundColor(getResources().getColor(R.color.colorBackground));
            }
        });

Here, i change background color in onComplete but it can be possible to change background color with ripple effect???

Vishal Patoliya ツ
  • 3,170
  • 4
  • 24
  • 45

0 Answers0