https://kotlinlang.org
Join Slack
Hey folks, is there a concept of viewModel in compose desktop?
e

Emmanuel

about 3 years ago
Hey folks, is there a concept of viewModel in compose desktop?
e
b
+4
  • 6
  • 8
  • 2873
Is it possible to make the parser ignore some field when encoding them? I would like a class like th...
j

jeggy

over 2 years ago
Is it possible to make the parser ignore some field when encoding them? I would like a class like this:
data class MyDataClass(@IgnoreThisKey val privateKey: String, val value: String)
And when serializing any data(not only
MyDataClass
) and there's a property with
IgnoreThisKey
annotation, it should not be included.
j
d
a
  • 3
  • 16
  • 2811
Hi Everyone, why i`m facing this error @Composable invocations can only happen from the context of a...
a

Asad Mukhtar

almost 3 years ago
Hi Everyone, why i`m facing this error @Composable invocations can only happen from the context of a @Composable function at stringResource(R.string.dont_have_an_account) line?
derivedStateOf {
    buildAnnotatedString {
        withStyle(
            style = SpanStyle(
                color = PrimaryTextColor,
                fontSize = TextUnit(12f, TextUnitType.Sp),
                fontFamily = FontFamily(listOf(Font(R.font.poppins_regular)))
            )
        ) {
            append(stringResource(R.string.dont_have_an_account))
        }
        withStyle(
            style = SpanStyle(
                color = BlueColor,
                fontSize = TextUnit(12f, TextUnitType.Sp),
                fontFamily = FontFamily(listOf(Font(R.font.poppins_semibold)))
            )
        ) {
            append("  Create Here")
        }
    }
}
a
f
o
  • 3
  • 7
  • 2806
I am trying to run iosApp of KMM project in Xcode, but i am getting error `Command PhaseScriptExecu...
j

Jitendra

over 1 year ago
I am trying to run iosApp of KMM project in Xcode, but i am getting error
Command PhaseScriptExecution failed with a nonzero exit code
here is the log
export variant\=normal
/bin/sh -c /Users/jitendraprajapati/Library/Developer/Xcode/DerivedData/iosApp-ftrrlcszyheexqhbvoqhhryktogx/Build/Intermediates.noindex/Previews/iosApp/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh
The operation couldn't be completed. Unable to locate a Java Runtime.
Please visit <http://www.java.com> for information on installing Java.
Command PhaseScriptExecution failed with a nonzero exit code
I have java installed, and app is running well from androidStudio, I tried solution mentioned in this link. but no success .
j
k
t
  • 3
  • 22
  • 2728
Hello, how can I apply a shadow with a bottom elevation only? Seems `shadow` function applies elevat...
n

nuhkoca

about 3 years ago
Hello, how can I apply a shadow with a bottom elevation only? Seems
shadow
function applies elevation for all edges
✅ 1
n
k
o
  • 3
  • 11
  • 2650
did someone try to use Mockk on KMM project?
e

egor

over 2 years ago
did someone try to use Mockk on KMM project?
e
h
+3
  • 5
  • 12
  • 2648
is there a way to declare global variables in a build.gradle.kts? Trying to do something like this ...
j

janvladimirmostert

about 5 years ago
is there a way to declare global variables in a build.gradle.kts? Trying to do something like this
val kotlinVersion: String = "1.4-M2"
// fun Project.kotlinVersion(): String = "1.4-M2"

plugins {
   kotlin("multiplatform").version(kotlinVersion)
this doesn't show any red lines in the IDE, but neither does it compile, i doesn't know what Version is
object Version {
    const val kotlin = "1.4-M2"
}

plugins {
    kotlin("multiplatform").version(Version.kotlin)
j
d
c
  • 3
  • 4
  • 2638
Hey All, I am trying to configure my build system to allow me to generate older JVM compatible binar...
r

Ryan King

about 1 year ago
Hey All, I am trying to configure my build system to allow me to generate older JVM compatible binaries with newer JDK releases but am hitting a few snags. I've included details in the thread.
r
c
m
  • 3
  • 8
  • 2612
is it possible to draw border on the outside of the composable, rather than on the inside? I have a...
p

Peter

almost 2 years ago
is it possible to draw border on the outside of the composable, rather than on the inside? I have an use case, when border might be visible or not. And I would like to better align it, without making component jump.
@Preview
@Composable
fun Preview() {
    var isBorderVisible = false
    Box(modifier = Modifier
        .background(Color.White)
        .size(80.dp)
        .let {
            if (isBorderVisible) {
                it.border(color = Color.Magenta, width = 20.dp)
            } else {
                it
            }
        }
    )
}
p
j
+3
  • 5
  • 34
  • 2594
Does `AnimatedVisibility` have a finished listener? I know it has `MutableTransitionState` where yo...
c

Chris Johnson

about 4 years ago
Does
AnimatedVisibility
have a finished listener? I know it has
MutableTransitionState
where you can check if all the animations are done via
isIdle
but I guess I'm looking for an example of when to use that check. I assume it wouldn't be inside the
AnimatedVisibility
content composable and outside of it would make it get hit on every recomposition if I'm remembering the
MutableTransitionState
c
a
d
  • 3
  • 3
  • 2590
Previous456Next

kotlinlang

A modern programming language that makes developers happier.

Powered by