Category "kotlin"

I am using a scroll view that hides my toolbar while scrolling, I don't want my toolbar to hide while scrolling

I am making a register screen, that has a toolbar on top of it. When I scroll down the toolbar hides(goes up). I don't want my toolbar to scroll when I am scrol

Filtering array list

I have a class which I want to use, to filter my array according to driver. Driver is hardcoded just to try and eliminate possibilities of why the code is not w

What does "intrinsic" implementation mean in Kotlin?

When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown: public suspend inline val coroutineContext: CoroutineContex

Completable.create of RXJava equivalent in Kotlin Coroutines- Android

I am working on Firebase authentication wherein I need to put the firebase auth on my Repository. I found this article on how to do it but it uses RxJava. (http

Android Kotlin: onTextChanged not being triggered for EditText

I am creating an EditText box with line numbers on the side. To achieve this, I have code in the onTextChanged method of the addTextChangedListener that updates

Polymorphic deserialization of nested list object in Kotlin

Trying to deserialize a pretty complex json string, I've done simpler ones but am struggling with how to set this up. I've also found some examples on simple po

Gradle Building Error while outputting the program

I am facing an issue when I am Using Gradle to output my Android APP in Android Studio, I am getting such error, the error was there in sync, then I tried to sy

How to load Fonts in Jetpack Compose Desktop?

In Jetpack Compose for android you can do this: val fontFamily = FontFamily( Font( resId = R.font.my_font_400_regular, weight = FontWeight.

How to programmatically uncheck a checkbox in Kotlin

I've got two checkboxes and I need to uncheck the other checkbox if the first checkbox was clicked. Right now if a user clicks on the second checkbox and then o

How to make "inappropriate blocking method call" appropriate?

I am currently trying to leverage kotlin coroutines more. But I face a problem: when using moshi or okhttp inside these coroutines I get a warning: "inappropri

GroupBy operator for Kotlin Flow

I am trying to switch from RxJava to Kotlin Flow. Flow is really impressive. But Is there any operator similar to RxJava's "GroupBy" in kotlin Flow right now?

converting one function into multiple - Kotlin

how would I go about taking this one function and turning it into multiple functions? I need to create a local double variable called change and set it to a tes

Cannot determine path to 'tools.jar' library for 18 (C:/Program Files/jdk-18.0.1.1)

i want to run my code in intellij ide (community edition) and when i try to run it, i got this error Cannot determine path to 'tools.jar' library for 18 (C:/Pr

Android - listFiles() doesn't list some files

I'd like to make an Android app to list files and their size, a bit like WinDirStat or TreeSize on Windows, or DiskUsage on Android. I tried this to get a list

Jetpack Compose Place every question in it's own screen

I have a JSON data looking like this questions: [ { id: "1", question_type: "FREE_TEXT", answer_type: "SINGLE_LINE_TEXT", question_text: "what's your name?", op

Google Fit API does not work in internal testing

I am using Google Fit API to get fitness data for a kotlin app. But API does not work in internal testing on Google Play Developer Console. When connecting the

Text Composable dimensionResource not working as fontSize parameter

When I plug in fontSize = dimensionResource(id = R.dimen.textLabelTextSize) where the dimens or 54sp or 60sp depending on the device, I get an error on Text() "

How to do Assisted Injection with Navigation Compose?

I've a composable called ParentScreen and a ViewModel named ParentViewModel. Inside the ParentViewModel, I am collecting a value from my repo. class MyRepo @Inj

How to go from one fragment to another fragment in kotlin?

I have a button in fragment A and when I click on fragment A, I want it to be redirected to fragment B. How to achieve this in kotlin? Right now I am using this

Android Mockito test cases with Retrofit

I am new to test cases and I am trying to write test cases for the below code but I did not get success after trying several method. My main target is to cover