nglauber
05/19/2021, 7:13 PMA
which instantiate my ViewModel using viewModel()
function. I want to get the same instance of my ViewModel in screen B
after call navController.navigate("B")
…Barry Fawthrop
05/19/2021, 7:38 PMRyan Simon
05/19/2021, 7:49 PMwhat's new in design tools▾
aipok
05/19/2021, 8:05 PM@Preview
on device in case preview functions are declared inside library module? Right now I don’t have the run on device
button near the preview functions unless they are located inside app module.
Moving @Preview
functions to app module shows the run on device
icon.alorma
05/19/2021, 8:57 PMLazyXxxx
that scrolls with the content?
ON this example the circles must scroll to the start (left) of the screen, but start with some extra paddingLuis Mierez
05/19/2021, 10:47 PMThiago
05/20/2021, 1:17 AMnglauber
05/20/2021, 3:05 AMTextField
… which one would be better: 1) expose a series of LiveData/StateFlow; or 2) encapsulate in a object and every change send a copy of the object just changing one property? (I mean myObj.copy(fieldThatChanged=newValue)
)
https://developer.android.com/jetpack/compose/state#viewmodel-statedewildte
05/20/2021, 3:31 AMLukas K-G
05/20/2021, 4:24 AMJason Ankers
05/20/2021, 6:13 AMLazyColumn
scroll position will not be saved if both of these conditions are met:
• A screen with a LazyColumn
instantiates a ViewModel with hiltViewModel()
• An item in the LazyColumn
references an unstable object (i.e. a navController)
Is this expected?iamthevoid
05/20/2021, 6:43 AMIoane Sharvadze
05/20/2021, 7:26 AMMikołaj Kąkol
05/20/2021, 8:43 AMKunal Raghav
05/20/2021, 8:47 AMiamthevoid
05/20/2021, 11:01 AMKulwinder Singh
05/20/2021, 11:04 AMthan_
05/20/2021, 11:24 AMLucien Guimaraes
05/20/2021, 11:29 AMrestoreState = true
and saveState = true
doesn't seems to resolve the recomposition of screens using BottomNavigation. Here is a video showing screens UI to be reset when switching tabs. Am I missing something to avoid this behaviour ?Denis Capkovic
05/20/2021, 11:58 AMwm overscan
, to hide navigation controls all-together (you cannot swipe down to bring up notification shade). But this also moves the keyboard, and hides part of it. Our application is always in landscape and is the only one running. Hacky solutions are welcome.Shawn Tucker
05/20/2021, 12:57 PMjava.lang.NoSuchMethodError: No interface method startRestartGroup
in class Landroidx/compose/runtime/Composer
crash when I try to draw a chart.
How can I fix this issue?pawegio
05/20/2021, 12:59 PMnavigation-compose
1.0.0-x
I was able to pass Parcelable
argument this way:
currentBackStackEntry?.arguments?.putParcelable(...)
after updating to 2.4.0-alpha01
it seems to no longer work as I see that previousBackStackEntry?.arguments?.getParcelable
returns a null
value in new destination. What’s the right/new way to perform it now?julioromano
05/20/2021, 1:29 PMnitrog42
05/20/2021, 1:31 PMjava.lang.IllegalStateException: Expected applyChanges() to have been called
does anyone have an idea? the stacktrace doesn't contains any of my codeRodri Represa
05/20/2021, 1:35 PMTheDukerChip
05/20/2021, 1:55 PMapp:layout_constraintDimensionRatio
in compose
Searched all through the google and SO got no luckVitaliy Zarubin
05/20/2021, 3:01 PM<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/image"/>
Sergey B
05/20/2021, 3:02 PMSlackbot
05/20/2021, 3:15 PMTimo Drick
05/20/2021, 3:45 PMTimo Drick
05/20/2021, 3:45 PMFilip Wiesner
05/20/2021, 3:56 PMAditya Thakar
05/20/2021, 4:53 PMZach Klippenstein (he/him) [MOD]
05/20/2021, 6:29 PMTimo Drick
05/21/2021, 7:26 AMAditya Thakar
05/21/2021, 7:45 AMTimo Drick
05/21/2021, 7:49 AMBox() {
content(myContent)
if (blockUI) Box(Modifier.matchParentSize().pointerInput(onDismissRequest) { detectTapGestures { } })
}
/**
* Locks the UI behind and after 300 ms it overlays the screen with the defined color and show a progress indicator.
*/
@Composable
private fun ProgressScrim(
modifier: Modifier = Modifier,
color: Color = Color.Black,
onDismiss: () -> Unit = {}
) {
var showScrim by remember { mutableStateOf(false) }
LaunchedEffect(key1 = onDismiss) {
delay(300)
showScrim = true
}
val alpha by animateFloatAsState(
targetValue = if (showScrim) .8f else 0f,
animationSpec = TweenSpec()
)
Box(
modifier
.pointerInput(onDismiss) {
detectTapGestures { onDismiss() }
}
.semantics(mergeDescendants = true) {
contentDescription = "Progress overlay"
onClick { onDismiss(); true }
},
contentAlignment = Alignment.Center
) {
if (showScrim) {
Canvas(Modifier.fillMaxSize()) {
drawRect(color = color, alpha = alpha)
}
CircularProgressIndicator()
}
}
}