Category "kotlin"

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

Kotlin Multiplaform iOS Exceptions showing in Xcode, not in Firebase

We have noticed in our project, we are getting allot of exceptions logged in Xcode (->Organiser->Crashes) logged in production... However these Share cra

Issue with backstack and bottomnav in kotlin

I have a bottom nav with 4 fragments Home, Following, Notification, and Profile, there is no issue with the bottom navigation on backstack , but now for eg from

Do I need to mention the coroutine dispatcher while working with Retrofit and Room?

Recently I saw this - Most data sources already provide main-safe APIs like the suspend method calls provided by Room or Retrofit. Your repository can take adva

Know whether a view is completely visible in a recycler view from its adapter

I saw a lot of posts that show the currently entirely visible item in the recycler view but, from the activity. But, I want to know about that from the adapter.

Upgrading Android kotlin version to 1.5.0 throwing error message on build

Running with kotlin version '1.4.32' my Android project runs and builds. Trying to upgrade to kotlin '1.5.0' and my build throws: Execution failed for task ':a

How to run migrations on Android Studio?

Sometimes I see a pop-up, that I can migrate to a newer kotlin version or something but I recently accidentally closed it and after restarting Android Studio it

How to run migrations on Android Studio?

Sometimes I see a pop-up, that I can migrate to a newer kotlin version or something but I recently accidentally closed it and after restarting Android Studio it