long1eu / long1eu/SpaceTabLayout

spaceTabLayout initialize issue in kotlin and how use spaceTabLayout in kotlin

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
265
PR merge metrics
No merged PRs in 30d

Description

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}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the binding.viewPager setup and the binding.spaceTabLayout.initialize(...) call, then inspect how HomeTabAdapter and HomeFragment are configured. Reproduce the reported No view found error and confirm the initialization works without that exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.