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.
- Include the file in package folder in your project.
- 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" />
- 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