View Animation is the older system and can only be used with views. It is relatively easy to set up and offers enough capabilities to meet many application's needs.
We can add basic animations to simple view operations, such as hide and show. Let's take a look at the following step:
This is done by adding the
animateLayoutChanges
attribute to the XML layout:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true"> </LinearLayout>
We can also create animations for views by using XML, which can then be used to animate views. Let's take a look at the following steps:
This is similar to creating animators, but it works on all versions of Android and resides in the
anim
resource folder:<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk...