Sergey Y.
09/02/2020, 9:57 PMPressed
, enabled
, disabled
, focused
, hovered
, etc.blakelee
09/03/2020, 5:29 AMimmathan
09/03/2020, 6:07 AMCard
, the backgroundColor
property is getting changed based on the condition, but not the border
.
fun CardDisplay() {
val selected = remember { mutableStateOf(true) }
Surface(modifier = Modifier.fillMaxSize().gravity(Alignment.CenterVertically)) {
Card(
modifier = Modifier
.size(32.dp).clickable(onClick = {
selected.value = !selected.value
}),
backgroundColor = if (selected.value) Color.Red else Color.Black,
border = if (selected.value) BorderStroke(2.dp, Color.Green) else null,
) {
}
}
}
If you notice the cardbug.mp4
video, the border
property is not reflected since the green color border is not going off.
But I tried changing the border
width to 0.dp
and it’s working as expected. Is this the expected behaviour?
border = if (selected.value) BorderStroke(2.dp, Color.Green) else BorderStroke(0.dp, Color.Green),
allan.conda
09/03/2020, 6:39 AMTextField
is stateless, but TextFieldImpl
as a bunch of mutable states internally. How do we know if a Composable is stateless or not?kclerc
09/03/2020, 7:13 AMSergey Y.
09/03/2020, 10:45 AMDaniele B
09/03/2020, 11:58 AMLazyColumnFor
showing a list of items on the master screen. When click on an item to access the detail screen, and then I come back to the master screen, the position of the list is not kept. It is always reset to the top.
Is there a way to keep the position of the LazyColumnFor
?Jeff Jackson
09/03/2020, 3:52 PMJohn O'Reilly
09/03/2020, 4:27 PMJan Skrasek
09/03/2020, 5:29 PMby remember { }
property delegate was removed? or any idea why it is not working?
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
• AS 4.2.0-alpha09
• Compose 1.0.0-alpha02
Maybe the issue is AS cannot find the declaration of remember (though suggesting it in autocomplete)
(import androidx.compose.runtime.rememberimport androidx.compose.runtime.remember)manueldidonna
09/03/2020, 9:57 PMStable/Immutable
? I know that the public properties of that classes won't changeYamila Gammeri
09/04/2020, 3:29 AMstate { xx }
Ketan
09/04/2020, 6:33 AMTextField
- How can I style the underline colour, error text colour? Is there any attribute that I can set and it styles the TextField
the way I want?
Card(color = MaterialTheme.colors.onBackground,
elevation = 16.dp,
modifier = Modifier.fillMaxWidth()
.height(160.dp)
) {
Column(modifier = Modifier.fillMaxWidth()
.padding(horizontal = 32.dp),
verticalArrangement = Arrangement.Center,
horizontalGravity = Alignment.CenterHorizontally
) {
TextField(value = TextFieldValue("User"),
modifier = Modifier.preferredHeight(48.dp),
cursorColor = MaterialTheme.colors.background,
textColor = MaterialTheme.colors.background,
onValueChange = {})
Spacer(modifier = Modifier.height(16.dp))
TextField(value = TextFieldValue("Password"),
modifier = Modifier.preferredHeight(48.dp),
cursorColor = MaterialTheme.colors.background,
textColor = MaterialTheme.colors.background,
visualTransformation = PasswordVisualTransformation(),
onValueChange = {})
}
}
Spacer(modifier = Modifier.height(16.dp))
Row(modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.End,
verticalGravity = Alignment.CenterVertically
) {
OutlinedButton(onClick = {},
elevation = 16.dp,
border = Border(2.dp, color = MaterialTheme.colors.onBackground)
) {
Text(text = "Reset", color = MaterialTheme.colors.onBackground)
}
Spacer(modifier = Modifier.width(16.dp))
Button(onClick = {},
elevation = 16.dp,
backgroundColor = MaterialTheme.colors.onBackground,
) {
Text(text = "Login")
}
}
The above code producesKetan
09/04/2020, 6:36 AMTextField
compare to EditText
Material. Some basic things should be provided to style the look and feel.Matej Drobnič
09/04/2020, 12:48 PMRecylerView
does when you add/remove/update/move items around. Is this even possible at this moment?Neil
09/04/2020, 1:32 PMtextStyle = MaterialTheme.typography.body2
for these components the problem went away. Is this expected behaviour?Dominaezzz
09/04/2020, 1:34 PMJCollardBovy
09/04/2020, 3:04 PMSheroz Nazhmudinov
09/04/2020, 6:25 PMimplementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.ui:ui-tooling:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
And here’s the basic attempt on using ConstraintLayout:
@Composable
@Preview
fun PreviewGreeting() {
ConstraintLayout(constraintSet = ConstraintSet {
tag("someTag")
}) {
Greeting(greeting = "Hello world")
}
}
I get the error thou saying unresolved reference tag. can smbd please tell me which dependency am I missing?Zach Klippenstein (he/him) [MOD]
09/04/2020, 6:57 PMArtem Kopan
09/04/2020, 8:09 PMJohn O'Reilly
09/04/2020, 9:17 PMCrane
sample as a template I'm making another pass at including a Google Map in Compose UI....I think this came up before but if I set uiSettings.isZoomControlsEnabled
the zoom controls show on map but touching them doesn't do anything. The Crane sample sets up custom zoom controls outside map for what I'm guessing is the same reason
``````jaqxues
09/04/2020, 9:27 PMSergey Y.
09/04/2020, 10:42 PMDaniele B
09/05/2020, 12:36 PMJulius Marozas
09/05/2020, 1:26 PM@PreviewParameter
? Is this going to change in the future?Orhan Tozan
09/05/2020, 5:38 PMJulius Marozas
09/05/2020, 6:08 PMText
, is there a way to specify the minimum text width in terms of em
?
I have a composable that displays a number and an icon. I want the icon to not move when the amount of digits in the number changes. The maximum amount of digits is 3, so I would like to somehow specify the width of Text
to be 3 em
.vipulasri
09/06/2020, 7:54 AMArtem Kopan
09/06/2020, 9:51 AMArtem Kopan
09/06/2020, 9:51 AMTimo Drick
09/06/2020, 10:20 AMArtem Kopan
09/06/2020, 11:25 AMTimo Drick
09/06/2020, 11:27 AM