escodro
04/23/2021, 2:18 PMReason: Expected exactly '1' node but could not find any node that satisfies
for screens I’m sure are working.
Has anyone faced any issue with it? Is there any recommended configuration for Compose Test or Android Emulator?
Thanks a lot in advance! ❤️Muhammad Zaryab Rafique
04/23/2021, 2:47 PMColton Idle
04/23/2021, 5:07 PMpopalay
04/23/2021, 5:15 PMShapes
class takes a CornerBasedShape
and not just a Shape
, and because of this I cannot use GenericShape
as a theme parameter?Afzal Najam
04/23/2021, 5:19 PMandroid:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
?Lilly
04/23/2021, 7:29 PMSlackbot
04/23/2021, 7:34 PMmzgreen
04/23/2021, 8:46 PMNat Strangerweather
04/23/2021, 9:18 PMgrandstaish
04/23/2021, 9:37 PMArkadii Ivanov
04/23/2021, 9:46 PMRememberObserver.onRemembered
. What is it about?Lilly
04/23/2021, 10:21 PMOutlinedTextField
. Is it intended?
@Preview
@Composable
fun OutLinedTextPreview() {
Box {
var text by rememberSaveable { mutableStateOf("") }
OutlinedTextField(
value = text,
onValueChange = { text = it },
label = { Text("Label") }
)
}
}
jw
04/24/2021, 1:53 AMrobnik
04/24/2021, 3:19 AMviewModel()
function, but don't show where to import it. IntelliJ is not helping me. Where is it? (Not sure why I need this magic function. Can I just create my ViewModel like a normal object?)rsktash
04/24/2021, 5:51 AMloloof64
04/24/2021, 11:02 AMalorma
04/24/2021, 11:19 AMSe7eN
04/24/2021, 12:22 PMText
? (not canvas)xxfast
04/24/2021, 1:12 PMrobnik
04/24/2021, 4:14 PMRow { Text(t1) Canvas Text(t2) }
. I want to measure a hypothetical Text(longestPossibleString)
and use that to set width of the two Texts, so that things are centered and don't move as t1 and t2 change.Chachako
04/24/2021, 5:38 PMSlackbot
04/24/2021, 6:39 PMChachako
04/24/2021, 6:59 PMLazyColumn
. I compared it today to RecyclerView
and it's really bad...robnik
04/24/2021, 11:14 PMNavHost(...) { composable(..., arguments = ...) {
... inside that I extract at argument (id: String), now I can want to query my Room database, like db.getThing(id):Flow<Thing>
and pass it to a @Composable fun ThingView(thing)
but that DB function is not callable outside of a coroutine context. So... where do I get the coroutine context, and then how to I hook the result obtained within that back to some MutableState that Compose can observe, in ThingView.Samir Basnet
04/25/2021, 3:36 AMPhilip Blandford
04/25/2021, 11:55 AM@Composable
@Preview
private fun InsetsTest() {
val activity = LocalContext.current as Activity
WindowCompat.setDecorFitsSystemWindows(activity.window, false)
MaterialTheme {
ProvideWindowInsets {
val text = remember { mutableStateOf("") }
Column(
Modifier
.fillMaxSize()
.background(Color.White)
) {
Box(
Modifier
.fillMaxWidth()
.weight(1f)
.background(Color.LightGray)
)
Column(
Modifier
.navigationBarsWithImePadding()
.background(Color.Yellow)) {
BasicTextField(
text.value,
{ text.value = it },
Modifier
.fillMaxWidth()
.heightIn(50.dp)
)
Box(Modifier.height(50.dp))
}
}
}
}
}
orangy
04/25/2021, 2:12 PMrememberScrollState
and provide inputs there (selected item in the main list), but now the scroll is not remembered at all, every switch in main list starts with initial position. How do I make scroll state in detail pane be persisted per item in the main list?Michal Klimczak
04/25/2021, 2:36 PMLaunchedEffect
or am I abusing something? I'm trying to detect changes to multiple States
and make a callback out of them.
@Composable
fun FooSlider(
onStartedSelection: () -> Unit,
onSelected: (value: Float) -> Unit
) {
var sliderPosition by remember { mutableStateOf(0f) }
val sliderInteractions = remember { MutableInteractionSource() }
val isDragged by sliderInteractions.collectIsDraggedAsState()
val isPressed by sliderInteractions.collectIsPressedAsState()
LaunchedEffect(isDragged || isPressed) {
when {
isDragged || isPressed -> onStartedSelection()
else -> onSelected(sliderPosition)
}
}
Slider(
value = sliderPosition,
onValueChange = { sliderPosition = it },
interactionSource = sliderInteractions
)
}
robnik
04/25/2021, 2:54 PMOleg Tretiakov
04/25/2021, 3:40 PMOleg Tretiakov
04/25/2021, 3:40 PMorangy
04/25/2021, 3:52 PMLayout
, you control measurement and placements there.Oleg Tretiakov
04/25/2021, 3:53 PM