https://kotlinlang.org
Join Slack
Hi Everyone. Does KMP currently support previewing in Android Studio? I created a function with @Pre...
z

Zhang Zihan

over 1 year ago
Hi Everyone. Does KMP currently support previewing in Android Studio? I created a function with @Preview annotation, but the preview does not appear on the right side of the IDE. Do I need additional configuration?
z
p
m
  • 3
  • 3
  • 388
Hi! Has anyone made a blur semi-transparent background? I try to mimc MacOS tray apps and the standa...
y

Yevhenii Nadtochii

almost 2 years ago
Hi! Has anyone made a blur semi-transparent background? I try to mimc MacOS tray apps and the standard dialogs from the tray. They have a transparent background with blur effect. 1. I’ve found this thread, which references a good article on how to do that with Skia. But it looks like too much of ceremony. 2. I have also found how to make it with
Modifier.blur()
, which is also not trivial. Maybe something has changed and now it can be done simpler?
y
a
+3
  • 5
  • 15
  • 388
Hello! Anyone can help me on setting a rule so that the parameters of with(param){} isn't move to a ...
l

Luís Alves

over 2 years ago
Hello! Anyone can help me on setting a rule so that the parameters of with(param){} isn't move to a new line when running ktlintFormat?
//this:
with(param) {
} 

// instead of this:
with(
    param) {
}
l
s
+2
  • 4
  • 26
  • 388
I want to create convention plugins to simplify my build. However, I have projects that use either `...
c

CLOVIS

over 2 years ago
I want to create convention plugins to simplify my build. However, I have projects that use either
kotlin("jvm")
,
kotlin("js")
or
kotlin("multiplatform")
. Is it possible to create a convention plugin that configures all of them? I don't want to create one plugin per Kotlin plugin…
c
m
+2
  • 4
  • 39
  • 388
I have a question regarding Previews in Jetpack Compose: if i use the locale parameter within the Pr...
r

Rene Win

over 2 years ago
I have a question regarding Previews in Jetpack Compose: if i use the locale parameter within the Preview annotation like this:
@Preview(locale = "en")
then i assume that some code (in this example
Locale.getDefault()
) would also return this locale. but it doesnt matter what i put in their, the Locale.getDefault() always returns the (i assume) system language full preview code for completeness:
@Preview(locale = "en")
@Composable
fun Test() {
    Text("${Locale.getDefault()}")
}
The reason behind this is that we use the previews for screenshot testing and we have a datetimeformatter which depends on the current locale.. (which is calling Locale.getDefault() in the background)
r
s
+2
  • 4
  • 14
  • 388
Hey people, have a question about sealed interfaces and stability/skippability :thread:
m

Maciej S

almost 3 years ago
Hey people, have a question about sealed interfaces and stability/skippability 🧵
m
z
l
  • 3
  • 9
  • 388
For someone want to implement custom title bar in compose desktop: 1. the <https://github.com/JetBra...
h

HIGAN

almost 3 years ago
For someone want to implement custom title bar in compose desktop: 1. the JetBrains/JetBrainsRuntime is required 2. Access
java.awt.Window$CustomWindowDecoration
by reflection, maybe you need
Unsafe
to access it in
JBR-17
There are some sample codes for it: 1. CustomWindowDecorationAccessing 2. UnsafeAccessing 3. JBWindow and MainToolBar in different platform 4. About JetBrainsRuntime 5. Screenshots
h
a
  • 2
  • 1
  • 388
when using sealed classes for the viewstate in android, how do you handle updating part of the views...
v

Vincent Williams

over 5 years ago
when using sealed classes for the viewstate in android, how do you handle updating part of the viewstate? For example:
sealed class ViewState {
    object Idle : ViewState()
    data class Content(
        val headerText: String,
        val bodyText: String
    ) : ViewState()
    data class Error(
        val message: String
    ) : ViewState
}
How do I update just the title for example? I see a lot of examples use sealed classes but they dont seem so great in practice...
v
s
+4
  • 6
  • 11
  • 388
I am trying to add `clickable` modifier in the `BasicTestField` (with decoration used). but it is no...
a

Atul Gupta

almost 2 years ago
I am trying to add
clickable
modifier in the
BasicTestField
(with decoration used). but it is not working but if I add
Modifier.clickable
in the decoration then it is working. Any idea why
clickable
is not working when added to top BTF
a
a
z
  • 3
  • 6
  • 387
Im trying to make a compose multiplatform PDF viewer. I've never made like a full library before, so...
z

zt

about 2 years ago
Im trying to make a compose multiplatform PDF viewer. I've never made like a full library before, so.. I'm having issues with getting all the code together, and making it multiplatform. Cause on android the PdfRenderer takes a ParcelFileDescriptor class. On desktop I'm using icepdf (not sure if theres better). I need to make like a state class, then various ways for a developer to provide the PDF: url or a file. So how would i represent that internally in my PdfState class? On android I first need to download to a temporary file, but not on desktop. I would really like to make this happen but it's difficult and i need advice
z
a
+2
  • 4
  • 4
  • 387
Previous175176177Next

kotlinlang

A modern programming language that makes developers happier.

Powered by