https://kotlinlang.org
Join Slack
I am trying to display an image with jetpack compose… which is a normal PNG file inside drawable d...
r

Radoslaw Juszczyk

over 4 years ago
I am trying to display an image with jetpack compose… which is a normal PNG file inside drawable directory:
…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?
r
t
  • 2
  • 2
  • 1210
Will Apple let KMM succeed? Effectively, Multiplatform Compose and KMM will make iOS Developers, XCo...
i

Igor Bozin

over 2 years ago
Will Apple let KMM succeed? Effectively, Multiplatform Compose and KMM will make iOS Developers, XCode or Swift obsolete. So, what is in it for them? And what guarantees the Kotlin Multiplatform approach will be possible to be used for development in 2-3 years?
i
c
+8
  • 10
  • 108
  • 1208
How can I disable `HorizontalPager` scroll (via `userScrollEnabled`) when the user started a `LazyCo...
s

ste

almost 3 years ago
How can I disable
HorizontalPager
scroll (via
userScrollEnabled
) when the user started a
LazyColumn
scroll (and vice versa)? Do I need to write a complex
NestedScrollConnection
?
untitled.webm
s
c
  • 2
  • 11
  • 1208
I am having a problem building a KMM project in Android Studio with the following message " Cannot l...
o

Owen

over 1 year ago
I am having a problem building a KMM project in Android Studio with the following message " Cannot locate tasks that match 'sharedtestClasses' as task 'testClasses' not found in project ':shared'."
➕ 7
o
s
+7
  • 9
  • 15
  • 1203
How can you fill a row with two buttons: First button should take the max width, but there should be...
h

hfhbd

over 3 years ago
How can you fill a row with two buttons: First button should take the max width, but there should be another minified button.
@Composable
fun InfoButton(infoTest: String, button: @Composable (Modifier) -> Unit) {
    Row(modifier = Modifier.fillMaxWidth()) {
        Info(infoTest)
        button(Modifier.fillMaxWidth())
    }
}
This code renders the icon at the left side, I want to show them on the right side
h
p
c
  • 3
  • 9
  • 1203
Are there plans from JetBrains for a multiplatform crypto library? Iirc it was one of the most upvot...
b

benkuly

about 3 years ago
Are there plans from JetBrains for a multiplatform crypto library? Iirc it was one of the most upvoted features here in slack, when someone from JetBrains asked for missing features.
👍 1
➕ 1
b
o
z
  • 3
  • 10
  • 1202
How to get AndroidView factory to run again on recompose? I have a composable helper we use to creat...
a

Andy Himberger

over 3 years ago
How to get AndroidView factory to run again on recompose? I have a composable helper we use to create some of our legacy views, and even on recompose or changing the factory function instance, the factory doesn't create a new item -- this is the one workaround I've found that works but looking for a proper way to do it -- (component is an enum value passed into the function, I have tried different factory function implementations)
ReusableContent(component) {
    AndroidView(factory = {
        createView(it, component)
    }, Modifier.fillMaxSize(), { })
}
I tried some other things like recomposer.invalidate when the component changed, creating different factory function instances that differed slightly, but that didn't change anything... I was really expecting when the args to AndroidView changed, it would create a new view underneath and clean up the old one. Maybe I'm missing something
a
a
+2
  • 4
  • 11
  • 1202
HorizontalPager continues the fling from horizontal LazyRow. This is apparently Expected behavior bu...
m

Michal Klimczak

about 4 years ago
HorizontalPager continues the fling from horizontal LazyRow. This is apparently Expected behavior but it differs from traditional android views and also feels really bad. Anyone knows how to work around it? Relevant github issue: https://github.com/google/accompanist/issues/347#event-4607690257
m
c
+4
  • 6
  • 28
  • 1200
Anyone knows how to create gradle JavaExec configuration for multiplatform project? ```tasks.create&...
t

Tomasz Krakowiak

over 3 years ago
Anyone knows how to create gradle JavaExec configuration for multiplatform project?
tasks.create<JavaExec>("run") {
    classpath = //?
    mainClass.set("com.example.MainKt")
}
sourceSets
container is at this point empty.
configurations
container does not have
jvmMainRuntime
configuration.
t
h
e
  • 3
  • 3
  • 1199
How can I avoid recomposition of certain areas of a screen? In my example I use an AndroidView (to s...
t

Tobias Gronbach

over 3 years ago
How can I avoid recomposition of certain areas of a screen? In my example I use an AndroidView (to show diagrams) and also I display some Dialogs depending on the ScreenState. Everytime a dialog is shown or hidden the AndroidView gets recomposed. How can I avoid it? Is it possible to scope recomposition only to specific states?
t
m
r
  • 3
  • 35
  • 1198
Previous252627Next

kotlinlang

A modern programming language that makes developers happier.

Powered by