Android AdapterViewFlipper
AdapterViewFlipper:
AdapterViewFlipper is a subclass of AdapterViewAnimator and it targets flipping of child views from a particular adapter.
It is often applied to design a single flipper or carousel-like interface in which different views are switched from each other with an animation.
Example:
activity_adapter_view_flipper_example.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AdapterViewFlipperExample"
android:orientation="vertical"
android:gravity="center"
>
<AdapterViewFlipper
android:id="@+id/simpleAdapterViewFlipper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</AdapterViewFlipper>
</LinearLayout>
flipper_items.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#fff"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/imageNames"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="#000" />
</LinearLayout>
Output