Category "kotlin"

What is the Jetpack Compose equivalent of RecyclerView or ListView?

In Jetpack Compose, how can I display a large list of data while laying out only the visible items, instead of composing and laying out every item on the initia

Compose: remember() with keys vs. derivedStateOf()

What is the difference between these two approaches? val result = remember(key1, key2) { computeIt(key1, key2) } (Docs) val result by remember { derivedStateOf

What to send as Content

In my application, I save data to Firebase and to local storage using the Room library. With Firebase, everything is clear to me. But with Rom I had questions.

How to parse raw data in android kotlin using retrofit?

I have a webservice api which is having some raw data. No json structure data. And all i want to parse it. This is the response i am getting from an api. And h

How to return a String from a Kotlin method?

I am new to Kotlin. I am simply trying to return a response as a String from a method. But if I use val Str = ""; it is not re-assignable. Like Java in why can'

Kotlin: Iterate over components of object

Each data class object has a component for each property like component1, component2, etc.. I was wondering if there is any way in Kotlin to iterate over each c

How to skip an item in nested map based on When()

I want iterate over items's data and create a a new list of SomeData based on item.type however when type is UNKNOWN I need skip that element and not add to lis

Android Clean Architecture UseCase

I am developing a simple application. The user navigates through the elements of the RecyclerView to the end screen. When scrolling LastFragment to the very bot

ANDROID - Biometric_Not_Enrolled not working on my test device but works on emulator

my Biometric feature is working nice at emulator but when I test it on my Galaxy A7 2017, it is not working properly, instead of recognize as BiometricManager.B

How to disable Kotlin compiler in IntelliJ IDEA for Maven Java projects?

I have a Java only multi module Maven project in IntelliJ IDEA and I can see IDEA calling a Kotlin compiler whenever I rebuild a module or choose to run all tes

How to run a command line command with Kotlin DSL in Gradle 6.1.1?

I am trying to run the code block below, after reading multiple posts on the topic and the Gradle manual. I run the below and get the following error: execComma

How can I make an accompanist navigation BottomSheet fully expanded?

I know that a normal bottom sheet can be setup like this rememberModalBottomSheetState( initialValue = ModalBottomSheetValue.Hidden, confirmStateChange = {

Feign QueryMap usage with POJO

I've found in FEIGN-README that I can do stuff like: interface MarketDataRestClient { @RequestLine("GET /api/v1/depth") fun getOrderBook(@QueryMap orde

ERROR Task :expo:compileDebugKotlin FAILED

I created an application using react-native init and was working fine until I tried to start using expo to test it on my telephone. Trying to start the app with

How can I use an API to implement a search functionality on Android?

I am attempting to create a search functionality in an android application and have been doing research on how I can accomplish this while taking in data from a

Azure pipeline fails on building Kotlin Multiplatform shared framework usinig embedAndSignAppleFrameworkForXcode and fastlane

I'm working on a Kotlin Multiplatform project which is building fine locally but I can't get it to work on an Azure DevOps pipeline. Some good things to know: n

How to call private functions of a class from outside the class in Kotlin

I want to call a private functions of class SomeClass from outside of this class: class SomeClass { private fun somePrivateFunction() { //... }

Cannot deploy the ktor server

What kind of problem is that? Does anybody face this? Or anyone knows the solution? I was trying to deploy ktor server using PostgreSQL. Exception in thread "ma

Why isn't @DisplayName working for me in JUnit 5?

For some reason, I'm really having a hard time getting display names to actually be respected in JUnit 5 with Kotlin. Here's a test file I created for the purp

Round Double to 1 decimal place kotlin: from 0.044999 to 0.1

I have a Double variable that is 0.0449999 and I would like to round it to 1 decimal place 0.1 . I am using Kotlin but the Java solution is also helpful. val