https://kotlinlang.org
Join Slack
Is Amper meant to replace Gradle completely in the long term?
h

henrik

over 1 year ago
Is Amper meant to replace Gradle completely in the long term?
🚫 0
h
e
+4
  • 6
  • 12
  • 639
Hi! I’m using coil to load images in compose and I need to send as a query-param with the width of t...
i

iroyo

almost 3 years ago
Hi! I’m using coil to load images in compose and I need to send as a query-param with the width of the composable. Right now the only way I’ve found is using
onGloballyPositioned
on the
Image
modifier to get the size and then set a global variable of an Interceptor.. What I have is something like:
Image(
    painter = painter,
    modifier = modifier.onGloballyPositioned {
        coilInterceptor.config.params[PARAM_WIDTH] = it.size.width.toString() 
    },
coilInterceptor is a singleton Interceptor…. I’m trying to avoid this. I much rather prefer passing to the
ImageRequest
directly the url with the size concatenated
i
z
a
  • 3
  • 7
  • 639
How can I run a task BEFORE Kotlin compiles the source classes? I'm generating classes based on `.y...
m

MrPowerGamerBR

over 3 years ago
How can I run a task BEFORE Kotlin compiles the source classes? I'm generating classes based on
.yml
files for localization files, if there is a key
commands.hello: "Hello {user}!"
, a class + function is generated named
I18nKeysData.Commands.Hello(name: Any)
Currently what I'm doing is this
// HACKY WORKAROUND!!!
            // This makes the generateI18nKeys task to always be ran before the compileKotlin step
            // We need to do this (instead of using withType) because, for some reason, it doesn't work and the task isn't executed.
            //
            // We need to keep it within the "afterEvaluate" block because, if it isn't, the compile*InsertStuffHere* tasks won't exist!
            // <https://stackoverflow.com/a/58763804/7271796>
            project.afterEvaluate {
                project.tasks.filter { it.name.startsWith("compileKotlin") }.forEach {
                    it.dependsOn(task)
                }
            }
But I think it is very hacky and it broke in Kotlin 1.6.20-M1 because they added a new
compileCommonMainKotlinMetadata
task, so I wonder if there is a better solution for this
m
m
v
  • 3
  • 15
  • 639
How do I change the name of a multiplatform app with an iOS target? Updating the Xcode-&gt;Target-&...
j

jQrgen

almost 2 years ago
How do I change the name of a multiplatform app with an iOS target? Updating the Xcode->Target->General->ā€œDisplay Nameā€ as per normal does not help
j
p
j
  • 3
  • 9
  • 638
I'm getting a `none of the following candidates is applicable because of receiver type mismatch` for...
j

Justin Xu

over 2 years ago
I'm getting a
none of the following candidates is applicable because of receiver type mismatch
for
ComponentActivity.viewmodels
and
ComponentActivity.setContent
, even though I am invoking these inside an Activity that extends
AppCompatActivity
, and should have access to
ComponentActivity
. My code is able to run fine even though these errors pop up in the file. Any way to get rid of this incorrect error?
j
i
+2
  • 4
  • 6
  • 638
Is there any way to use ktor as backend and vue as frontend? I foiund the singlePageApplication but ...
m

martmists

about 3 years ago
Is there any way to use ktor as backend and vue as frontend? I foiund the singlePageApplication but it didn't seem to take a route argument, and it also seemed to require compiled files rather than being able to reload quickly.
m
a
+2
  • 4
  • 29
  • 638
It seems like GraalVM works on compose desktop, but the gradle plugin doesn't work with the multipla...
c

Caleb Kiage

over 1 year ago
It seems like GraalVM works on compose desktop, but the gradle plugin doesn't work with the multiplatform plugin so all the configuration has to be done manually 🄲
c
r
+2
  • 4
  • 11
  • 637
I don't understand how you're supposed to see @Preview output in Fleet. I have the right dependency,...
r

ribesg

over 1 year ago
I don't understand how you're supposed to see @Preview output in Fleet. I have the right dependency, the right annotation on a @Composable with no parameters. I found "Open Compose Preview Output" and "Reload Compose Preview" actions but it does nothing
āž• 2
r
r
+4
  • 6
  • 30
  • 636
Can somebody help me understand why I'm getting "kotlinx.coroutines.JobCancellationException: Parent...
t

Trey

over 3 years ago
Can somebody help me understand why I'm getting "kotlinx.coroutines.JobCancellationException: Parent job is Completed" when I try to start my web service in my view model? I'm trying to delay the connection until after I have an auth token so that the connect will be successful.
Untitled.txt
t
a
j
  • 3
  • 16
  • 634
Is it possible to split `build.gradle.kts` file, so I could have the whole project configuration in ...
r

Robert Jaros

almost 6 years ago
Is it possible to split
build.gradle.kts
file, so I could have the whole project configuration in one file and dependencies listed in the second?
r
m
+3
  • 5
  • 6
  • 634
Previous939495Next

kotlinlang

A modern programming language that makes developers happier.

Powered by