https://kotlinlang.org
Join Slack
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
  • 1505
I added `@AndroidEntryPoint` to a broadcast receiver, and I seem to be getting the error I posted in...
d

dave08

almost 2 years ago
I added
@AndroidEntryPoint
to a broadcast receiver, and I seem to be getting the error I posted in the thread, I tried looking around in Google, but to no avail... is this a known issue? Is there a workaround?
d
s
i
  • 3
  • 7
  • 1498
I was just updating a project of mine and am now getting this error: `e: androidx.compose.compiler....
t

Tom Truyen

about 1 year ago
I was just updating a project of mine and am now getting this error:
e: androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found. The compose compiler plugin you are using (version 1.5.14) expects a minimum runtime version of 1.0.0.
I don't understand why this is happening since I have updated projects before without a problem. I am attempting to upgrade to Kotlin 2.0.20. I have applied the
org.jetbrains.kotlin.plugin.compose
to my project build.gradle and to my modules via convention plugins
libs.versions.toml
✅ 1
t
m
b
  • 3
  • 31
  • 1496
Is it possible to tell kotlinx serialization not to escape a particular string? So if I have a class...
v

v79

over 2 years ago
Is it possible to tell kotlinx serialization not to escape a particular string? So if I have a class:
@Serializable
data class ContainsJsonString(val name: String, val jsonString: String)
Is there some annotation which will let me tell kotlinx not to escape or otherwise mess about with the
jsonString
property? I don't need to worry about deserialization, only interested in writing the class `ConstainsJsonString`to a json file. Output would be something like:
{ "name" : "Liam",
  "jsonString": { "address" : "1 Acacia Avenue", "favouriteColour": "blue" }
}
Right now I'm getting something like:
{ "name": "Liam",
  "jsonString": "{ \\\"address\\\" : \\\"1 Acacia Avenue\\\":\\\"favouriteColour\\\":\\\"blue\\\"}" }
(Posted in this the wrong channel earlier, sorry!)
v
a
s
  • 3
  • 30
  • 1494
How to correctly store a list in a mutablestate remember variable? I tried with `val imagesList by r...
p

Pablo

over 1 year ago
How to correctly store a list in a mutablestate remember variable? I tried with
val imagesList by remember *{* _mutableStateListOf_<ImageModel>()*}*
but it gives this error
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
If I replace
by remember
with
= remember
the error dissapears and I dont understand why. Also, the guides says
by remember
is the correct option so I whould like to understand how to be able to use
by remember
with this list. Another problem I found is that even using
=
instead of
by
, I'm not able to init the variable with a list.
remember *{* _mutableStateListOf_<ImageModel>(ImageModelProvider.imageModelList)*}*
gives this error:
Type mismatch. Required: ImageModel Found:List<ImageModel>
p
e
z
  • 3
  • 8
  • 1482
I convinced ChatGPT from OpenAI to write me Kotlin code that uses a Ktor client to pull down the "<h...
y

Youssef Shoaib [MOD]

almost 3 years ago
I convinced ChatGPT from OpenAI to write me Kotlin code that uses a Ktor client to pull down the "https://kotlinlang.org/docs/whatsnew14.html" and asked it for an example of what the code would output (I have to be very wordy with it or else it gets angry and reminds me that it can't run code lol). Eventually, I made it "send a request" to "https://kotlinlang.org/docs/whatsnew19.html", but that produced the same output, just with Kotlin 1.9 as the version number. Finally, I convinced it that Kotlin 1.9 actually includes Union Types (🙏 ) and made it go to the
<h2>
tag that talks about Union types, and print out it and its siblings, and this is what it produced: See 🧵 for some other interesting observations about it, including Kotlin-specific ones, if anyone is curious
y
v
  • 2
  • 10
  • 1482
How can I create a Full Screen dialog? Dialog properties throw an error. Does anyone know of a diffe...
t

Tolga ÇAĞLAYAN

almost 3 years ago
How can I create a Full Screen dialog? Dialog properties throw an error. Does anyone know of a different method?
t
z
  • 2
  • 5
  • 1472
When working with SQLDelight migrations, I have set up migration to execute using the following code...
h

Håkon Pettersen

over 2 years ago
When working with SQLDelight migrations, I have set up migration to execute using the following code:
Database.Schema.migrate(
    driver = driver,
    oldVersion = 0,
    newVersion = Database.Schema.version,
)
I assume that this won't work if the user is currently on version 2, and I am trying to migrate to version 3. I assume that I have to check which version of the database the user is currently on and only execute migration if it is lower than the latest version. If that's the case, how can I check the current database-verison that the user is on? (Also, If this is the wrong way to handle migrations, please elaborate).
h
m
+2
  • 4
  • 13
  • 1466
How can I create LazyColumn in LazyColumn? I get ```java.lang.IllegalStateException: Vertically scro...
c

chanjungskim

over 2 years ago
How can I create LazyColumn in LazyColumn? I get
java.lang.IllegalStateException: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.
error
c
k
+2
  • 4
  • 16
  • 1461
How do I create a zip file in memory only, using files from a relative directory?
m

martmists

about 7 years ago
How do I create a zip file in memory only, using files from a relative directory?
m
g
  • 2
  • 1
  • 1460
Previous181920Next

kotlinlang

A modern programming language that makes developers happier.

Powered by