Floating customisation
This template allows you to put an overlay that will be present on main page.
Here you have a specific configuration that lets you choose where to put this overlay.
by default it's set to Alignment.BottomEnd.
You can configure it this way :
import androidx.compose.ui.Alignment
catalog {
success {
loating {
view = // regular template here ,
footerAlignment = Alignment <-
}
}
}
Then to create your regular template :
- myCustomCatalogFloating.kt
- example
class MyCustomCatalogFloating: CatalogFloating {
@Composable
override fun Content(params: CatalogFloatingParameters) {
// Your custom design here
}
}
class MyCustomCatalogFloatingImp : CatalogFloating {
private val myMealButtonVM: MyMealButtonViewModel = MyMealButtonViewModel()
@Composable
override fun Content(params: CatalogFloatingParameters) {
MyMealButton.View(myMealButtonVM = myMealButtonVM) {
params.onClickAction()
}
}
}
info
In our Sample we are showing the number or meals currently in the basket at the bottom of screen
Params
data class CatalogFloatingParameters(
val onClickAction: () -> Unit // to call on click on default implementation redirect to my mealz
)