Skip to main content
Version: 5.3

MySpaceSwapper

Swapper

To create your own My Space swapper template you create a class that implements Swapper

import ai.mealz.sdk.components.baseComponent.swapper.Swapper
import ai.mealz.sdk.components.baseComponent.swapper.SwapperParameters


class MyCustomSwapper: Swapper {

@Composable
override fun Content(params: SwapperParameters) {
// Your custom design here

}
}

Swapper params

data class SwapperParameters(
val options: Map<String, SwapperOption>,
val state: SwapperImp.MultiSelectorState,
val selectedOption: String,
val onOptionSelect: (String) -> Unit
)

data class SwapperOption(val title: String, val icon: Int? = null)

Swapper resources

tip

you can replace and reuse string resources if you want to take advantage of our internationalisation system

ex : Localisation.mySpace.historyTab.localised

Name Ressource IDValue FrValue Eng
favoritesai_mealz_my_space_favorites_tabFavorisFavorites
historyai_mealz_my_space_history_tabHistoriqueHistory