Mjahangiry75
03/11/2021, 4:38 PMBackStack
?Gabriel
03/11/2021, 6:51 PMalorma
03/11/2021, 7:03 PMTask
that returns Bitmap
... I've added an await()
method to convert it to Bitmap directly... but, how to load it onto Composable?sen kumar
03/11/2021, 8:07 PMGabriel
03/11/2021, 8:32 PMAppCompatActivity
? It's what's in the default when creating a new composeSam
03/11/2021, 9:10 PMjcenter
but when i do, all hell breaks loose and i can no longer compileSam
03/11/2021, 9:51 PMnavigation-compose
ever added transitions? Trying to catch up on the last several versions but I didn’t see anything in the release notes, and I swear there was an issue about it but nothing related in the issue tracker: https://issuetracker.google.com/issues?q=componentid:409828Bradleycorn
03/11/2021, 9:55 PMnavigation-compose
and ViewModels. For a time now, we've been able to get a viewmodel scoped to a backstack entry (at first by rolling our own factory, then using a HiltViewModelFactory, and now by using hiltNavGraphViewModel()
). I presume that means that as long as the backstack entry exists, then the VeiwModel will hang around, and won't be cleared until the backstack entry is popped, right?
And if so, you might need to be careful in some cases when launching a coroutine using viewModelScope.launch
, right? If your are just making a newtork call to fetch a piece of data or something, no big deal. But if it's a longer running operation, then it will not get canceled until the backstackentry is popped from the stack. So, if say you have Composables A, B, and C that are entries in your graph, and you navigate from A to B to C ... if the ViewModel for A launched a coroutine in its viewModelScope
, it will still be running while the user is looking at C, correct? So if your intention is to launch a coroutine when the user is looking at A and have it get canceled when the user navigates to B, then you really need to use a different mechanism (like say LaunchedEffect
). Do I have that right?Tlaster
03/12/2021, 3:25 AMFatal Exception: java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
from firebase in my app and not sure what was the issue since I may not able to create a reproduce sample, full stacktrace in threadColton Idle
03/12/2021, 4:02 AMknthmn
03/12/2021, 7:51 AMLazyColumn()
), I sometimes want to extract several items in a function. So I define
fun LazyListScope.FooSection(...) { items.... }
and use it in my lazy lists
LazyColumn { FooSection(...) }
However Android Studio complains the naming since FooSection
is not a composable, I am wondering if this is not something I should do at the first place.Joost Klitsie
03/12/2021, 8:09 AMF
to pay your respects to this fallen topic, and move on to the world of uppercase CamelCase function naming with me.Radoslaw Juszczyk
03/12/2021, 8:43 AM…res/drawable-xxxhdpi/ic_test.png
the code I use:
Image(painter = painterResource(id = R.drawable.ic_test), contentDescription = "Test")
produces this exception:
java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
What am I doing wrong?Piotr Prus
03/12/2021, 8:46 AMallan.conda
03/12/2021, 9:06 AMAndré Kindwall
03/12/2021, 9:08 AMandroid:keepScreenOn
?julioromano
03/12/2021, 9:36 AMMarcin Środa
03/12/2021, 9:51 AMScaffold
it’s like animating from left to right after update. How to disable it? 🙂 It’s lagging on emulatorAlbert Chang
03/12/2021, 1:19 PMuiMode
to android:configChanges
of the activity, the app will only react to the first dark mode change. Just want to make sure I'm not missing anything.Utkarsh Tiwari
03/12/2021, 3:07 PMAnimatedVisibility
? I want to slow the animation a bit.Ujwal
03/12/2021, 4:43 PMjannis
03/12/2021, 6:13 PMDesmond Teo
03/12/2021, 6:18 PMescodro
03/12/2021, 7:17 PMRick Regan
03/12/2021, 8:43 PMCrossfade
on a Text
when it is set to the empty string, but not when it is updated in any other way.
This code will crossfade for every update to the state 'text'
Crossfade(targetState = text, animationSpec = tween(1000)) { newText ->
Text(text = newText)
}
but I'd only like it to apply when 'text' is cleared. Is it possible to do this with Crossfade, or do I need some other animation mechanism? (I didn't expect using if (text.isEmpty())
with a crossfaded Text in the if
and just a Text in the else
to work, but I tried it anyway and it didn't.)Colton Idle
03/12/2021, 8:52 PMGabriel
03/12/2021, 10:21 PMLilly
03/12/2021, 11:26 PMShared Preferences
. Just the hint, that it's not the right data storage solution. I would like to save some settings. What's the right way to store such data persistently?Konyaco
03/13/2021, 3:19 AMkeys.mapTo(items) { key ->
CrossfadeAnimationItem(key) {
val alpha by transition.animateFloat(
transitionSpec = { animationSpec }
) { if (it == key) 1f else 0f }
// NOTICE
Box(Modifier.alpha(alpha = alpha)) {
content(key)
}
}
}
And if it is not animating, it uses:
Box(modifier) {
items.fastForEach {
key(it.key) {
it.content()
}
}
}
The problem is, Modifier.alpha()
is an alias of graphicsLayer(alpha = alpha, clip = true)
,
If you are holding a Button, Card or anything with shadow, Crossfade will clip the shadow when animation starts, and resume when animation finishes, that will be very unnatural.
And I wonder the reason that Modifier.alpha()
sets clip
property to true, is that really necessary?robnik
03/13/2021, 4:26 AMCould not find org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.30.
What? Anyone else have this problem? I have two repos in gradle file: google()
and mavenCentral()
.robnik
03/13/2021, 4:26 AMCould not find org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.30.
What? Anyone else have this problem? I have two repos in gradle file: google()
and mavenCentral()
.lewis
03/13/2021, 6:52 AMjcenter()