Thursday, 17 September 2015

Ripple Effect in android for prelollipop devices

Hey, aren't you amused with the new ripple effect released with android 5.0. If you want the same effect in pre-lollipop device, then you could try this Library. With the few line of code you could get the same ripple effect as in android 5.0. More than that you could perform more operation on that. Check out the below code snippet

yourview.setOnClickListener(new View.OnClickListener() {
@Overridepublic void onClick(View view) {
        RippleView rippleView = new RippleView(MainActivity.this);

//finally call it to make ripples        rippleView.initRipple(view, viewParent);
        }
        });


Operations you could perform:-
  1. Change the ripple color.
  2. Change the ripple frequency.
  3. Change the ripple size

2 comments: