View Pager Configuration

class ViewPagerConfiguration(    var activity: FragmentActivity? = null,     var fragment: Fragment? = null,     var listFragment: List<Fragment> = listOf(),     var tabLayout: TabLayout? = null,     var tabLayoutConfiguration: TabLayoutConfiguration? = null)

class for containing androidx.viewpager2.widget.ViewPager2 configuration

Author

Jimly A.

Since

04-Oct-21

Parameters

activity

Activity where the androidx.viewpager2.widget.ViewPager2 is inflated

fragment

Fragment where the androidx.viewpager2.widget.ViewPager2 is inflated

listFragment

list of fragments to include inside the androidx.viewpager2.widget.ViewPager2

tabLayout

TabLayout to linked with the androidx.viewpager2.widget.ViewPager2

tabLayoutConfiguration

configuration for the TabLayout

Constructors

Link copied to clipboard
fun ViewPagerConfiguration(    activity: FragmentActivity? = null,     fragment: Fragment? = null,     listFragment: List<Fragment> = listOf(),     tabLayout: TabLayout? = null,     tabLayoutConfiguration: TabLayoutConfiguration? = null)

Functions

Link copied to clipboard
fun bindWithTabLayout(tabLayout: TabLayout, configuration: TabLayoutDeclaration? = null): ViewPagerConfiguration

method to bind tabLayout with the ViewPager

Link copied to clipboard
fun withActivity(activity: FragmentActivity): ViewPagerConfiguration

method to define Activity that inflated the ViewPager

Link copied to clipboard
fun withFragment(fragment: Fragment): ViewPagerConfiguration

method to define Fragment that inflated the ViewPager

Link copied to clipboard
fun withListFragment(listFragment: List<Fragment>): ViewPagerConfiguration

method to define the list of fragments to include inside the ViewPager

Properties

Link copied to clipboard
var activity: FragmentActivity? = null
Link copied to clipboard
var fragment: Fragment? = null
Link copied to clipboard
var listFragment: List<Fragment>
Link copied to clipboard
var tabLayout: TabLayout? = null
Link copied to clipboard
var tabLayoutConfiguration: TabLayoutConfiguration? = null

Sources

Link copied to clipboard