Lawrence
08/18/2022, 6:38 PM// React
<Stepper activeStep={1}>
{steps.map((label) => (
<Step key={label}>
<StepLabel>{label}</StepLabel>
</Step>
))}
</Stepper>
// Compose
Stepper(Modifier.fillMaxSize(), step) {
steps.forEach { Step(Modifier.padding(15.dp, it) }
}
Implementation in threadTolriq
08/18/2022, 8:13 PMLandry Norris
08/18/2022, 9:00 PMLilly
08/18/2022, 9:22 PMSterling Albury
08/19/2022, 1:57 AMzt
08/19/2022, 3:55 AMStylianos Gakis
08/19/2022, 8:13 AMmovableContentOf()
, got an issue where the state does not persist when (I think) I’m using the content normally on one end, and inside a SubComposeLayout on the other call site. More details in Thread 🧵Michael Flathe
08/19/2022, 11:27 AMLazyVerticalGrid
is really bad. Our Composables are pretty simple. We assign a key to every item and have only one contentType
yet it's still lagging noticeably. For the scrolling we are using LazyGridState#animateScrollToItem
(no real difference when using LazyGridState#animateScrollBy
or a release build with R8 enabled).
Any idea how the scroll performance can be improved or is this just like it is with compose these days? Following a video showing a "full page" scroll. (1.2.1 of compose-ui is used)dazza5000
08/19/2022, 3:39 PMViewCompat.setAccessibilityDelegate(login_text_view_as_button_with_role,
object : AccessibilityDelegateCompat() {
override fun onInitializeAccessibilityNodeInfo(v: View, info: AccessibilityNodeInfoCompat) {
super.onInitializeAccessibilityNodeInfo(v, info)
info.roleDescription = "Button"
}
})
AmrJyniat
08/19/2022, 4:28 PMColton Idle
08/19/2022, 5:03 PMLandry Norris
08/19/2022, 6:02 PMExposedDropDownMenu
, AndroidMenu
, ExposedDropDownMenuPopup
, and Menu
and explicitly handle the case where the popup background should have alpha. Is this a bug in Compose, where I should contribute the ‘fix’, or is this expected behavior? For reference, if you set Modifier.background to a color with alpha on ExposedDropDownMenu, you can see there is always an opaque white background applied behind.Alex Styl
08/20/2022, 6:24 PMModifier
I created. the swiping animation works great if I use a mouse, either on the emulator or on my device using scrcpy. If I use my finger, then the animation ‘stops’. I tried wrapping the Animatable.animateTo()
with a try catch and what happens is that the coroutine gets interupted. if i wrap it with a try catch, then the card disappears (i am guessing the animation jumps to the end?).
my assumption here is that my finger triggers a dragging animation (see code in thread) and it interrupts the swipe animation. I tried logging it but the logs show that everything happens in the expended order (drag -> swipe), so it doesn’t make sense for a drag to cancel the swipe.
Any pointers would be appreciated. Code links in the 🧵dan.the.man
08/20/2022, 9:19 PM@Composable
fun showList(actions:MutableSharedFlow<Action>){
val scope = rememberCoroutineScope()
Box(contentAlignment = Alignment.Center) {
Column(Modifier.clickable {
scope.launch { actions.emit(NewEvent())}
This works, but if I navigate back to the page, and repeat the action, the event fires 2x, and then 3x if I navigate back etc. What am I missing here? Changing it to a method that's passed in instead of creating a lambda results in what I'd expect
@Composable
fun showList(actions:(Action) -> Unit){
val scope = rememberCoroutineScope()
Box(contentAlignment = Alignment.Center) {
Column(Modifier.clickable {
actions(NewEvent())
^ that works, I guess it has to do with stable?adjpd
08/21/2022, 3:17 AMOleksandr Balan
08/21/2022, 9:03 AModay
08/21/2022, 12:48 PModay
08/21/2022, 1:58 PMMarko Novakovic
08/21/2022, 3:39 PMPager
to represent calendar view. Every month is separate page. Problem I have is with selecting date. Am exposing selected date from state object. When I select new date every page of Pager
recomposes, HorizontalPager
content
lambda is called again for every page, and that creates really bad UI junk. How can I avoid that?Jasmin Fajkic
08/21/2022, 4:52 PMCompositionLocalProvider
that provides navcontroller so that i do not need to pass navcontroller from parent down to child composable?adjpd
08/21/2022, 10:48 PMTextField
at the bottom of the screen in a LazyColumn
the keyboard popups up momentarily, and then quickly disappears: you can't then enter input. Is this a known issue? Code in 🧵.Zoltan Demant
08/22/2022, 3:53 AMModifier.blur
seems like the way to go, but Im also trying to support this effect all the way down to API 21. Has anyone had any success with alternative approaches?nuhkoca
08/22/2022, 8:06 AMstartDestination
dynamically based on a flag. However, btAppGraph
doesn’t recompose it after the initial value. How do I do it?
val isManager by viewModel.isManager.collectAsStateWithLifecycle()
private fun NavGraphBuilder.btAppGraph(
appState: BTAppState,
isManager: Boolean
) {
...
navigation(
route = Screen.Home.route,
startDestination = if (isManager) HomeSections.TaskApproval.route else HomeSections.Tasks.route
) {
addHomeGraph(appState)
}
}
Lukáš Kúšik
08/22/2022, 6:59 AMefemoney
08/22/2022, 8:23 AMColumn
? Like my entire column content was divided into sections and I want to draw a bg behind some of those childrenCan Korkmaz
08/22/2022, 9:59 AMjasu
08/22/2022, 10:09 AMabbic
08/22/2022, 12:25 PMviewmodel.events.observe { when (event) etc etc }
now my instinct is to have the events be a val on the uiState like
UiState(val event)
and then in the composition
SomeScreen(uiState) {
LaunchedEffect(uiState.event) {
when (event) etc etc
}
}
but this causes a problem where in livedata you could post the same event in a row multiple times and the observer would trigger each time.
i have to assume that if you copy the uiState and set the same event now the LaunchedEffect wont trigger. I can clear the event manually in the state each time, but the slight overhead makes me wonder if there's a better way to do it?Erfannj En
08/22/2022, 1:05 PMK Merle
08/22/2022, 1:40 PMText
composable, if word does not fit in the line, it goes to the next line. Is it possible to still leave the word in the same line and have that hard break of the word? Example:
Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lore
m Ipsum has been the industry's standar
d dummy text ever since the 1500s.