Category "kotlin"

Jetpack compose how to animate multiple values

I have couple of Path elements in my Canvas and would like to do some complex animations with every one of the Path lines. I am not sure how to approach this. L

How to change android jetpack compose bottomAppBar icon tint color?

BottomNavigationBar() can only take the background and contentColor but there is no option for tint color.

Inject context with Hilt: this field leaks a context object

I'm using Hilt to inject context and other dependencies into my HomeViewModel class; Everything is working properly but I'm getting this warning. How can I prev

Inject context with Hilt: this field leaks a context object

I'm using Hilt to inject context and other dependencies into my HomeViewModel class; Everything is working properly but I'm getting this warning. How can I prev

Recyclerview recreating dynamic chips on scroll

I am creating a RecyclerView which has an item with dynamic chips. I am looping through an array to set the text of the chip, this works fine but when I scroll

Why not use lateinit modifier in Andrioid Fragment view-binding?

In android documentation we have example of view binding without lateinit: private var _binding: ResultProfileBinding? = null // This property is only valid bet

How to Imbed NiceHash Website Widget into Android App? Would it be WebView?

I would like to put this Profitability calculator from: https://www.nicehash.com/widgets#profcalc Where the site says to use: <iframe src="https://widget.nic

HiltViewModel: Cannot create an instance of class

I am using Hilt. After updating to 1.0.0-alpha03 I got warnings that @ViewModelInject is deprecated and I should use @HiltViewModel. But when I change it I got

How to enable spring security kotlin DSL?

How can we enable support for the spring security kotlin DSL? As you can see from the Screenshot of the IDE (IntelliJ), the DSL is not available: This is the f

Custom view custom attribute not being set without @{}

So I've got a custom view with this attribute: private var mLabelText: String = "DEFAULT" var labelText: String set(value) { if (mLa

How to check if a class has overriden a default method from an interface using Reflection in Kotlin or Java?

I have an interface with a default method, and two classes which implement this interface. One of the classes overrides the default method, and the other does n

How to fill the spinner with a custom object with coroutines and implement your onItemSelected logic related to that object?

For example, let's use this class: data class Person ( var id : Long, var name: String, var imageUrl: String ) I need to fill my spinner with name

Can't add buildFeatures to my gradle file when trying to implement viewbinding

I'm sure there's a simple solution to this and I have searched but found no clear solution. I'm trying to implement viewbinding into my Kotlin project (Kotlin /

Solo Learn practice how to calculate parking fee based on some conditions in Kotlin

You are making a car parking software that needs to calculate and output the amount due based on the number of hours the car was parked. The fee is calculated b

Button Long Press Listener in Android jetpack compose

I am having an Android Composable UI with a Button. How can I track button long press events? I got it working for the Text long press, but for Button, It is no

Kotlin for a new application for stock management?

I am searching a new language/framework for a v2 of a old app we have in my company, for stock management, and I was wondering if Kotlin could do the work. Basi

Uploading files Kotlin Spring Boot

So, I am trying to make and upload file(s) functionality, from some blog posts and stackoverflow questions I got this solution: @PostMapping("/file/upload") fun

Uploading files Kotlin Spring Boot

So, I am trying to make and upload file(s) functionality, from some blog posts and stackoverflow questions I got this solution: @PostMapping("/file/upload") fun

Is there any way to stretch layout when device has cutout (notch)?

I'm making my project able to handle notch/cutout because users can see big black rectangle area when in landscape mode. Since my app's layout will be safe afte

Kotlin @Serializable annotation not working in IntelliJ

I'm trying to use the @Serializable annotation in Kotlin. I can build the project with Gradle, but it's showing up red in IntelliJ and when I hover on the @Seri