Tushar
08/12/2024, 9:40 PMAndroidView(
factory = {context->
FragmentContainerView(context).apply {
id = View.generateViewId()
val fragmentManager = (context as FragmentActivity).supportFragmentManager
fragmentManager.fragmentFactory = fragmenFactory
val fragment = fragmentManager.fragmentFactory.instantiate(
context.classLoader,
EpubNavigatorFragment::class.java.name
)
fragmentManager.beginTransaction()
.replace(id,fragment)
.commit()
}
}
)
public final fun createFragmentFactory(
initialLocator: Locator?,
readingOrder: List<Link>? = null,
initialPreferences: EpubPreferences = EpubPreferences(),
listener: EpubNavigatorFragment. Listener? = null,
paginationListener: EpubNavigatorFragment. PaginationListener? = null,
configuration: EpubNavigatorFragment. Configuration = EpubNavigatorFragment.Configuration()
): FragmentFactory
it did work but again i want to understand how this integration work with lifecycle and all of that and how can i use update lambda
so in short i want to understand the integration between composable and fragment and how can i use them in my app where i want to implement a fragment class which uses factory method moreover for the listeners should i inherit them to CustomViewModel class and pass it's instance
ps: i know basics of creating ui with xml and i am completely beginner so please overlook if i am being sillyColton Idle
08/13/2024, 2:36 AMColton Idle
08/13/2024, 2:38 AMColton Idle
08/13/2024, 2:39 AMTushar
08/13/2024, 5:23 AM