Sunday, December 3, 2017

Ripple

Ripple:

Ripple Effect in android, this effort is look awesome when the user touch the button or layout

First download RippleView.java file from here

After download this file and put into package folder,so we don't need to use library for rippleview in android.




  1. Include the file in package folder in your project.
  2. Include the RippleView widget in your layout.
             <com.android.androidVedha.RippleView
                     android:id="@+id/btn"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     ripple:alphaFactor="0.7"
                    ripple:rippleColor="#58FAAC" />
  1. In your onCreate method refer to the View and add 'OnClickListener' for the same.
               mButton = (RippleView) findViewById(R.id.btn);
               mButton.setOnClickListener(new View.OnClickListener() {
          @Override
         public void onClick(View v) {
         //your code
         }
             });

No comments:

Post a Comment