https://kotlinlang.org
Join Slack
I'm trying to update to kotlin 2.0 but our project has -Werror enabled and so we get: ```w: Kapt cu...
z

zsperske

over 1 year ago
I'm trying to update to kotlin 2.0 but our project has -Werror enabled and so we get:
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.
e: warnings found and -Werror specified
Is there any way around this?
z
d
  • 2
  • 2
  • 1547
Is there any chart library available for compose multiplatform?
j

jamshedalamqaderi

almost 2 years ago
Is there any chart library available for compose multiplatform?
j
p
m
  • 3
  • 5
  • 1547
easiest way to cast a mutable list into a list?
m

mgrazianodecastro

over 2 years ago
easiest way to cast a mutable list into a list?
m
h
+4
  • 6
  • 19
  • 1540
Hello everyone, I want to achieve sticky footer using jetpack compose like in screenshot. A is scrol...
p

Pardip

over 3 years ago
Hello everyone, I want to achieve sticky footer using jetpack compose like in screenshot. A is scrollable list of row items. When A is smaller than screen(or parent) size, B (footer) should be placed bellow the last row. When A+B are bigger than screen size, then B becomes fixed at the bottom and A content is scrollable. I’m wondering if there is easy way to achieve this, using compose ConstraintLayout.
p
t
  • 2
  • 1
  • 1537
``` Module was compiled with an incompatible version of Kotlin. The binary version of its metadata i...
s

Sam Si

almost 3 years ago
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1.
I am getting this issue and trying to figure out if anyone knows the solution for it.
✅ 1
s
m
  • 2
  • 3
  • 1534
Using the new `BasicTextField2` API, when listening to its changes through its `textAsFlow()`, is th...
s

sindrenm

over 1 year ago
Using the new
BasicTextField2
API, when listening to its changes through its
textAsFlow()
, is there a way to know if a text was added programmatically through
edit {}
vs. manually from a user? I'm thinking something like this, but due to the asynchronous nature of it all, that doesn't quite cut it:
val textFieldState = TextFieldState("")
var isSettingProgrammatically = false

launch {
  textFieldState.textAsFlow()
    .dropWhile { isSettingProgrammatically }
    .collect { println("change: $it") }
}

launch {
  delay(2.seconds)

  isSettingProgrammatically = true
  textFieldState.edit { replace(0, length, "value" }
  isSettingProgrammatically = false
}
where the
"value"
from the second
launch
should not be printed from the text flow collection.
s
s
+2
  • 4
  • 45
  • 1526
Hi, I'm running into this error when trying to use `async` ```Unresolved reference. None of the foll...
d

Daniel

almost 5 years ago
Hi, I'm running into this error when trying to use
async
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun <T> CoroutineScope.async(context: CoroutineContext = ..., start: CoroutineStart = ..., block: suspend CoroutineScope.() → TypeVariable(T)): Deferred<TypeVariable(T)> defined in kotlinx.coroutines
I'm not sure how much I can pare down my example, because it seems pretty specific to what I'm trying to do. Here's essentially the function
suspend fun getTile(params: SomeType): GetTileResponse {
        val cached = tileCache.get(params)
        if (cached != null) {
            return GetTileResponse.Available(cached)
        }

        val request = GetTileRequest(params)

        val deferred = async {
            makeRemoteRequest()
            .map { convertIntoResponse(it) }
        }

        return GetTileResponse.Loading(deferred)
    }
If I ask kotlin to generate an implementation of async, I get something which seems to look very similar to the definition of async (https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/async.html)
private fun async(block: suspend CoroutineScope.() -> Either<GetTileError, Bitmap>): Deferred<Either<GetTileError, Bitmap>> {
        TODO("Not yet implemented")
    }
d
a
  • 2
  • 14
  • 1521
Hi guys i upgraded to Xcode 15, and i am having issue building the shared module, here is the error ...
b

brabo-hi

about 2 years ago
Hi guys i upgraded to Xcode 15, and i am having issue building the shared module, here is the error
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
    
    kotlin.native.cacheKind.iosArm64=none
    
Also, consider filing an issue with full Gradle log here: <https://kotl.in/issue>
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
-iphoneos_version_min has been renamed to -ios_version_min
ld: warning: ignoring duplicate library '-ldl'
ld: unknown options: -sdk_version
b
a
  • 2
  • 1
  • 1520
Is this the idiomatic way to do debounce for a text field? I suck with flows and just want to make s...
c

Colton Idle

almost 3 years ago
Is this the idiomatic way to do debounce for a text field? I suck with flows and just want to make sure I'm not shooting myself in the foot.
class VM : ViewModel() {
    val text = MutableStateFlow("")
    val dbText = text.debounce(2000).distinctUntilChanged().flatMapLatest { (it) }

    private fun queryFromDb(query: String): Flow<String> {
        ...
    }
}
c
c
+3
  • 5
  • 38
  • 1514
is there something like `clipToPadding = false` in Compose that avoids a LazyRow getting cut off by ...
f

Florian

about 4 years ago
is there something like
clipToPadding = false
in Compose that avoids a LazyRow getting cut off by the container's padding?
f
s
c
  • 3
  • 5
  • 1513
Previous171819Next

kotlinlang

A modern programming language that makes developers happier.

Powered by