https://kotlinlang.org
Join Slack
How do I create a chip with choice style programmatically? ```<com.google.android.material.chip.C...
r

Rob

over 4 years ago
How do I create a chip with choice style programmatically?
<com.google.android.material.chip.Chip
  android:id="@+id/chip_1"
  style="@style/Widget.MaterialComponents.Chip.Choice"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:checked="true"
  android:text="Test" />

// tried this but it doesn't work
Chip(context, null, R.style.Widget_MaterialComponents_Chip_Choice)
➕ 1
r
t
  • 2
  • 3
  • 647
Question about Deep Links on Compose Multiplatform! :thinking_face: For Android, in `MainActivity`, ...
g

galex

over 1 year ago
Question about Deep Links on Compose Multiplatform! 🤔 For Android, in
MainActivity
, I found out we can write the following to catch the intent data and send it to the
navController
of
compose-navigation
:
override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            val navController = rememberNavController()
            DisposableEffect(Unit) {
                val listener = Consumer<Intent> {
                    navController.handleDeepLink(it)
                }
                addOnNewIntentListener(listener)
                onDispose { removeOnNewIntentListener(listener) }
            }
            ShinyApp(navController = navController)
        }
    }
}
Does someone know what is the equivalent for iOS I guess in
MainViewController()
?
fun MainViewController() = ComposeUIViewController {
    val navController = rememberNavController()
    // How to consume Deep link from iOS?
    HolidaysApp(navController)
}
Thanks in advance! 🙏
g
s
i
  • 3
  • 9
  • 645
*When is it proper to use `@NonRestartableComposable`?* I watched a talk on Compose 2 months back, ...
s

spierce7

about 1 year ago
When is it proper to use
@NonRestartableComposable
?
I watched a talk on Compose 2 months back, where the speaker was talking about under the hood of Compose. The speaker was very nervous, but clearly had a plethora of knowledge. I think he worked at Google? Anyways, I remember him distinctly mentioning that we should be using
@NonRestartableComposable
in our Root screens, and it was a micro optimization we could take advantage of. I know it's probably not really necessary, but I wanted to watch again and refresh myself on it, but can't find the video.
s
z
+3
  • 5
  • 11
  • 644
I have two multiplatform projects which I upgraded to Kotlin 1.9.0, Compose 1.4.3, Gradle 8.0.0. I h...
d

Daniele B

over 2 years ago
I have two multiplatform projects which I upgraded to Kotlin 1.9.0, Compose 1.4.3, Gradle 8.0.0. I haven't specified the Compose Compiler version in any of the two. But when I compile the Android app, one compiles successfully and the other one gives me this error:
> Task :androidApp:compileDebugKotlin FAILED
e: This version (1.3.2) of the Compose Compiler requires Kotlin version 1.7.20 but you appear to be using Kotlin version 1.9.0 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
I am very puzzled, as I have never specified this 1.3.2 Compose Compiler version anywhere. I even searched for the string "1.3.2" in the whole project, but it's nowhere.
d
j
  • 2
  • 18
  • 643
SOLVED Hello guys, how are you doing? I updated detekt from 1.21.0 to Latest but I always get this...
c

Caio Costa

over 2 years ago
SOLVED Hello guys, how are you doing? I updated detekt from 1.21.0 to Latest but I always get this error when trying to run it from CL:
* What went wrong:
Execution failed for task ':app:detekt'.
> Run failed with 3 invalid config properties.
        - Property 'formatting' is misspelled or does not exist.
        - Property 'libraries' is misspelled or does not exist.
        - Property 'ruleauthors' is misspelled or does not exist.
This is how detekt is setup here ATM (I created a separate gradle file for it):
apply plugin: 'io.gitlab.arturbosch.detekt'

detekt {
    toolVersion = "$detektVersion"
    allRules = true
    autoCorrect = true
    buildUponDefaultConfig = true
    config = files("${rootProject.projectDir}/config/detekt/detekt.yml")
    parallel = true
    source = files(rootProject.projectDir)
    reports {
        xml.required.set(true)
        html.required.set(true)
        txt.required.set(true)
        sarif.required.set(true)
        md.required.set(true)
    }
}
I'm using the latest detekt.yml: https://github.com/detekt/detekt/tree/main/config/detekt I've searched online but couldn't find anything helpful. Any help would be appreciated. Thank you.
c
g
b
  • 3
  • 8
  • 643
~Has anyone managed to make `@JsonValue` work when the property is nullable and the json has null as...
r

Rob Elliot

about 3 years ago
Has anyone managed to make
@JsonValue
work when the property is nullable and the json has null as the value?
Edit - I wrongly thought this was a Kotlin issue but I can't make it work in Java either so moving to https://gitter.im/FasterXML/jackson-databind?at=635675f89ee3ec22b4d9a239
😶 1
r
  • 1
  • 5
  • 643
hey ! anyone can share gitignore for KMM project ? I use android, ios(UI with compose ) and WASM in...
a

AlexS

almost 2 years ago
hey ! anyone can share gitignore for KMM project ? I use android, ios(UI with compose ) and WASM in my project + ktor on server side.
a
p
  • 2
  • 3
  • 643
I would like to use Firebase in my Jetpack Compose for Desktop project : so is fine to create an And...
l

loloof64

over 2 years ago
I would like to use Firebase in my Jetpack Compose for Desktop project : so is fine to create an Android application from the Firebase console in order to use it ? Or should I create a Web application ?
✅ 1
l
m
+2
  • 4
  • 10
  • 642
I have an Issue with `WindowInsets` in `BottomAppBar`. The `WindowInsets` padding are set after the...
s

Sebastian Höbarth

about 3 years ago
I have an Issue with
WindowInsets
in
BottomAppBar
. The
WindowInsets
padding are set after the transition to the new screen finishes and that results in a jump of the bottom bar. Is there a work arround for that? (video in thread)
Scaffold(topBar = {
            ...
        }, bottomBar = {
            // Wrap the navigation bar in a surface so the color behind the system
            // navigation is equal to the container color of the navigation bar.
            Surface(
                color = MaterialTheme.colorScheme.surface,
                tonalElevation = 6.dp
            ) {
                BottomAppBar(
                    modifier = Modifier
                        .windowInsetsPadding(
                            WindowInsets.safeDrawing.only(
                                WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
                            )
                        ),
s
s
  • 2
  • 14
  • 642
Is anyone using any Kotlin state machine libraries? any recommendations?
c

Chris Fillmore

about 4 years ago
Is anyone using any Kotlin state machine libraries? any recommendations?
c
f
+2
  • 4
  • 7
  • 640
Previous929394Next

kotlinlang

A modern programming language that makes developers happier.

Powered by