Questions tagged [android-fragmentfactory]

3 questions
5
votes
2 answers

How can I use FragmentFactory with FragmentStatePagerAdapter

I like the approach of FragmentFactory, which makes it possible to pass dependencies to a fragment in a constructor. I'd like to use a custom FragmentFactory together with a FragmentStatePagerAdapter. I'm hosting the view pager in an activity. I can…
4
votes
1 answer

How to use FragmentFactory with arguments at runtime?

Let's say i have a fragment with constructor that gets an argument at runtime depending on a network request for instance class MyFragment(private val myArg: Int) : Fragment() { // Do layout and other stuff } I did a sample FragmentFactory to…
Thracian
  • 43,021
  • 16
  • 133
  • 222
2
votes
0 answers

Testing Android Fragment built with FragmentFactory and Koin

Introduction I have a very simple application to practice fragment factory with navigation component and Koin. There are two fragments. The navigation host fragment is a fragment with a very much standard, conventional constructor without any…
Kape
  • 195
  • 1
  • 8