Android ImageSwitcher
ImageSwitcher:
ImageSwitcher is a ViewSwitcher that is more specialized than others because it is used to change only two images at a time.
It functions in the same way as TextSwitcher wherein you can easily change one image to another by applying animations.
It is often seen as a basic feature to making simple image slideshows or jumping between images in a UI interface.
Example:
<?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=".ImageSwitcherExample"
android:padding="16dp"
android:orientation="vertical">
<ImageSwitcher
android:id="@+id/imageswitcher1"
android:layout_width="match_parent"
android:layout_height="250dp"
/>
<Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:textColor="@color/colorWhite"
android:background="@color/colorPrimaryDark"
android:layout_marginTop="100dp"
android:layout_gravity="center"
/>
</LinearLayout>
Output