https://kotlinlang.org
Join Slack
Can we do a conditional chain in Kotlin? or ignore it and go to the next operator? ```private fun s...
z

zain

almost 4 years ago
Can we do a conditional chain in Kotlin? or ignore it and go to the next operator?
private fun simulateFixtures(list: List<List<Team>>) = list.map { fixture ->
    fixture.toList().random()
}.shuffled().chunked(2)
z
s
+4
  • 6
  • 15
  • 376
Hi everyone, I want to create Color class that cover both Android and iOS like this ```expect class ...
b

bill

over 2 years ago
Hi everyone, I want to create Color class that cover both Android and iOS like this
expect class Color

// androidMain
actual typealias Color = androidx.compose.ui.graphics.Color

// iosMain
actual typealias Color = platform.UIKit.UIColor
but it fail because UIColor and compose Color has different constructor. Can we have a workaround in this case?
b
o
  • 2
  • 1
  • 376
Hello people, is there a way to have special characters, in tests, in a KMP module with an Android v...
d

Davide Giuseppe Farella

almost 3 years ago
Hello people, is there a way to have special characters, in tests, in a KMP module with an Android variant? I have a module with various Unit Tests with backticks names ``like this`` , and after adding
android()
variant, I cannot build because of
com.android.tools.r8.internal.Jc: Space characters in SimpleName ‘handles ConnectException’ are not allowed prior to DEX version 040
This seems a bit awkward as Jvm Android modules can contain tests with backticks ( except instrumented tests ) Is there a solution/workaround? I could disable test
androidTest
if that would solve it ( how? ) as 99% of the code in the main source set
d
j
  • 2
  • 3
  • 376
I have a launched effect that doesn't seem to trigger a nav event like 0.1% of the time during app s...
c

Colton Idle

over 3 years ago
I have a launched effect that doesn't seem to trigger a nav event like 0.1% of the time during app startup. My thought is that it's just some race condition, but if anyone is familiar with compose-nav and launchedEffects wants to take a look at my scenario I'd appreciate it. Short sample code in thread
c
a
+2
  • 4
  • 21
  • 376
Hello, how to use material symbols with compose
b

brabo-hi

over 3 years ago
Hello, how to use material symbols with compose
b
r
t
  • 3
  • 4
  • 376
Is there anyway to reuse the same TCP connection for multiple http requests in Ktor client? I'm usin...
v

Venkat

about 2 years ago
Is there anyway to reuse the same TCP connection for multiple http requests in Ktor client? I'm using the CIO engine.
v
e
+2
  • 4
  • 18
  • 375
I update koin android from 3.3.3 to 3.5.0 and got a compilation error related to dexing. Anyone got ...
g

Giang

about 2 years ago
I update koin android from 3.3.3 to 3.5.0 and got a compilation error related to dexing. Anyone got the same issue? The full stacktrace can be found in the attached file
* What went wrong:
Execution failed for task ':main:mergeExtDexDevelopmentDebug'.
> Could not resolve all files for configuration ':main:developmentDebugRuntimeClasspath'.
   > Failed to transform koin-core-jvm-3.5.0.jar (io.insert-koin:koin-core-jvm:3.5.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingNoClasspathTransform: /Users/giangpham/.gradle/caches/modules-2/files-2.1/io.insert-koin/koin-core-jvm/3.5.0/1a9d0112ee949346edb5cbff25d31385be9e940a/koin-core-jvm-3.5.0.jar.
         > Error while dexing.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
stacktrace.txt.rtf
g
a
a
  • 3
  • 34
  • 375
Is there a multiplatform compose `Dialog` available ?
r

Raphael TEYSSANDIER

over 2 years ago
Is there a multiplatform compose
Dialog
available ?
r
j
  • 2
  • 1
  • 375
Is there a way to ignore certain errors in Kotlin Script Gradle? I'm not sure if it's new in Gradle...
s

spierce7

over 2 years ago
Is there a way to ignore certain errors in Kotlin Script Gradle? I'm not sure if it's new in Gradle 8.x but we're seeing tons of
Variable 'commonMain' is never used
in our Kotlin multiplatform modules:
sourceSets {
        val commonMain by getting {
            dependencies {
            }
        }
It'd be nice if there was a way to ignore this error or turn it off for the whole project.
s
e
+2
  • 4
  • 5
  • 375
Hello. Is there any way of profiling compose desktop application ATM? I understand that the layout ...
l

Lubos

over 2 years ago
Hello. Is there any way of profiling compose desktop application ATM? I understand that the layout inspector and similar tools are somehow down at the todo list. Is there any other way to check for unwanted recompositions? Some extended logging maybe?
l
e
  • 2
  • 1
  • 375
Previous181182183Next

kotlinlang

A modern programming language that makes developers happier.

Powered by