package com.adealink.weparty.commonui.recycleview.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

abstract class BaseTabFragmentStateAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
    abstract fun getTabName(pos: Int): String

    fun getFragment(fragment: Fragment, position: Int): Fragment? =
        fragment.childFragmentManager.findFragmentByTag("f${getItemId(position)}")

}

abstract class BaseActivityTabFragmentStateAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) {
    abstract fun getTabName(pos: Int): String
}