long1eu / SpaceTabLayout

Not actively maintained, but PR are welcomed
1.6k stars 265 forks source link

spaceTabLayout initialize issue in kotlin and how use spaceTabLayout in kotlin #43

Open NuaTransMediaGitHub opened 5 years ago

NuaTransMediaGitHub commented 5 years ago

val fragmentList = ArrayList() fragmentList.add(HomeFragment.newInstance()) fragmentList.add(HomeFragment.newInstance()) fragmentList.add(HomeFragment.newInstance()) fragmentList.add(HomeFragment.newInstance()) fragmentList.add(HomeFragment.newInstance())

    val adapter = HomeTabAdapter(this, supportFragmentManager, 5)
    binding.viewPager!!.adapter = adapter
    binding.spaceTabLayout.initialize(binding.viewPager,getSupportFragmentManager(),fragmentList,savedInstanceState)

java.lang.IllegalArgumentException: No view found for id 0x7f080102 (com.nuatransmedia.sliver_spoon:id/viewPager) for fragment HomeFragment{51a71a9 #1 id=0x7f080102 android:switcher:2131230978:1}