Category "kotlin"

How to use Parcel.readTypedList() along with @Parcelize from kotlin-android-extensions?

I'm running into a problem with implementing Parcelable-based state persistence in a View. Namely, as I need to implement the methods of BaseSavedState like thi

405 Method not allowed despite exposing all methods when using RepositoryRestConfiguration.disableDefaultExposure()

I don't want to expose my repositories by default and it looks like RepositoryRestConfiguration.disableDefaultExposure() does exactly what I want; however I get

How to make ViewPager2 less sensitive?

I'm using ViewPager2 in my App, it has three pages and each page show different contents, the issue is that it's too sensible that the ViewPager will change the

Determine Android device performance programmatically

I want to run different lines of code for android devices with different performance. For example something like this: if (isHighPerformanceDevice()) { // r

Is it possible to work with Apple Keychain from Kotlin in KMM?

Basically the whole question is in the title: "Is it possible to work with Apple Keychain from Kotlin in KMM?" I found there is available platform.Security for

How to build cordova project with Kotlin

I have a cordova project folder www already in progress. Build this and you will have an Android project. This will create a MainActivity.java file. I don't

How to deserialise a field and tell the difference between the value being null or absent?

When I am deserialising into my class, for some fields, I would like to be able to tell the difference between the value being absent, or null. For example, {"i

Read value from local.properties via Kotlin DSL

I want to retreive key from local.properties file that looks like : sdk.dir=C\:\\Users\\i30mb1\\AppData\\Local\\Android\\Sdk key="xxx" and save this value in m

Exposed drop-down menu for jetpack compose

I was wondering if there is a solution for Exposed drop-down menu for jetpack compose? I couldn't find a proper solution for this component inside jetpack compo

Android kotlin Object Any type mismatch

How to assign kotlin map to java library map. This gives type mismatch error for Object and Any. I need to assign java map variable in a 3rd party java library

LazyColumn - How do you display the most recent item in LazyColumn?

I have a LazyColumn where the use inputs items into. I want the LazyColumn to display the most recent item. How do I do this? Right now, LazyColumn is reversed,

Observe stdout from multiplatform kotlin commonTest code

I just want to see the output from a few simple println(...) in my Kotlin mulitplatform commonTest code. My build.gradle.kts looks a little like: import org.je

Only the second function is called, Android studio Kotlin

I followed a tutorial on Camerax from the Android Studio website, and I wanted the camera button when pressed to take a picture from the front and the back came

Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error

Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error It's on binding.

Cannot create an instance of an abstract class (Kotlin)

Trying to use LiveData but this error apears. class GameViewModel : ViewModel() { private val _score = MutableLiveData<Int>() val score: LiveData<Int&g

Killing a thread or an asynchronous task

let's say I use a jar that IBM has created. Let's say that this Jar has a function that I need but is ultimately build as such: while (true) { System.ou

How to access variant.outputFileName in Kotlin

We've been using a snippet like this one to rename the APK file generated by our Gradle build: android.applicationVariants.all { variant -> variant.outp

KMM - Casting a sealed class/interface in swift not possible

Within my KMM library I use sealed interfaces/classes to represent certain states/errors. I decided to use sealed interfaces/classes because these states must h

How to query an Entity from a Many-to-Many realtionship dependendt on two ore more conditions in Ktor with the Kotlin Exposed Framework?

I have 3 entities: User id: Int name: String Room id: Int name: String RoomUser id: Int room_id: Int (Reference on Room.id) user_id: Int (Reference on User.i

How to eliminate passing View Model to this Jetpack Compose Kotlin Home Screen?

I'm trying to clean-up my code and eliminate View Models where not necessary. I'd like to be able to access itemList, filtering, and itemListFiltered in my Home