https://kotlinlang.org
Join Slack
IntelliJ says “Kotlin not configured”, but it is. What do?
r

ribesg

about 6 years ago
IntelliJ says “Kotlin not configured”, but it is. What do?
r
c
  • 2
  • 2
  • 328
Hi all. I am looking to make `FlowRow` with 2 equal size columns. For the child items of the row I t...
r

Ryan Casler

over 1 year ago
Hi all. I am looking to make
FlowRow
with 2 equal size columns. For the child items of the row I tried to set the widths as
fillMaxWidth(0.5f)
on some preview sizes it will make it single column. If i update it to be
fillMaxWidth(0.4999999f)
it will always be two rows with any screen size. I am just really interested on why for some screen configurations the 0.5 works but not on all. Any insight or thoughts would be appreciated. Know there are other ways just really intrigued why that does not seem to work.
r
a
  • 2
  • 8
  • 327
how to get current build type (debug/release) in compose desktop, in Android we have buildConfig to ...
a

Avadhut

over 1 year ago
how to get current build type (debug/release) in compose desktop, in Android we have buildConfig to get the same not sure how to do that on deskop?
a
z
  • 2
  • 2
  • 327
I have a screen, in which I have a Horizontal pager with 2 pages and each page has a Lazy Column Now...
v

Vaibhav Jaiswal

over 1 year ago
I have a screen, in which I have a Horizontal pager with 2 pages and each page has a Lazy Column Now If i navigate to some other screen and come back, the unselected page loses its scroll state This also happens if I minimize the app and come back, the selected pages has the scroll state, but the unselected one loses it Does anyone know how to fix this? I'm on Compose 1.5.11 and kotlin 1.9.21 Reproducer
@Composable
fun TestPager() {
    val pagerState = rememberPagerState(0){ 2 }
    HorizontalPager(
        state = pagerState,
        modifier = Modifier.fillMaxSize(),
    ){
        TestPage(it)
    }
}

@Composable
fun TestPage(index: Int) {
    val listState = rememberLazyListState()
    LazyColumn(
        state = listState,
        modifier = Modifier.fillMaxSize()
    ){
        items(40) {
            Surface(modifier = Modifier.fillMaxSize()){
                Text(text = "Row $it", modifier = Modifier.padding(16.dp))
            }
        }
    }
}
v
y
s
  • 3
  • 11
  • 327
Hello, I do not understand why I am getting `unresolved reference` and `Cannot access 'Serializable'...
k

K-dub

over 1 year ago
Hello, I do not understand why I am getting
unresolved reference
and
Cannot access 'Serializable': it is internal in '<http://kotlin.io|kotlin.io>'
when calling to
import *kotlinx.serialization.**
- I do have:
plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.androidLibrary)
    kotlin("plugin.serialization") version "1.9.23"
}
dependencies {
    implementation("androidx.core:core-ktx:+")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
}
these in my build.gradle.kts can anyone advise?
k
  • 1
  • 1
  • 327
Getting this cryptic error when trying to build with kotlin 1.8.0 and CfW 1.3.0-rc2 ```&gt; Task :co...
b

Big Chungus

almost 3 years ago
Getting this cryptic error when trying to build with kotlin 1.8.0 and CfW 1.3.0-rc2
> Task :compileKotlinJs FAILED
e: Could not find "androidx.compose.runtime:runtime" in [/home/user/.local/share/kotlin/daemon]
e: java.lang.IllegalStateException: FATAL ERROR: Could not find "androidx.compose.runtime:runtime" in [/home/user/.local/share/kotlin/daemon]
        at org.jetbrains.kotlin.ir.backend.js.KlibKt$resolverLogger$1.fatal(klib.kt:101)
Any tips?
b
h
+3
  • 5
  • 28
  • 327
I hate kotlinx serialization errors so much they sometimes give okay errors, but other times it's on...
z

zt

over 2 years ago
I hate kotlinx serialization errors so much they sometimes give okay errors, but other times it's ones that are so vague it makes it impossible to diagnose. I cannot pinpoint the exact cause of the error in my application that has multiple layers for serialization. is there anything I can try to at least narrow down the exact cause of an error?
z
o
b
  • 3
  • 6
  • 327
Hi everyone! Is there a way to reuse the continuation in `suspendCoroutine` block? ```suspendCorouti...
s

Sergio C.

over 3 years ago
Hi everyone! Is there a way to reuse the continuation in
suspendCoroutine
block?
suspendCoroutine { continuation -> }
I need to call continuation more than once but its throwing error
java.lang.IllegalStateException: Already resumed
        at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:44)
Any way to bypass this?
s
c
  • 2
  • 2
  • 327
Hi everyone, I'm trying to switch from Styled Components to Emotion but I'm wondering how to change ...
s

Sean Keane

over 3 years ago
Hi everyone, I'm trying to switch from Styled Components to Emotion but I'm wondering how to change the
StyleSheet
from Styled CSS to Emotion CSS. Example:
object Main : StyleSheet("MainStyle") {
    val headingBoldGrey by css {
            color = Colors.darkGrey
            +Font.quicksandBold
            fontSize = titleFontSizeMobile
        }
    }
}
What would be the best way to convert something like this?
s
t
+4
  • 6
  • 47
  • 327
I'm looking to make a multiplatform Uri parsing library. I see 3 options for doing so. I have a feel...
e

eygraber

over 3 years ago
I'm looking to make a multiplatform Uri parsing library. I see 3 options for doing so. I have a feeling any one of them are ok, but is one "better" than the rest? 1. Write an RFC compliant implementation from scratch (I started doing this but I realized I'd run out of time that I allocated for this project) 2. Use expect/actual and delegate to platform functionality; Android
Uri
, JS
URL
, iOS
swift-URI
, Native haven't found anything yet (all the implementations have slightly different behavior + I haven't found a simple solution for native) 3. Port an existing implementation to KMP I've started all 3 approaches, and I'm leaning towards #3, and porting Android
Uri
e
j
  • 2
  • 1
  • 327
Previous212213214Next

kotlinlang

A modern programming language that makes developers happier.

Powered by