Tower Guidev2
06/29/2022, 10:24 AMBackdropScaffold
there are a number of features i do not like and would like to customise
1). when the back layer is open the user cannot interact with the frontlayer. is there any way i can enable frontlayer interactions while the backdrop is open?
2). i would like to animate the transition between Hamburger and Cross icon, however i cannot see how to achieve this.
3). I have added my own animation for conceal/reveal of the back layer which i like however it has made the transition between the hamburger and cross icon very "sluggish"
what have i done wrong?Erik
06/29/2022, 12:04 PMFoo
and you want to create a @Composable fun
to build some UI for Foo
instances. How would you name it?
• `Foo`: note that this is the same name as the Foo
class. This is not an error (if class and function are in different namespaces), but it could be confusing.
• FooView
• FooComposable
Something else? Are there guidelines for composable naming?the great warrior
06/29/2022, 12:39 PMJessica Ernst
06/29/2022, 1:53 PMColton Idle
06/29/2022, 5:20 PMLookaheadLayout
that supports a lookahead pass before the actual measure/layout.
• Introduced the UrlAnnotation
annotation type and associated methods to support TalkBack
link support in `AnnotatedString`s.
• Add optional alpha parameter to Brush flavor of TextStyle
and SpanStyle
to modify opacity of the whole Text
• Added a new API WindowInfo.keyboardModifiers
to observe its state within composable functions or via snapshotFlow
Version 1.0.0-alpha14
• Nothing too major. See here if curiousLandry Norris
06/29/2022, 8:15 PMespresso testing framework does not support compose projects
. When I Google this error, I only find articles about how to use espresso with a compose project. To my knowledge, espresso does currently support compose. I tried this on Chipmunk and Electric Eel. Has anyone run into this issue before?Berkeli Alashov
06/29/2022, 11:04 PMFullScreenLoading
. Requirements include to announce loading starting and finishing via TalkBack. I have two possible implementations using DisposableEffect
in loading icon's composable scope and both are not ideal. Including code in comments. Any ideas to improve option 1 (from code) or maybe I should go with option 2 in cases like this?Colton Idle
06/30/2022, 4:50 AMYoung Rock
06/30/2022, 6:55 AMMichał Diner
06/30/2022, 8:06 AMColton Idle
06/30/2022, 9:09 AM@Singleton
class AppStateHolder() {
var someBoolean by mutableStateOf(false)
Stylianos Gakis
06/30/2022, 9:42 AM<androidx.compose.ui.platform.ComposeView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"/>
Inside of a <LinearLayout>
and I am experiencing a problem where for 1 frame the ComposeView starts aligned to the left and then it jumps to the center.
Is this something someone else has experienced as well? Any thoughts on a workaround aside from finally fixing that screen to not be so archaic 😅kotlinforandroid
06/30/2022, 11:01 AMvide
06/30/2022, 11:43 AMorangy
06/30/2022, 3:17 PMspierce7
06/30/2022, 7:59 PMspierce7
06/30/2022, 8:18 PMLilly
06/30/2022, 9:37 PMunselectedContentColor
of Tab
is not respected. Do I miss something or is this a bug?
Tab(
selected = true,
text = { Text(stringResource(section.stringRes)) },
onClick = { selectedTabIndex = i },
selectedContentColor = LightGreen600,
unselectedContentColor = Color.Red
)
fengdai
07/01/2022, 1:32 AMLazyColumn {
...
if (lazyItems.loadState.append is LoadState.Loading) {
item(contentType = Loading) {
PagingLoadingItem()
}
}
if (lazyItems.loadState.append is LoadState.Error) {
item(contentType = Error) {
PagingErrorItem {
lazyItems.retry()
}
}
}
if (lazyItems.loadState.append.endOfPaginationReached) {
item(contentType = EndReached) {
PagingEndItem()
}
}
Or:
LazyColumn {
...
item(contentType = LoadStateIndicator) {
if (lazyItems.loadState.append is LoadState.Loading) {
PagingLoadingItem()
}
if (lazyItems.loadState.append is LoadState.Error) {
PagingErrorItem {
lazyItems.retry()
}
}
if (lazyItems.loadState.append.endOfPaginationReached) {
PagingEndItem()
}
}
}
Stefan Oltmann
07/01/2022, 7:04 AMModifier.weight(1.0f)
I have this extension function:
@Composable
fun ColumnScope.FillSpacer(): Unit = Spacer(Modifier.weight(1.0f))
Now I try to figure out how I can define my val
for that.
I find it a bit tricky because of the ColumnScope.Jan Skrasek
07/01/2022, 8:18 AMColumn(modifier = Modifier.verticalScroll(rememberScrollState()).fillMaxSize) {
Box(modifier = Modifier.weight(1f).sizeIn(minHeight = 160.dp))
Box(modifier = Modifier.height(600.dp))
}
Saiedmomen
07/01/2022, 9:04 AM1.2.0
while everything else is at rc03?
Is it because it is a classpath dependency?
https://maven.google.com/web/index.html?q=compose#androidx.compose.compiler:compiler:1.2.0Nuru
07/01/2022, 10:50 AMIan Warwick
07/01/2022, 11:48 AMBox
to stop constraining its children? I just want them to overflow when I offset(x,y)
them or size them
Box(Modifier.size(256.dp)) {
Box(Modifier.border(2.dp, Color.Red).size(512.dp)) {
}
}
The inner box always gets constrained to the outer box which I don’t want, but I do want all the cool things about the box such as Alignment
I just don’t want it to constrain children size, any ideas? 🙂kotlinforandroid
07/01/2022, 11:56 AMremember
in combination with Proto DataStores? I've defined my DataStore
:
val Context.dataStore: DataStore<AppPreferences> = dataStore(serializer = ..., ...)
However, I would like to have a way to fetch single values inside composables:
@Composable
fun SomeUI() {
val context = LocalContext.current
var userFontSize by remembe { context.dataStore.data.fontSize } // or something similar
// Re-composition happens if the value changes for some reason. And it also gets stored if the var changes.
}
It's easy to do with a SharedPreferences
-backed DataStore
since I can use keys to fetch the value and set it. But I am not sure how to do it with Protobufs.Dean Djermanović
07/01/2022, 12:49 PMSomething went wrong while getting root views
java.lang.IllegalArgumentException: Failed requirement.
imply? I’m using an AndroidView
composable in which I create an instance of a custom view from 3rd party library. The error happens when I quickly navigate to/from that AndroidView
composable.Kata
07/01/2022, 2:20 PMmattinger
07/01/2022, 6:28 PMNode #5 at (l=0.0, t=0.0, r=320.0, b=174.0)px
[IsDialog]
|-Node #6 at (l=0.0, t=0.0, r=320.0, b=174.0)px, Tag: 'alertDialog'
|-Node #8 at (l=24.0, t=8.0, r=45.0, b=49.0)px
| Text = '[Let's try that again]'
| Actions = [GetTextLayoutResult]
|-Node #9 at (l=24.0, t=44.0, r=72.0, b=85.0)px
| Text = '[Sorry, we ran into a problem. Please try again.]'
| Actions = [GetTextLayoutResult]
|-Node #10 at (l=176.0, t=115.0, r=240.0, b=172.0)px
| Role = 'Button'
| Focused = 'false'
| Text = '[Exit setup]'
| Actions = [OnClick, GetTextLayoutResult]
| MergeDescendants = 'true'
|-Node #13 at (l=248.0, t=115.0, r=312.0, b=172.0)px
Role = 'Button'
Focused = 'false'
Text = '[Try again]'
Actions = [OnClick, GetTextLayoutResult]
MergeDescendants = 'true'
The problem is if i match using isDialog()
, there seems to be no decent way of checking all descendants, only direct children. So i had to add a test tag to the actual alert dialog, and then i can use onChildren()
to find one that has the right text. The other issue is that there’s no semantics indicating which one is the title and which one is the body. Same issue with buttons as well. I do suppose I could add test tags to each node individually in my call to AlertDialog. What are others doing here?Arun Joseph
07/01/2022, 6:48 PMrememberAnimatedNavController
not to remember navController
across process death?Marcin Wisniowski
07/01/2022, 11:44 PMMarcin Wisniowski
07/01/2022, 11:44 PMAdam Powell
07/02/2022, 12:10 AMRE
07/02/2022, 3:42 AM@Composable
fun Md3BottomNavigation(
content: @Composable RowScope.() -> Unit
) {
Surface(
tonalElevation = 3.dp
) {
CompositionLocalProvider(
LocalAbsoluteTonalElevation provides LocalAbsoluteTonalElevation.current - 3.dp
) {
NavigationBar(
modifier = Modifier.navigationBarsPadding()
) {
content()
}
}
}
}
Marcin Wisniowski
07/03/2022, 4:37 PM