Noé Casas
03/18/2021, 10:37 AMResult
affecting 1.4.31, which is needed by compose beta:
• https://youtrack.jetbrains.com/issue/KT-44867
• https://youtrack.jetbrains.com/issue/KT-45259
These problems result in a ClassCastException
and the subsequent app crash.
Is there any workaround? How are people using compose dealing with this?Shakil Karim
03/18/2021, 11:08 AMColton Idle
03/18/2021, 11:13 AM.animateContentSize()
modifier
2. Have the expandable content wrapped in AnimatedVisibility {}
composable
At runtime the behavior of AnimatedVisibility
looks slightly better I think? Code examples of each in thread.Mikołaj Kąkol
03/18/2021, 11:46 AMFrancois Morvillier
03/18/2021, 2:14 PMSamir Basnet
03/18/2021, 2:28 PMClickableText(
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(top = 10.dp)
.indication(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(true)
),
text = noAccount,
style = MaterialTheme.typography.subtitle2
) {
Timber.d("$it")
}
How to add ripple in ClickableText?Above code did not work.Am i doing it wrong?Deepak Gahlot
03/18/2021, 3:18 PMNeal Sanche
03/18/2021, 4:13 PMTextButton(
colors = textButtonColors(contentColor = MaterialTheme.colors.secondary),
onClick = {
}
) {
Text("To Step 2")
}
But I'd like to have something like this globally. Is there a way to provide the correct colour in my theme?Nat Strangerweather
03/18/2021, 4:54 PMVinay Gaba
03/18/2021, 6:22 PMbeta-02
. For the folks who are new here, Showkase is Airbnb’s library that auto generates an UI component browser for your Compose UI elements. More details in this thread I previously shared - https://kotlinlang.slack.com/archives/CJLTWPH7S/p1598635176423700Rick Regan
03/18/2021, 7:54 PMCrossfade
(see thread), when I click "Reset", the Button
labelled "Button" fades and goes back to full color. I don't know what that animation is, or why it's animating anything at all.Chris Grigg
03/18/2021, 8:58 PMBox
with scale
set to 0f and content with an onClick
handler. When scale is 0f, the content’s onClick
handler will be applied to the whole window. Reproducible code coming below, replying to myself.Neal Sanche
03/18/2021, 9:37 PMisVisible
is false, animate the alpha of a component infinitely between zero and one. If isVisible
is true, animate the current alpha up to 1.0f. Code in thread.Olivier Patry
03/18/2021, 10:18 PMGridLayer.kt
gist for those who could be interested.
It aims at displaying a (configurable) grid to ease alignment when implementing design mockups (defaults to 8.dp
and red color).
https://gist.github.com/opatry/fde12d9a5c52179338613278d901eacbTim Malseed
03/19/2021, 12:39 AMViewModel
as a state container for a Composable screen. The ViewModel
is scoped to the nav graph via @HiltViewModel
& `hiltNavGraphViewModel()`` . It seems that this pattern does not support assisted injection into the ViewModel
, so I have to pass initial state to the screen's Compose function, and then pass that state into the ViewModel
. This feels a bit uncomfortable. Am I approaching this the wrong way?Kshitij Patil
03/19/2021, 10:12 AMonImeActionPerformed
argument to TextField, I had a chance to implement some global logic for all the actions. Like I had written if the action was Done
, hide the software keyboard and it was possible to do so because of the handy softwareKeyboardController
argument to onImeActionPerformed
. How can I do the same using KeyboardActions now? The callback methods are not “Composables” so I won't even be able to use LocalSoftwareKeyboardController.current
Pedro Ruiz
03/19/2021, 10:54 AMOutlinedTextField(
value ="",
onValueChange = { /*TODO*/ },
colors = TextFieldDefaults.outlinedTextFieldColors(backgroundColor = Color.White)
)
Arun
03/19/2021, 11:41 AMval exampleViewModel = hiltNavGraphViewModel<ExampleViewModel>()
However, I couldn’t find anything or any info on passing a ViewModelProvider.Factory
above (in case there are parameters for the ViewModel constructor).
Am I missing something or is it yet to be developed?Kshitij Patil
03/19/2021, 12:50 PMrememberSaveable
for TextFieldValue
?Chris Grigg
03/19/2021, 3:29 PMAndroidView
and I need to set a layout attribute as described at https://exoplayer.dev/ui-components.html#choosing-a-surface-type. I’m having trouble finding how I should do this. Could someone point me in the right direction? I’m going to add a small code snippet in a reply below.Tlaster
03/19/2021, 3:32 PMZoomable
layout for Jetpack Compose that can easily handle zoom in and out with dragging support, hope it can help: https://github.com/Tlaster/ZoomableJoe Jensen
03/19/2021, 4:26 PMSubcomposeLayout.kt
: "Intrinsic measurements are not currently supported by SubcomposeLayout"
Will intrinsic measurements soon be supported in SubcomposeLayout
? Or is the intention for it to never support intrinsic measurements?alorma
03/19/2021, 4:39 PMDropdownMenu
, how can I test it? at least test that some child is shown, or whole dropdownColton Idle
03/19/2021, 4:59 PMLucien Guimaraes
03/19/2021, 5:23 PMNat Strangerweather
03/19/2021, 8:00 PMTextDelegate
as kindly suggested here to use text on my canvas. But beyond that I am a little lost and would welcome some examples of how to position words precisely, for instance. Googling is not helping much as yet. 😅Jorkoh
03/19/2021, 10:53 PMitnoles
03/20/2021, 1:54 AMSamir Basnet
03/20/2021, 6:58 AMchansek
03/20/2021, 7:24 AMchansek
03/20/2021, 7:24 AMColton Idle
03/20/2021, 6:42 PMnglauber
03/21/2021, 1:03 AMTextField(
label = { Text("Name") },
value = nameState,
onValueChange = { s: String ->
if (s.length < 50) nameState = s
}
)
🤷♂️Colton Idle
03/21/2021, 8:13 PMnglauber
03/21/2021, 9:02 PMval maxLength = 20
Column {
OutlinedTextField(
label = { Text("Name") },
value = nameState,
onValueChange = { s: String ->
if (s.length <= maxLength) {
nameState = s
}
}
)
Text(
"${nameState.length} / $maxLength",
fontSize = 12.sp,
modifier = Modifier.align(Alignment.End)
)
}
You can put this in a Composable function an boom! You have a custom TextField 😊