jannis
12/01/2021, 3:47 PMTextField
? I know about the selection
of the TextFieldValue
. But I need the coordinates. As an alternative: Is there any way to scroll to the current Cursor positon within a scrollable TextField
or one within a scrollable container?Joey
12/01/2021, 4:01 PMStylianos Gakis
12/01/2021, 4:12 PManimateContentSize
modifier that does not clip the item to its bounds? And I’d love to understand the reason that it is a default without a parameter that can change it @Doris Liu
My use case is that I have a simple Card inside a RecyclerView that I’d like to animate when it changes, but the fact that it’s forced to clip bounds cuts the shadow and makes it look super ugly.
Is there maybe a different API I should be using instead? For now I simply copy-pasted the private functions existing in the library and removed the clipToBounds
call and it does exactly what I wanted it to.Marcello Galhardo
12/01/2021, 4:26 PMbringIntoView
is actually mandatory but you should get the point):
@Composable
private fun MyTextField(
// other attributes
modifier: Modifier = Modifier.bringIntoView(), // optional modifier that can be overriden.
) {
And the warning:
Optional Modifier parameter should have a default value of Modifier
ms
12/01/2021, 5:03 PM@physics_only_
Instagram reel but was removed now.
Tried with different approaches but finally went with Recursive Composables (it was fun)
GitHub repo
Original animation in 🧵zsperske
12/01/2021, 5:58 PMjava.lang.NoSuchMethodError: No virtual method setContent(Lkotlin/jvm/functions/Function0;)V in class Landroidx/compose/ui/platform/ComposeView; or its super classes (declaration of 'androidx.compose.ui.platform.ComposeView' appears in /data/app/~~80WnH7kFvYH_QJwuutqQpw==/com.ourapp.android.debug-V0ZNfKBI9LNUKhjnWxUOKg==/base.apk)
We have a buildSrc
and so tried to follow the guidance here <https://issuetracker.google.com/issues/176079157>
however when I add
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
to my buildSrc gradle file, I get a Plugin request for plugin already on the classpath must not include a version
Has anyone else run into this?CLOVIS
12/01/2021, 6:57 PMmcpiroman
12/01/2021, 7:15 PMArkadii Ivanov
12/01/2021, 8:23 PMtad
12/01/2021, 8:25 PMTim Malseed
12/01/2021, 9:16 PMcomposeTestRule.setContent { MyScreen() }
- if you’ve written Compose UI tests, you’d be familiar with this.
If you need to run the tests against a particular activity, for some reason, you can use androidComposeTestRule<MyActivity>
In my case, MyActivity
calls setContent { MyScreen() }
during onCreate()
.
So, what ends up happening, is the test instantiates MyActivity
, which calls setContent()
, and the screen is composed, with its ViewModel and various dependencies. While this is happening, the test calls its own setContent()
and the screen is composed again, in parallel! This causes all kinds of nightmarish problems.
tl;dr
Make sure when testing Compose, that you only call setContent()
once per test. And be careful about which Activity
you use to host the test, if you need one!jeff
12/01/2021, 10:13 PMbrabo-hi
12/01/2021, 10:54 PMMaterialTheme
color fiesVinay Gaba
12/02/2021, 6:08 AMonDispose
of the DisposableEffect but I'm getting a JobCancellationException
. This is probably due to the coroutine scope that I'm using (its the one that rememberCoroutineScope
returns) that's not available anymore when I'm executing the onDispose
block. Wondering how I can solve this?Colton Idle
12/02/2021, 6:22 AMabbic
12/02/2021, 9:58 AMolonho
12/02/2021, 1:02 PMhttps://www.youtube.com/watch?v=JKjN5mmnSX0▾
Ehsan Mehranberg
12/02/2021, 3:26 PMAndroidView
that wraps a ComposeView
and the content of the ComposeView
could be any composable
@Composable
fun SharedElement(
modifier: Modifier = Modifier,
transitionTag: String,
@IdRes viewId: Int,
content: @Composable () -> Unit
) {
AndroidView(
modifier = modifier,
factory = { context ->
ComposeView(context).apply {
transitionName = transitionTag
id = viewId
setContent {
content()
}
}
}
)
}
The problem is when the first fragment gets destroyed, the content of shared element gets decomposed as well and we can’t have a smooth transition between fragments. Ideally, shared composables should decompose when the element transition ends but I couldn’t find a way to do that. Any idea how this shared element transition can be nailed with composables and fragments?robnik
12/02/2021, 3:47 PMArpit Shukla
12/02/2021, 4:06 PMTgo1014
12/02/2021, 4:17 PMprimaryContainer
would be generated from primary
for exampleBrian Donovan
12/02/2021, 4:46 PMMarcin Wisniowski
12/02/2021, 6:06 PMdimsuz
12/02/2021, 6:17 PMhasFocus = false
immediately after one of the children receives hasFocus = true
Tuba Kesten
12/02/2021, 6:40 PManimateColorAsState
; however, this causes to take action while tween animation is running. Is there any way to understand when the exit animation completed?Paul
12/02/2021, 9:13 PMMotionLayout
for Compose and cannot understand whether it supports specifying OnSwipe
gestures that we can define inside scene files in XML. Is it something that will be added later on, because the docs say that the first version of MotionLayout
for Compose supports only a subset of features?Sololo
12/03/2021, 6:15 AMRene Win
12/03/2021, 6:25 AMResourcesCompat.getFont()
Is there any possibility to render this view in the preview? It failes with an exception "Font resource ID #0x7f080000 could not be retrieved"
If I build and deploy the application it all works fineFlorian
12/03/2021, 8:07 AMDeepak Gahlot
12/03/2021, 12:26 PMDeepak Gahlot
12/03/2021, 12:26 PM