Florian
08/23/2021, 3:02 PMrsktash
08/23/2021, 3:04 PMursus
08/23/2021, 3:07 PMrsktash
08/23/2021, 3:09 PMrsktash
08/23/2021, 3:10 PMDominaezzz
08/23/2021, 3:16 PMMarko Novakovic
08/23/2021, 3:23 PMMarko Novakovic
08/23/2021, 3:24 PMNick
08/23/2021, 3:54 PMNick
08/23/2021, 3:54 PMRicardo García
08/23/2021, 4:14 PMinterface AlertDialogActions
, interface ToolbarActions
). I’d make this root composable would only receive a single interface. Let’s say a parent interface that would derive from all the others (interface ParentActions: AlertDialogActions, ToolbarActions
), so it looks cleaner and with less paramsFlorian
08/23/2021, 11:06 PMFlorian
08/23/2021, 11:06 PMFlorian
08/23/2021, 11:07 PMFlorian
08/23/2021, 11:08 PMFlorian
08/23/2021, 11:10 PMNick
08/23/2021, 11:18 PMursus
08/23/2021, 11:24 PMFlorian
08/24/2021, 12:05 AMFlorian
08/24/2021, 12:08 AMFlorian
08/24/2021, 12:37 AMShakil Karim
08/24/2021, 11:25 AMShakil Karim
08/24/2021, 11:28 AMFlorian
08/24/2021, 11:48 AMFlorian
08/24/2021, 11:49 AMFlorian
08/24/2021, 11:49 AMShakil Karim
08/24/2021, 11:52 AM@ExperimentalCoilApi
@ExperimentalMaterialApi
@Composable
fun Discover(
viewModel: DiscoverViewModel,
goToProfile: () -> Unit
) {
val viewState by rememberFlowWithLifecycle(viewModel.state)
.collectAsState(initial = DiscoverViewState.Empty)
Discover(viewState, goToProfile, selectPack = { pack ->
if (pack.badge == BADGE.GET) {
viewModel.submitAction(DiscoverAction.AddOrUpdatePackToDatabase(pack))
}
}, onLectionSelected = {
}, selectCategory = {
}) { action ->
viewModel.submitAction(action)
}
}
@ExperimentalCoilApi
@ExperimentalMaterialApi
@Composable
internal fun Discover(
state: DiscoverViewState,
goToProfile: () -> Unit,
selectPack: (Pack) -> Unit,
onLectionSelected: (Lection) -> Unit,
selectCategory: (String) -> Unit,
actioner: (DiscoverAction) -> Unit,
) {}
Shakil Karim
08/24/2021, 11:54 AMactioner: (DiscoverAction) -> Unit,
Florian
08/24/2021, 3:13 PMFlorian
08/24/2021, 9:02 PMFlorian
08/24/2021, 9:03 PMNick
08/24/2021, 9:51 PMFlorian
08/24/2021, 9:53 PMFlorian
08/24/2021, 9:54 PMFlorian
08/24/2021, 9:57 PMFlorian
08/24/2021, 9:57 PMShakil Karim
08/24/2021, 10:17 PMFlorian
08/24/2021, 10:52 PMFlorian
08/24/2021, 10:53 PMFlorian
08/24/2021, 10:53 PMFlorian
08/24/2021, 10:53 PMRicardo García
08/25/2021, 2:38 PMFlorian
08/25/2021, 7:11 PMRafiul Islam
08/27/2021, 11:31 AM@Composable
fun AddUser(
fullName: String,
userName: String,
phoneNumber: String,
email: String,
password: String,
pin: String,
myPin: String,
onFullNameChange: (String) -> Unit,
onUserNameChane: (String) -> Unit,
onPhoneNumberChange: (String) -> Unit,
onEmailChange: (String) -> Unit,
onPasswordChange: (String) -> Unit,
onPinChange: (String) -> Unit,
onMyPinChange: (String) -> Unit,
)
Florian
08/27/2021, 7:03 PMFlorian
08/27/2021, 7:03 PMRafiul Islam
08/27/2021, 7:22 PMFlorian
08/28/2021, 7:34 PMcombine
operatorLilly
09/01/2021, 10:58 AMcombine
like Florian mentioned
2. you make the fields of UiState mutable, e.g. data class UiState(var isLoaded: Boolean, ..)
. Annotate the data class with @Stable
to benfit from compiler optimizations. This is explained in detail in compose guidelinesRafiul Islam
09/01/2021, 11:07 AMLilly
09/01/2021, 11:09 AMLilly
09/01/2021, 11:10 AMRafiul Islam
09/01/2021, 11:16 AMzhuinden
10/04/2021, 1:58 AMJasmin Fajkic
01/11/2023, 10:34 AM