All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidMain.tech.skot.core.components.SKPagerWithTabsView.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.core.components

import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator

class SKPagerWithTabsView(
    override val proxy: SKPagerWithTabsViewProxy,
    activity: SKActivity,
    fragment: Fragment?,
    view: View,
    private val viewPager2: ViewPager2,
    private val tabLayout: TabLayout
) : SKComponentView(proxy, activity, fragment, view) {

    fun onLabels(labels: List) {
        TabLayoutMediator(
            tabLayout, viewPager2
        ) { tab, index ->
            tab.text = labels.get(index)
        }.attach()
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy