https://kotlinlang.org
Join Slack
Is there a better way to check a string contains both number and alphabet? ```val text = "aas211w" i...
s

Simon Lin

about 4 years ago
Is there a better way to check a string contains both number and alphabet?
val text = "aas211w"
if (text.any { it.isDigit() } && text.any { it.isLetter() }) {
}
s
e
+4
  • 6
  • 10
  • 360
How do you display an image in compose? ```Image( painter = painterResource(id = R.drawable.logo...
p

Pablo Carbajal

over 4 years ago
How do you display an image in compose?
Image(
    painter = painterResource(id = R.drawable.logo),
    contentDescription = null
)
I saw that in the docs, but it does not work. Do assets usually go in /res/drawable ? I saw another google guide saying to make a new folder called "assets"
p
z
p
  • 3
  • 3
  • 359
I have a question about Intellij...what does the little blue square next to the folder represent? P...
n

Nat Elkins

almost 5 years ago
I have a question about Intellij...what does the little blue square next to the folder represent? Project? Module? Library?
n
m
  • 2
  • 5
  • 359
Getting `Duplicate JVM class name` on MPP project with `common` and `JVM` sourceSets dectaring `expe...
b

Big Chungus

almost 6 years ago
Getting
Duplicate JVM class name
on MPP project with
common
and
JVM
sourceSets dectaring
expect/actual
fun some(a:Int, b:Any)
. Any suggestions?
b
d
d
  • 3
  • 5
  • 359
Cannot change attributes of configuration ':composeApp:debugFrameworkIosX64' after it has been locke...
r

R Suman Radhakrishnan

over 1 year ago
Cannot change attributes of configuration 'composeAppdebugFrameworkIosX64' after it has been locked for mutation While implementing room in compose multiplaform above error occurs?.
r
a
  • 2
  • 3
  • 358
Why does kotlin style guide require screaming snake case for const vals? Is there any hope that this...
s

stantronic

over 2 years ago
Why does kotlin style guide require screaming snake case for const vals? Is there any hope that this might be relaxed to allow PascalCase? (more readable and makes me feel less like I’m being shouted at)
➕ 19
s
j
+9
  • 11
  • 22
  • 358
Has anyone else seen significant performance regression with K2? I’m seeing the following from build...
y

Yang

over 1 year ago
Has anyone else seen significant performance regression with K2? I’m seeing the following from build scans comparing 1.9.23 with Beta5 for our Android project: •
KotlinCompile
totalling
30m 17.942s
->
46m 7.145s
•
KaptGenerateStubsTask
totalling
8m 32.377s
->
23m 35.496s
•
KaptWithoutKotlincTask
totalling
9m 56.293s
->
11m 14.002s
•
KspTaskJvm
totalling
6m 19.561s
->
22m 56.832s
Looking at the individual modules / tasks the ones that are significant slower with K2 seem quite random. E.g. while some bigger module are 40% faster with K2, many tiny modules’ KotlinCompile tasks are order of magnitude slower with K2 e.g.
0.5s
>
33s
. I’ll dig a bit more and create an issue on youtrack.
y
t
+3
  • 5
  • 54
  • 358
Hey guys, is there paging artifact adaptation from Androidx by Jetbrains? I can't seem to find it
h

Hristijan

over 1 year ago
Hey guys, is there paging artifact adaptation from Androidx by Jetbrains? I can't seem to find it
h
m
j
  • 3
  • 5
  • 358
Hi, I’m trying to accumulate some validation errors with `zipOrAccumulate`. Something like this: `...
b

Bas de Groot

over 2 years ago
Hi, I’m trying to accumulate some validation errors with
zipOrAccumulate
. Something like this:
object MyError

fun example(input1: String, input2: String, input3: String): Either<NonEmptyList<MyError>, String> = either {
    zipOrAccumulate(
        { ensure(input1.isNotBlank()) { MyError } },
        { ensure(input2.isNotBlank()) { MyError } },
        { ensure(input3.isNotBlank()) { MyError } }
    ) { _, _, _ ->
        TODO()
    }
}
Everything was smooth sailing until I encountered a model for which I need to do more than 9 validations. I found this post on Stackoverflow, which describes the same issue for the deprecated
zip
function: https://stackoverflow.com/questions/72782045/arrow-validation-more-then-10-fields/72782420#72782420 I’m not sure how to apply this to
zipOrAccumulate
. Any hints on how to handle this would be greatly appreciated! 😊
👍 1
b
y
+3
  • 5
  • 7
  • 358
Is there a preferred way of doing a "color picker" for compose multiplatform?
r

Ryan Smith

almost 3 years ago
Is there a preferred way of doing a "color picker" for compose multiplatform?
r
e
r
  • 3
  • 2
  • 358
Previous191192193Next

kotlinlang

A modern programming language that makes developers happier.

Powered by