Category "kotlin"

How to start the same action multiple times from the same startingDestination using navigation graph?

I started recently using the navigation graph and i have a problem that i havent solved yet. I want to open the same fragment multiple times that they are stack

Backend Internal error: Exception during psi2ir in Jetpack compose

I am getting this error during compilation or code generation, I have set the Jetpack Compose dependencies and working on it, I have made some compose component

Android dark mode follow system returns wrong mode unless killing the app

I'm implementing dynamic dark mode change in the app I'm working on and It's working great for MODE_NIGHT_YES and for MODE_NIGHT_NO but when I'm setting this on

Navigation Error: action/destination cannot be found from the current destination

I am using Navigation component to navigate between two Fragments. The landing fragment has a recycler view and the detail fragment has a view pager. I am using

Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)

I've just updated my flutter project packages to be null-safety compliant and now Android Studio wants me to update my project to use the latest version of Kotl

Java/Kotlin Interoperability Limitations

I recently faced a problem regarding interoperability between Java/Kotlin for suspend functions. See my question: How to Override a suspend function in java cla

Failed to add navigation dependency

I am trying to Add Navigation in my project but its showing failed to add Navigation dependency, when i click on 'ok' in the window to add these now , its showi

Hibernate NamedQuery UPDATE statement throws QuerySyntaxException

I encountered a very interesting issue. I want to create an UPDATE statement NamedQuery for my class (I know this is a bit hacky). The weird thing is if I use p

OnKeyEvent without focus in Jetpack Compose

I am creating an app that makes use of a physical button on the device. This button will have a different functionality depending on the screen that is active.

How to retrieve drawable from attributes reference in a Fragment

Can someone confirm what the correct way is to retrieve drawable from attributes reference (from a fragment)? activity.context in val myDrawable = ContextCompa

Hilt: java.lang.ClassNotFoundException: Didn't find class "com.kotlin20test.Hilt_MyApp"

I have an error concerning Hilt, I"ve been trying to inject a retrofit interface I created using Hilt, Here is the error: java.lang.ClassNotFoundException: Di

Jetpack Compose BottomSheetScaffold sheetGestures disabled but gestures still works when child component is scrollable

I have a BottomSheetScaffold inside my android app that looks like the following: BottomSheetScaffold( sheetGesturesEnabled = false, sheetConte

Gradle cucumber error in command-line - command 'C:\Java\jdk-17\bin\java.exe'' finished with non-zero exit value 1

When I run cucumber test from IntelliJ terminal commandline and get subject error: λ gradlew cucumber

Jetpack Compose on Kotlin 1.5.0

I've updated to Kotlin 1.5 last week, and after yesterday having seen the intention of Google to make Jetpack Compose the preferred option for designing UIs, I

How to create an extension function with multiple receivers in Kotlin?

I want my extension function to have a couple of receivers. For example, I want function handle to be able to call methods of both CoroutineScope and Iterable i

How to make kotlin operator a Composable with parameters having default value

I'm trying to make Kotlin's invoke operator a @Composable, everything works fine, until I add a parameter to it, which should have a default value. See the code

Immersive fullscreen and Preference Dialogs pulling down status bar

I'm using an immersive fullscreen activity and for my dialogs I used the hack I found here where I set the dialog not focusable when opening it so its not pulli

Immersive fullscreen and Preference Dialogs pulling down status bar

I'm using an immersive fullscreen activity and for my dialogs I used the hack I found here where I set the dialog not focusable when opening it so its not pulli

How do I correctly anchor Snackbar in android, so it does not cover my bottom navigation view?

I am trying to avoid the snackbar covering the bottom navigation view. Instead, it should only appear inside the nav_host_fragment, but for some reason, it does

How to determine if a functions return type is a primitive in ksp

Short version: How can I tell if a KSType is a primitive or even compare it to a kotlin type? I'm writing a code generator in Kotlin using ksp. I am iterating t