Category "kotlin"

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

Set Drawable instance to Image in Jetpack Compose

In Jetpack Compose, who can tell me is there a way to assign a Drawable Object to the Image compose view? I took the apps installed on an Android device. I get

Jetpack Compose - Column - Gravity center

I'm creating a layout with Jetpack Compose and there is a column. I would like center items inside this column: Column(modifier = ExpandedWidth) { Tex

Is 'constructor LocationRequest()' deprecated in google maps v2?

I stumbled upon this message recently, and I was pretty sure that this constructor wasn't deprecated in prior versions to 18.0.0, but I cannot find information

java.lang.NullPointerException: DataBindingUtil.setConte….layout.activity_chapter) must not be null

I have just build a project with android kotlin but when I run the app it got crash, and in the logcat I found this error java.lang.NullPointerException: DataB

Kotlin: Equivalent of property wrappers from Swift

What is the equivalent property wrappers for Kotlin: @propertyWrapper struct Foo { var wrappedValue: String { get { return "Test

Custom parameter names with a bean for request parameters in Spring 5

I'm trying to use Spring 5 to have a custom bean for my request parameters. In theory this is easy, but I want to have the field names be different from the par

How can I convert a Long value to date time and convert current time to Long kotlin?

The Code A can convert a long value to date value, just like 2018.01.10 I hope to get Date + Time value , such as 2018.01.10 23:11, how can I do with Kotlin?

Fragment navigation and menu. How to remove latest fragment? Check description

I was incapable of finding an answer for the following context: Let's say we have a menu and a nav graph instanced in the main activity. We have 3 fragment: Hom

How to inject data class in android with dagger where data class parameter have no default value?

My data class like: data class Animal(var id:Int = 2) { } My Provides method in module class like: @Provides @Singleton fun provide():

Kotlin Multiplatform Project Unit Test Issue

Today I just updated my Android Studio to Android Studio 3.5.2 Build #AI-191.8026.42.35.5977832, built on October 31, 2019 JRE: 1.8.0_202-release-1483-b49-5587