Alexander Maryanovsky
06/06/2022, 8:01 AMFannyDemey
06/06/2022, 8:36 AMdimsuz
06/06/2022, 12:28 PM@Composable
functions as objects in this regard, but that's not true, is it? A function itself doesn't have anything to do with composition lifecycle: only its effects do. Is there some good mental model to think about this?Jhonatan Sabadi
06/06/2022, 12:31 PMtextField
inside LazyColumn
, its not work.
I’m using adjustResize
in manifest.dorche
06/06/2022, 1:18 PMColton Idle
06/06/2022, 1:30 PMOutlinedButton(
modifier = Modifier.fillMaxWidth().heightIn(min = 48.dp),
colors =
ButtonDefaults.outlinedButtonColors(
backgroundColor = if (toggle) CompanyPrimaryColor else Color.White))
Billy Newman
06/06/2022, 3:42 PMmattinger
06/06/2022, 6:50 PMRejecting invocation, expected 79 argument registers, method signature has 81 or more
If i group the sets of 4 into their own data classes and pass that in instead of as 4 separate parameters, things seem to start working again. What’s odd is that there’s actually 166 parameters to the constructor (yeah, i know, blame the design team for creating so many color tokens)Luis Daivid
06/07/2022, 3:45 AM@ExperimentalMaterialApi
in product apps?
I need to use ModalBottomSheetLayout
or BottomSheetScaffold
, but I’m afraid because it’s ExperimentalMaterialApi.
I need reviews from people who have been using this.
Additionally, does the meaning of @ExperimentalMaterialApi
mean that the API can be mutable as well as error-prone?nlindberg
06/07/2022, 8:00 AMModifier.onGloballyPositioned {
it.positionInParent()
Alexander Maryanovsky
06/07/2022, 8:05 AMColumn
and if several consecutive items are the same, they are “grouped” into one row. The user can choose to “ungroup” one item from the group, and then it appears in its own row. I’m trying to animate this process by having the ungrouped row slide downwards from the “group” row. I’ve successfully used AnimatedVisibility
on the row that appears, but this looks bad because only that row is animated - the rest of the rows below it “jump” to position. Is there no animation facility that takes care of animating the entire layout during a transition?SeikoDes
06/07/2022, 8:30 AMcomposable
based on chris’s article, and then I found out that painter is unstable, resulting in some composable
being non-skippable, Why can’t add @Immutable or @Stable to painter and How to change composable with a painter parameter to skippable?
restartable scheme("[androidx.compose.ui.UiComposable]") fun NormalImage(
unstable painter: Painter
stable contentDescription: String?
stable modifier: Modifier? = @static Companion
stable tint: Color = @dynamic LocalContentColor.current
)
Ngọc Nguyên Nguyễn
06/07/2022, 9:47 AMfengdai
06/07/2022, 1:33 PMAndroidView
’s factory
lambda will always be called twice when used in movableContentOf
. Does anyone know why?
val content = movableContentOf {
AndroidView(factory = { context ->
SomeView(context)
})
}
val content2 = movableContentOf {
// content2
}
val isLandscape =
LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE
if (!isLandscape) Column {
content()
content2()
} else Row {
content()
content2()
}
spierce7
06/07/2022, 3:14 PMAdam Powell
06/07/2022, 3:15 PMChris Fillmore
06/07/2022, 3:28 PMMarc
06/07/2022, 4:28 PMsave/restore
in Compose Canvas (or DrawingScope)?Colton Idle
06/07/2022, 7:50 PMinit {}
block. My first two thoughts were to either use a remember {}
or a LaunchedEffect. But both don't work.
Any ideas?
BottomSheetScaffold(
scaffoldState = complexBottomSheetState,
sheetContent = {
Box(Modifier.fillMaxWidth().height(200.dp)
) {
Log.e("ABC", "creating new VM?")
val newVm = hiltViewModel<ComplexBottomSheetViewModel>()
MyComplexBottomSheet(viewModel = newVm)
}
},
RayeW47
06/07/2022, 8:03 PMTextField
takes isError: Boolean
and I'm using my Maybe
state as a valid state with a small context message. I'm trying to not work around this in a way that I think is weird like... replacing the colors: TextFieldColors
, but maybe that's actually a better way to do it than I'm trying to hint at?Tash
06/08/2022, 4:58 AMAbhishek Dewan
06/08/2022, 6:06 AMJonas
06/08/2022, 6:43 AMdiego-gomez-olvera
06/08/2022, 9:14 AMRayeW47
06/08/2022, 9:40 AMTextField
param placeholder
gets called many times when the placeholder
in question gets rendered, it gets re-called many many times (18-24, not sure the criteria). is this simply something that just is, or is this a bug/avoidable? i have not been able to find much information on itNabeel
06/08/2022, 11:36 AMkotlinforandroid
06/08/2022, 1:42 PMRubyText
that contains text and optionally a ruby text that dictate it's reading. These are packed inside a FlowRow
.The problem I am facing is that I can't control line breaking properly this way. If there is a long slice of text without reading annotations they are packed into the same RubyText
composable. Thus they cannot break in the middle. Is there a way to hook into the native line-breaking and take advantage of it? Or do I have to re-implement it myself to make my rubied text work properly?
@Composable
fun RubyText(
text: String,
ruby: String? = null,
rubyVisible: Boolean = true,
style: TextStyle = TextStyle.Default,
) {
val rubyFontSize = LocalTextStyle.current.fontSize / 2
val boxHeight = rubyFontSize.toDp()
Column(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Box(modifier = Modifier.requiredHeight(boxHeight + 3.dp)) {
ruby?.let {
if (rubyVisible) {
Text(text = it, style = TextStyle(fontSize = rubyFontSize))
}
}
}
Text(text = text, style = style)
}
}
// This renders the second image (nside of the thread).
fun example2() {
RubyText(text = "このルールを")
RubyText(text = "守", ruby = "まも")
RubyText(text = "るらない")
RubyText(text = "人", ruby = "ひと")
RubyText(text = "は")
RubyText(text = "旅行", ruby = "りょこう")
RubyText(text = "ができなくなることもあります。")
}
mertceyhan
06/08/2022, 2:52 PMvar foo = rememberSaveable { false }
Justin Breitfeller
06/08/2022, 4:24 PMSubcomposeLayout
by:
1. Call subcompose
with the passed in width constraints
2. If the resulting placeables are too wide, call subcompose
with constraints that has a minWidth of what was passed to the SubcomposeLayout.
3. I then only place either the horizontal or vertical placeables.
The one problem I’m having with this approach is the semantics tree still knows about the horizontal subcomposition even though I never placed them. Is there a way to remove them or perhaps another way to approach this problem?Marco Pierucci
06/08/2022, 5:27 PMMarco Pierucci
06/08/2022, 5:27 PMIllegalArgumentException page must be >= 0 and < pageCount
So apparently (on the test) pagerSate’s pageCount its not being updated fast enough.
Im trying to understand if this is indeed correct ( since the lazylaout adoption and pager state no longer having page count property) or if hopefully Im missing something.
Sorry if the question is too abstract but any insight could help. Cheers!Andrey Kulikov
06/08/2022, 5:48 PMMarco Pierucci
06/08/2022, 8:18 PM