Solution 1 :
Control several page with Viewpager !
Please add this .xml
<androidx.viewpager.widget.ViewPager
android_id="@+id/dash_pager"
android_layout_width="247.5dp"
android_layout_height="175dp"
android_layout_centerInParent="true" />
setAdapter in Activity or fragment:
final ViewPager viewPager = root.findViewById(R.id.dash_pager);
final DashPagerAdapter adapter = new DashPagerAdapter(getChildFragmentManager());
viewPager.setAdapter(adapter);
Adapter
public class DashPagerAdapter extends FragmentStatePagerAdapter {
/**
* Return the Fragment associated with a specified position.
*
* @param position
*/
int mNoOfTabs;
public DashPagerAdapter(FragmentManager fm){
super(fm);
}
@NonNull
@Override
public Fragment getItem(int position) {
switch (position){
case 0:
Landing_one tab1 =new Landing_one();
return tab1;
case 1:
Landing_two tab2 = new Landing_two();
return tab2;
default:
return null;
}
}
/**
* Return the number of views available.
*/
@Override
public int getCount() {
return 2;
}
}
Make 2 fragment Landing_one and Landing_two.
Problem :
I am confused about this design.
I am working on an Android application and the main tech is swipe 2-row menu.
Left-to-Right ||| before page
Right-to-Left ||| next page
This activity is reflected to indicate dots.
I tried with VerticalScrollview and Recyclerview. But it doesn’t work for me.
If you have any ideas, please share.