https://kotlinlang.org
Join Slack
is it possible to draw border on the outside of the composable, rather than on the inside? I have a...
p

Peter

about 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
  • 3052
Hey All, I am trying to configure my build system to allow me to generate older JVM compatible binar...
r

Ryan King

over 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
  • 3029
Do IDE previews work in a compose multiplatform setup? I’m not having much luck with previews define...
a

aidanvii

over 2 years ago
Do IDE previews work in a compose multiplatform setup? I’m not having much luck with previews defined in shared/…/androidMain, or even the top level android module itself. The preview pane split icon just doesn’t show. Not sure if it’s a bug or if I’m doing something wrong 🤷
a
d
s
  • 3
  • 10
  • 2981
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
  • 2929
I’m playing around with Compose Multiplatform, using the template from <here> Sometimes when I buil...
j

jordond

over 2 years ago
I’m playing around with Compose Multiplatform, using the template from here Sometimes when I build I get this error:
Cannot locate tasks that match ':shared:testClasses' as task 'testClasses' not found in project ':shared'.
I can fix it by running a Gradle Sync and then building again, but it’s kind of annoying. Any idea how to fix it?
j
e
  • 2
  • 1
  • 2913
Hey folks, is there a concept of viewModel in compose desktop?
e

Emmanuel

over 3 years ago
Hey folks, is there a concept of viewModel in compose desktop?
e
b
+4
  • 6
  • 8
  • 2895
Hi Everyone, why i`m facing this error @Composable invocations can only happen from the context of a...
a

Asad Mukhtar

about 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
  • 2862
Does `AnimatedVisibility` have a finished listener? I know it has `MutableTransitionState` where yo...
c

Chris Johnson

over 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
  • 2799
Hello, how can I apply a shadow with a bottom elevation only? Seems `shadow` function applies elevat...
n

nuhkoca

over 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
  • 2724
is there a way to declare global variables in a build.gradle.kts? Trying to do something like this ...
j

janvladimirmostert

over 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
  • 2720
Previous456Next

kotlinlang

A modern programming language that makes developers happier.

Powered by