Uses of View Pager AIX extension
ViewPager
is widely used in Android apps for various UI implementations where users need to swipe between pages or sections. Below are some common use cases:
1. Onboarding Screens / Intro Slides
- Used to show a series of introductory screens when a user opens an app for the first time.
- Helps explain the app’s features with swipeable slides.
- Often combined with
DotsIndicator
orTabLayout
for better navigation.
Code:
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/onboardingViewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Types of ViewPager included in in Android AIX extension
There are two main implementations:
-
ViewPager (Legacy – Deprecated)
ViewPager
(fromandroidx.viewpager.widget.ViewPager
) was used in older projects withFragmentPagerAdapter
orFragmentStatePagerAdapter
.- This is now deprecated in favor of
ViewPager2
.
-
ViewPager2 (Recommended)
ViewPager2
(fromandroidx.viewpager2.widget.ViewPager2
) is the modern version with improved functionality.- It supports vertical scrolling, better fragment handling, and works well with
RecyclerView.Adapter
.
Reviews
There are no reviews yet.