karn
04/27/2021, 1:13 AMjava.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at org.jetbrains.kotlinx.serialization.compiler.backend.ir.IrBuilderExtension$serializerInstance$1.invoke(GeneratorHelpers.kt:593)
at org.jetbrains.kotlinx.serialization.compiler.backend.ir.IrBuilderExtension$serializerInstance$1.invoke(GeneratorHelpers.kt:592)
at org.jetbrains.kotlinx.serialization.compiler.backend.ir.IrBuilderExtension$DefaultImpls.serializerInstance(GeneratorHelpers.kt:609)
...
Kai Zhu
04/27/2021, 1:21 AMAhmed Mourad
04/27/2021, 3:35 AMCanvas
and I'm trying to draw text inside a "balloon", but DrawScope
doesn't seem to have a drawText
method, the only way to draw text seems to be:
drawIntoCanvas {
it.nativeCanvas.drawText(...)
}
Which is buried deep enough that it's probably bad to use.
What are the alternatives to this? I also need to have the dimensions of the drawn text in order to wrap the "balloon" around it.Zach Klippenstein (he/him) [MOD]
04/27/2021, 3:48 AMLayout
, since there’s relatively so little overhead (both code boilerplate and no giant View class to worry about). In other words, embracing and leveraging compose’s tools instead of trying to work around them.
Then problems like how to draw shadows, text, etc would be much simpler because they’d be done using the regular compose APIs.Quentin Dommerc
04/27/2021, 6:43 AMColton Idle
04/27/2021, 7:41 AMcom.android.build.gradle.internal.utils.KgpUtils$addComposeArgsToKotlinCompile$1.execute(kgpUtils.kt:139)
Yuki Anzai
04/27/2021, 7:46 AMCicero
04/27/2021, 9:21 AMmzgreen
04/27/2021, 10:52 AMBox
with a border on only one side?Felipe Passos
04/27/2021, 11:01 AMArun
04/27/2021, 11:59 AMFatal Exception: java.lang.IllegalStateException
Cannot create Typeface from ResourceFont(resId=2131296258, weight=FontWeight(weight=600), style=Normal)
I’m using a custom font. This is working fine on Android 11 but crashing on Android 10. Any idea why?Colton Idle
04/27/2021, 12:57 PMbuttonList[selected]()
I thought defining an argument into my composable like this would work
buttonList: List<@Composable ColumnScope.() -> Unit>
but then sending in a listOf(CustomButton(), CustomButton2())
doesn't actually work. Thoughts?escodro
04/27/2021, 12:58 PMDisposableEffect
. I have a ModalBottomSheetLayout
with different contents based on user interaction.
My idea is to clean all the content and clear the focus when the BottomSheet is hidden.
My current implementation is:
DisposableEffect(modalSheetState.currentValue) {
onDispose {
if (modalSheetState.isVisible.not()) {
focusManager.clearFocus()
sheetContentState = SheetContentState.Empty
}
}
}
The code is working, but in all samples I see there is a code before onDispose()
, like a callback register.
Is it a correct implementation of DisposableEffect
?
Thanks a lot for your help! ❤️Justin Tullgren
04/27/2021, 2:48 PMColton Idle
04/27/2021, 2:57 PMColton Idle
04/27/2021, 3:54 PMalorma
04/27/2021, 4:26 PMMBegemot
04/27/2021, 4:59 PMDavid Edwards
04/27/2021, 5:20 PMNat Strangerweather
04/27/2021, 7:44 PMdewildte
04/27/2021, 9:16 PMallan.conda
04/28/2021, 2:41 AMnavController.popBackstack(route="authParent")
but there’s no API like that.
I can’t point to a specific route from the navigation flow because the app can navigate to Auth from different screens.Luis Daivid
04/28/2021, 6:50 AMAlexandru Hadăr
04/28/2021, 9:49 AMescodro
04/28/2021, 11:04 AMModalBottomSheetLayout
and screen orientation.
If I open the BottomSheet
in landscape and rotate the screen the app crashes with error The initial value must have an associated anchor
.
An issue tracker was already open for further investigation, but is there any workaround in the meantime?
Basically this is the only issue that is preventing me to release my app on Google Play. 😊
Thanks a lot for all your help! ❤️Nthily
04/28/2021, 12:20 PMCyril Find
04/28/2021, 12:24 PMdraggable
modifier and i'd like the touch zone to be a bit larger than its bounds but I have no idea how to do that ?Felipe Passos
04/28/2021, 1:16 PMIcon(
painter = painterResource(id = R.drawable.ic_taxi),
contentDescription = "",
Modifier
.height(200.dp)
.width(200.dp)
)
The svg have multiple colors on it but for some reason the displayed image is full blackloloof64
04/28/2021, 1:58 PMMaxUt
04/28/2021, 2:03 PMBitmapFactory.decodeFile(MY_FILE_PATH)
to convert the images into Bitmap first and then from Bitmap to ImageBitmapMaxUt
04/28/2021, 2:03 PMBitmapFactory.decodeFile(MY_FILE_PATH)
to convert the images into Bitmap first and then from Bitmap to ImageBitmapNthily
04/28/2021, 2:23 PMCoilImage(Uri.fromFile(path...), null)
MaxUt
04/28/2021, 2:25 PMAdam Powell
04/28/2021, 2:35 PMBitmap
you can use the .asImageBitmap()
extension: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#asimagebitmapMBegemot
04/28/2021, 2:35 PMBitmapFactory.decodeByteArray(localByteArray, 0, locakByteArray.size).asImageBitmap()
and yo don't need anything elseAdam Powell
04/28/2021, 2:35 PMNthily
04/28/2021, 2:36 PMMBegemot
04/28/2021, 2:36 PMAdam Powell
04/28/2021, 2:36 PMMaxUt
04/28/2021, 2:38 PMAdam Powell
04/28/2021, 2:42 PMChachako
04/28/2021, 5:25 PM.asImageBitmap()
, which is very easy. If you want to load a Bitmap and use it with Coil's or Gilde's many out-of-the-box features, you can use accompanist
, otherwise you can simply use .asImageBitmap()
, and apply it to an Image.