Create Tablayout without Viewpager in Android. Tabs in Android with Fragments
Crate Tablayout with Viewpager and fragments : https://code8808.blogspot.com/2020/07/create-tablayout-in-android-tabs-in.html In this we dont use a Viewpager , due to which we do not get the SLIDING EFFECT. We use a lsitener on the Tablayout and get the Position of the selected tab using the getPosition() method on tab data passed to the onTabSelected() method. Then we use fragmentsupportmanager to replace the fragments in the FRAMELAYOUT container. Activity_main.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" android :orientation ="vertical" xmlns: app ="http://schemas.android.com/apk/res-auto" tools :context =".MainActivity" > <com.google.android.materia...