orangy
07/09/2022, 8:43 PMderivedStateOf
or maybe there is a bug. I have remembered derived state which basically gets parameter of a composable function (AnnotatedText) and produces a value from it, some other local mutable state (hover state) and some composition local (theme holding colors). The problem is that the derived state doesn’t produce change when composition local changes. If I remove remember
it obviously recomposes, new instance is created and it works fine. But that means that it will recompose and recalculate the value whenever anything changes, which is rather expensive in my case. Do I miss something?Jitendra
07/10/2022, 1:32 AMMarcin Wisniowski
07/10/2022, 2:03 PMitnoles
07/10/2022, 4:10 PMAndrei Kovalev
07/10/2022, 4:36 PMSlackbot
07/10/2022, 7:55 PMColton Idle
07/11/2022, 12:30 AMcollectAsState
is it more appropriate to have
1️⃣ val user = appStateHolder.currentUser.collectAsState().value
or
2️⃣ val user = appStateHolder.currentUser.collectAsState()
Vaios Tsitsonis
07/11/2022, 8:40 AMNo compose hierarchies found in the app. Possible reasons include: (1) the Activity that calls setContent did not launch; (2) setContent was not called; (3) setContent was called before the ComposeTestRule ran. If setContent is called by the Activity, make sure the Activity is launched after the ComposeTestRule runs
With the term randomly, I mean different tests every time.
I have defined my rules like that:
@get:Rule(order = 0)
var hiltRule = HiltAndroidRule(this)
@get:Rule(order = 1)
val composeTestRule = createEmptyComposeRule()
@get:Rule(order = 2)
val activityTestRule = createActivityRule<MainActivity>()
Is there something wrong???Alex
07/11/2022, 12:08 PMList
parameter as @Stable
, could I also just use an ImmutableList
from https://github.com/Kotlin/kotlinx.collections.immutable ?
Will Jetpack Compose understand?Luke
07/11/2022, 3:25 PMRect.contains(Offset)
is not marked as operator
? It would be nice to be able to use the in
keywordziv kesten
07/11/2022, 3:59 PMCard
with these gradient?, card
background color only responds to backgroundColor
, using modifer like this:
.background(brush = Brush.linearGradient(
colors = listOf(
colorResource(id = R.color.lemonade_pink),
Color.White.copy(alpha = 0.1f)),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
)
)
kotlinforandroid
07/11/2022, 4:07 PMModalBottomSheetLayout
. The problem I am facing is that the BottomSheets also draw under the statusbar. It looks weird when the sheet is not fully expanded since the sheet has a lot of padding visible at the top. How can I prevent this?mattinger
07/11/2022, 4:36 PMScrim(
color = scrimColor,
onDismiss = {
if (sheetState.confirmStateChange(Hidden)) {
scope.launch { sheetState.hide() }
}
},
visible = sheetState.targetValue != Hidden
)
As a side question, under what other circumstances would confirmStateChange be called? I see a bunch of stuff in the semantics area, but on testing, i don’t see confirmStateChange called if i manually call hide().Colton Idle
07/11/2022, 5:09 PM@Composable
fun MyText(text: String, style:MyTextStyle, color: Color) {
val selectedStyle = when (style) {
MyTextStyle.H1 -> MyTypography.H1 //maps enum to TextStyle
MyTextStyle.H2 -> MyTypography.H2
}
Text(text = text, color = color, style = selectedStyle)
}
Does this seem like a bad idea to anyone? The map of an enum to a text style feels off, but I think this would get the job done.Lisandro Di Meo
07/11/2022, 6:49 PMBrendan Campbell-hartzell
07/11/2022, 8:50 PMzsperske
07/11/2022, 8:54 PMSpannableString
to an AnnotatedString
?Travis Griggs
07/11/2022, 9:02 PMTravis Griggs
07/11/2022, 11:39 PMNgọc Nguyên Nguyễn
07/12/2022, 8:13 AMTgo1014
07/12/2022, 9:39 AMFrank van der Laan
07/12/2022, 9:46 AMmiqbaldc
07/12/2022, 9:48 AMVahalaru
07/12/2022, 11:45 AMAlejandro Rios
07/12/2022, 1:27 PMSlackbot
07/12/2022, 1:55 PMDmitry Berdnikov
07/12/2022, 2:33 PMnuhkoca
07/12/2022, 6:12 PMagrosner
07/12/2022, 7:43 PMjava.lang.IllegalArgumentException: LazyHorizontalGrid's height should be bound by parent.
We started receiving this when we moved to the standard LazyHorizontalGrid
implementation in 1.2.0 (we're on rc01). This lives within a LazyVerticalGrid
(full span). Does this mean we need to fix the height of the grid within this container (no way for the content to speak to its size)Jonas
07/13/2022, 5:37 AMColumn(modifier = Modifier.verticalScroll(rememberScrollState())) {
ConstraintLayout {
Text(
text = "this should be a heading",
modifier = Modifier.semantics { heading() })
}
}
As soon as something is wrapped in a scrollable container (also tried with LazyLists) and a ConstraintLayout TalkBack does not announce that text as heading.
Apart from the semantic tree looking correct (see thread).
Anyone an idea what could cause this? Should we file a bug report?Jonas
07/13/2022, 5:37 AMColumn(modifier = Modifier.verticalScroll(rememberScrollState())) {
ConstraintLayout {
Text(
text = "this should be a heading",
modifier = Modifier.semantics { heading() })
}
}
As soon as something is wrapped in a scrollable container (also tried with LazyLists) and a ConstraintLayout TalkBack does not announce that text as heading.
Apart from the semantic tree looking correct (see thread).
Anyone an idea what could cause this? Should we file a bug report?Printing with useUnmergedTree = 'false'
Node #1 at (l=0.0, t=56.0, r=259.0, b=89.0)px
|-Node #2 at (l=0.0, t=56.0, r=259.0, b=89.0)px
VerticalScrollAxisRange = 'ScrollAxisRange(value=0.0, maxValue=0.0, reverseScrolling=false)'
Actions = [ScrollBy]
|-Node #3 at (l=0.0, t=56.0, r=259.0, b=89.0)px
DesignInfoProvider = 'androidx.constraintlayout.compose.Measurer@9cb80f4'
|-Node #4 at (l=0.0, t=56.0, r=259.0, b=89.0)px
Text = '[this should be a heading]'
[Heading]
Actions = [GetTextLayoutResult]