Answer the question
In order to leave comments, you need to log in
How to merge fragments of the same type in cicerone?
Good afternoon!
1) I have a group of identical fragments that differ only in the displayed image and caption and are called in different places of the application like this:
Screens.ProfileOne
Screens.ProfileTwo
object Screens {
object ProfileOne : SupportAppScreen() {
override fun getFragment() = ProfileFragment(0)
}
object ProfileTwo : SupportAppScreen() {
override fun getFragment() = ProfileFragment(1)
}
}
enum class Items (@StringRes val title: Int, @DrawableRes val icon: Int) {
One(R.string.one_profile, R.drawable.ic_profile_0),
Two(R.string.two_profile, R.drawable.ic_profile_1),
object Screens {
data class Profilу (val index: Int) : SupportAppScreen() {
override fun getFragment() = ProfileFragment(index)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question