nmdanny
07/13/2017, 5:14 PMinterface Navigable<out F: Fragment> {
fun ActionBarTitleRes(): Int
fun NavBarMenuItemId(): Int? = null
fun newInstance(): F
}
and the class
class MissionsFragment : Fragment() {
// code here...
companion object : Navigable<MissionsFragment> {
override fun ActionBarTitleRes(): Int = R.string.missions_title
override fun NavBarMenuItemId(): Int? = R.id.nav_missions
override fun newInstance(): MissionsFragment {
return MissionsFragment()
}
}
then, inside a function
fun someCheck(someFrag : Fragment) {
}
I would like to check if 'someFrag' has a companion object that implements Navigable<*>