-
Notifications
You must be signed in to change notification settings - Fork 377
Ripples
ZieIony edited this page May 7, 2015
·
1 revision
The touch ripple is a new, nice way of showing that a view was clicked. Basically it's an animated RippleDrawable object set as a background. What's important to know about ripples:
- RippleDrawable is using the new render thread, which makes the animation smooth. It also means that it's impossible to backport ripples without any changes.
- RippleDrawable uses
setHospot
- a new method for setting animation hotspot. - RippleDrawable is usually clipped to a shape of a view, but can also work in a borderless mode.
RippleDrawable sources can be found in Android repository:
To implement ripples you have to:
- Copy RippleDrawable to your code.
- Remove the parts using the new rendering thread.
- Call
setHotspot
in your view.
Copyright 2015 Marcin Korniluk 'Zielony'