Louis
10/20/2021, 12:26 PMArpit Shukla
10/20/2021, 1:23 PMnavigationBarsPadding
modifier for my entire app content. But is there any other way?rattleshirt
10/20/2021, 3:01 PMLazyRow
items (with content image / title / max 3 lines) to fill to the height of the LazyRow
? fillParentMaxHeight
doesn’t seem to workChris Johnson
10/20/2021, 3:23 PMcomposed
modifier here.
@SuppressLint("UnnecessaryComposedModifier")
@Stable
fun Modifier.clickableNoIndication(onClick: () -> Unit): Modifier = composed {
clickable(onClick = onClick, indication = null, interactionSource = remember { MutableInteractionSource() })
}
I have to add the suppression otherwise it complains. But if I don't use it, I can't use remember. Am I missing something simple?Lucca Beurmann
10/20/2021, 8:52 PMjames
10/20/2021, 10:10 PMAleksey Chugaev
10/21/2021, 5:37 AMOutlinedTextField
if I try to use it for number input only and restrict it to 2 digits after the decimal separator, see code in threadMatti MK
10/21/2021, 7:07 AMSystem UI Controller
on the root of every screenInk
10/21/2021, 8:28 AMImage(
painter = painterResource(id = R.drawable.wifi),
contentDescription = "",
colorFilter = ColorFilter.tint(Color.Red)
)
Anthony Martin
10/21/2021, 8:28 AMInstrumentationRegistry.getInstrumentation().targetContext
Then calling the resulting context
with getString(R.string.app_name)
returns:
Using Method threw 'android.content.res.Resources$NotFoundException' exception.
It does this in my project along with the default compose template project in Android Studio.
It would be handy if we had resources to test since we can then test multiple languages with UI tests and produce screenshots for this to send to our QA team as part of a release build.
One project is using the latest alpha version, and the other is using the latest stable version.Geert
10/21/2021, 9:14 AMjava.lang.RuntimeException: Canvas: trying to draw too large(105294960bytes) bitmap.
is there a way to fix this? I also tried accomponistlouiscad
10/21/2021, 10:18 AMandroid:launchMode="singleTop"
in the AndroidManifest.xml
for the host Activity.Zoltan Demant
10/21/2021, 10:30 AManimateXYZAsState
in a composable thats used literary everywhere?
Use-case: Its a Text composable, and Id like to animate changes to its state (dim, highlight, etc).Albert Francis
10/21/2021, 11:32 AMHorizontalPager
with x many
items (can be 1 can be 20+) and each one of the item needs to call a BackEnd to fill it's information.
So every time i receive a pageIndex i call viewmodel.getMeSomeCake(index)
and when i receive it i want to fill the screen.
I want to use StateFlow but i got the same problem as if it's a fragment with ViewPager. Pager creates the n-1
,n
,n+1
pages so the data i got is not the one for the visible page.
is there any recommended ways to do it on compose?Tgo1014
10/21/2021, 12:11 PMraenardev
10/21/2021, 12:24 PMCanvas
composable i have access to its size inside DrawScope
.
I want to use this size to create Path
and then clip it out.
However, i shouldn’t allocate Path object there, right? So i want to use remember
, but i can’t in DrawScope
.
Am i missing something, or the only way to do this is to measure constraints outside of Canvas, create Path with remember, and then use it inside DrawScope?Henning B
10/21/2021, 12:44 PMprivate var _state: State by mutableStateOf(Loading)
override val state: State = _state
fun onLoadClicked() {
_state = Loading
viewModelScope.launch {
_state = when (val content: Content? = loadData()) {
null -> Error
else -> PresentData(content)
}
}
}
So now I would like to test the behaviour of onLoadClicked. But I do not know how to verify that calling that function sets the state to Loading and than to PresentData/Error. I could observe a liveData and remember all states is was set to but how do I do it with mutableStateOf?mattinger
10/21/2021, 2:19 PMBrian G
10/21/2021, 2:29 PMjava.lang.IllegalStateException: Nesting scrollable in the same direction layouts like LazyColumn and Column(Modifier.verticalScroll()) is not allowed.
when the compose docs clearly state Automatic nested scrolling: Simple nested scrolling requires no action on your part. Gestures that initiate a scrolling action are propagated from children to parents automatically, such that when the child can't scroll any further, the gesture is handled by its parent element
The docs then go on to give a sample of nesting one vertical scrolling box inside another vertically scrolling box.Tolriq
10/21/2021, 3:19 PMNestedScrollConnection
is not called at all when `listState.scrollToItem`is called manually?theapache64
10/21/2021, 4:22 PMFloatTweenSpec
? and how is it different from tween
? 🤔saket
10/21/2021, 4:38 PMLazyColumn
with AndroidView
items and I’m just noticing that AndroidView#update
is getting called on every scroll/recomposition. Is this expected?colintheshots
10/21/2021, 4:55 PMMichael Langford
10/21/2021, 4:56 PMtheapache64
10/21/2021, 5:17 PManimateBoundsAsState
? 🤔 removed or its doc mistake?Tolriq
10/21/2021, 6:07 PMModifier.weight(1f, fill = false)
Error:
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Boolean
at xxxxx.library.LiveLiterals$LibraryDestinationKt.Boolean$arg-1$call-weight$val-tmp3_modifier$fun-$anonymous$$arg-3$call-Row$fun-$anonymous$$arg-1$call-CompositionLocalProvider$fun-$anonymous$$arg-3$call-Column$fun-$anonymous$$arg-3$call-Row$fun-$anonymous$$arg-3$call-Box$fun-AlbumEntry(Unknown Source:31)
Is there something I miss in the stack trace?appmattus
10/21/2021, 6:48 PMText
) in the list the animation becomes jerky. In comparison, having only the button in the list the animation is relatively smooth. (Videos attached)
(Code and videos in thread)AmrJyniat
10/21/2021, 6:53 PMisError = true
to the TextField the border's color not becomes only Red but I see it's combination of PrimaryColor and Red, any tips about the issue?adjpd
10/22/2021, 11:59 AMKamesh Yadav
10/22/2021, 12:40 PMjava.lang.IllegalStateException: Snapshot is not open
Kamesh Yadav
10/22/2021, 12:40 PMjava.lang.IllegalStateException: Snapshot is not open
1.0.3.
I am running the app in emulator if that helps.java.lang.IllegalStateException: Snapshot is not open
at androidx.compose.runtime.snapshots.SnapshotKt.validateOpen(Snapshot.kt:1459)
at androidx.compose.runtime.snapshots.SnapshotKt.access$validateOpen(Snapshot.kt:1)
at androidx.compose.runtime.snapshots.MutableSnapshot.apply(Snapshot.kt:585)
at androidx.compose.runtime.Recomposer.applyAndCheck(Recomposer.kt:799)
at androidx.compose.runtime.Recomposer.access$applyAndCheck(Recomposer.kt:103)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1064)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:103)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:447)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:416)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)