Kamil K
07/12/2023, 1:46 PMStylianos Gakis
07/12/2023, 2:06 PMKamil K
07/12/2023, 2:32 PMLayout
, MeasurePolicy
, ParentDataModifier
and how to handle internal states with remember
and also something about usage of staticCompositionLocalOf
. Building custom layouts by extending i.e. FrameLayout
was straightforward as you would do it as just implementing a class. Where in compose it all happens in scope of a function.Timo Drick
07/12/2023, 2:38 PMTimo Drick
07/12/2023, 2:39 PMKamil K
07/12/2023, 2:40 PMKamil K
07/12/2023, 2:42 PMTexetEditLayout
having wrong borders, to much padding, hint in wrong place, etc.Kamil K
07/12/2023, 2:42 PMTimo Drick
07/12/2023, 2:43 PMTimo Drick
07/12/2023, 2:43 PMKamil K
07/12/2023, 2:44 PMTimo Drick
07/12/2023, 2:45 PMTimo Drick
07/12/2023, 2:45 PMTimo Drick
07/12/2023, 2:45 PMTimo Drick
07/12/2023, 2:47 PMKamil K
07/12/2023, 2:48 PMTimo Drick
07/12/2023, 2:51 PM@Composable
fun CustomDesignButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
content: @Composable RowScope.() -> Unit
) {
Button(
modifier = modifier,
onClick = onClick,
colors = ButtonDefaults.buttonColors(
containerColor = YourColorSystem
),
content = content
)
}
Keep in mind to make you color system flexible enough to support darkmode or other changes.Arkadii Ivanov
07/12/2023, 2:53 PMKamil K
07/12/2023, 2:55 PMArjan van Wieringen
07/12/2023, 3:24 PMTimo Drick
07/12/2023, 3:25 PMTimo Drick
07/12/2023, 3:26 PMdimsuz
07/12/2023, 5:34 PMMaterialTheme
and made that into AppTheme
.
As for components, I still use many material (2) components (text, text fields, alert dialogs, sheets), because actually they are quite flexible. The main thing to keep track of here is to pass all colors manually, and almost all current components have them exposed as arguments (thankfully). And then you simply build your own uikit and don't specify those colors each time.dimsuz
07/12/2023, 5:37 PMfun AppTheme(content: @Composable () -> Unit) {
MaterialTheme(colors = AllMagentaColors) {
CompositionLocalProvider(
LocalAppThemeColors provides myColors
) {
content()
}
}
}
which will aid you in transition, because each time you don't specify the color and some material component will default to something from MaterialTheme, it will turn out as magenta which you won't miss 🙂
Then you can remove that "debug" wrapper.Joel Denke
07/12/2023, 6:40 PMJoel Denke
07/12/2023, 6:41 PMJoel Denke
07/12/2023, 6:45 PMChris Sinco [G]
07/12/2023, 10:27 PMChris Sinco [G]
07/12/2023, 10:31 PMdesigners do not care about Google’s theme@Kamil K curious on this statement relative to the designs you are trying to implement. I assume there’s an iOS app version for your app - do the designers not follow Apple’s HIG or use any native controls out-of-the-box there? Compose Material is meant to be the foundational UI components library to build an app that looks and feels native on Android, despite the perception that it’s meant only for Google apps.
Kamil K
07/13/2023, 5:57 AMStylianos Gakis
07/13/2023, 8:34 AMJoel Denke
07/13/2023, 5:29 PM