Aditya Wasan
01/21/2022, 8:28 AMModifier.scale
on canvas instead of my original approach and that does not seem to render anything (or render too small for it to be visible) so I was wondering if that is the correct approach or not? Code in threadGerardo Ernesto Rodriguez Navar
01/21/2022, 11:48 AMViewHolder
that uses compose to render, but when I click it, the whole screen jumps. Here is the video:elye
01/21/2022, 12:39 PMderivedStateOf
is more superior than remember(value)
given it can reduce the unnecessary recomposition. I wonder is there any downside using remember { derivedStateOf { value } }
as oppose to remember(value)
? More elaboration of my question in https://stackoverflow.com/questions/70801388/is-there-downside-replacing-all-remembervalue-with-remember-derivedstateofJan Skrasek
01/21/2022, 1:13 PMNavHost(startDestination = "A") {
composable("A") {}
navigation(startDestination = "B") {
composable("B") {}
navigation(startDestination = "C") {
composable("C") {}
composable("D") {}
}
}
}
I struggle with navigateUp(). It seems that it nicely utilize startDestination. So when deeplinking "D", navigate Up ends up in C.
But when I continue with navigateUp in C, I skip to the "A", not "B" as I would expect.
Is it a bug? Some debugging info in thread.Rahul Rawat
01/21/2022, 1:27 PMBrian Donovan
01/21/2022, 2:41 PMColton Idle
01/21/2022, 3:20 PMmyanmarking
01/21/2022, 3:57 PMLocalContext.current
is not returning me the fragment context. Is there a way to get it, without passing the context explicitly?brabo-hi
01/21/2022, 5:33 PMNavHost(navController = navController, startDestination = "") {
composable("viewA"){}
composable("viewB") {}
Scaffold(){
NavHost(myOwnNavController, startDestination = "Child1") { // How to avoid this
composable("Child1") {}
}
}
}
In this example i have to use two NavController
Anthony
01/21/2022, 5:35 PMArpit Shukla
01/21/2022, 6:27 PM"This is a <b>bold</b> text."
In View world I was able to directly use this resource and put it in a TextView as it accepts a CharSequence
for text. In Compose, however, I need to create an AnnotatedString
out of this resource to display it in a Text composable. How to do this?Esme
01/21/2022, 7:37 PMmyanmarking
01/21/2022, 8:30 PMMarco Pierucci
01/22/2022, 5:00 AMlinus muema
01/22/2022, 7:50 AMChildState
in the ParentState
class.Sanendak
01/22/2022, 8:25 AMhfhbd
01/22/2022, 11:43 AMBackHandler
and mutableState
, do you still use Google androidx navigation library or simple a state based approach?Marcin Wisniowski
01/22/2022, 5:53 PMborder-image-repeat
from CSS, I have an image like a 9-patch drawable, except I need to repeat the borders as needed, not stretch them as 9-patch does. How would I go about that in Compose? Or should I go straight to a Canvas and implement it from scratch?Filip Wiesner
01/22/2022, 6:32 PMwithMutableSnapshot
(which has been mentioned here several times) I saw a little note at the end of the doucmentation:
[block] must not suspend if [withMutableSnapshot] is called from a suspend function.Why is that? 🤔 Is it because other code can be run on the same thread when the
block
suspends resulting in other unrelated part of the app being in this snapshot? I am not sure I know enough about Compose and Coroutines to be sure.Marcin Wisniowski
01/22/2022, 7:08 PMText
with a specific size in pixels? It seems you can only specify the size in sp
and em
.myanmarking
01/22/2022, 9:27 PMrsktash
01/22/2022, 11:10 PMoffset
modifier should be called before nestedScroll
modifierVahalaru
01/23/2022, 12:25 AMAlderson Elliot
01/23/2022, 3:42 AMMohammad Sianaki
01/23/2022, 9:41 AMKaushalya
01/23/2022, 4:26 PMSolomon Tolu Samuel
01/23/2022, 4:56 PMColton Idle
01/23/2022, 7:37 PMLaunchedEffect(key1 = "launch_once") {
myViewModel.doSomething()
}
Lukasz Kalnik
01/23/2022, 9:36 PMColumn {
Image(
painter = rememberImagePainter(backdropImageUrl),
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxWidth(),
)
}
However it doesn't render anything.
The only way to make it work is like this:
Column {
Image(
painter = rememberImagePainter(backdropImageUrl) {
size(OriginalSize)
},
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxWidth(),
)
}
Is it correct? Can't Coil just automatically predict the size of the image based on the width (and calculate the height from it based on the aspect ratio)?
It is really a super basic use case, would be nice to have some sensible default behavior for it.brabo-hi
01/24/2022, 4:18 AMrememberPermissionState
within a compose?brabo-hi
01/24/2022, 4:18 AMrememberPermissionState
within a compose?@OptIn(ExperimentalPermissionsApi::class)
@Composable
@Preview
fun MyPreview() {
val cameraPermissionState = rememberPermissionState(android.Manifest.permission.CAMERA)
}
java.lang.IllegalStateException: Permissions should be called in the context of an Activity