In previous article, we focused on Shadow image with Material Shadow library and today we come with cool animation with View using FloatingView animation library in Android. It can make the target view floating above the anchor view with cool animation.
You can see demo(FloatingView Animation) below:
Let’s move on to implementation of FloatingView Animation:
First of all we need to add dependencies in build.gradle.
Create floating element
Use FloatingBuilder to create a FloatingElement
FloatingElement builder = new FloatingBuilder()
The use of FloatingBuilder can be configured to have：
- anchorView ：Anchor, is you want to float animation in which View above
- target：Target, The view which you want to float
- offsetX：X direction of offset, unit PX
- offsetY: Y direction of offset, unit PX
- floatingTransition : Floating effect, the default is ScaleFloatingTransition