How to custom left/right align items in android jetpack compose Row

All we need is a simple explanation of the problem, which is provided below. I want a Row in Jetpack Compose, something like this: —————————————————- | A | B | | C | —————————————————- I want A & B to be left aligned, next to each other and C at the end. I don’t know … Read more

Is it possible to update Colors in jetpack from external API?

All we need is a simple explanation of the problem, which is provided below. Is it possible to update Colors.kt in jetpack from external API while app is launching. More precisely I want to get color value of "primary","primaryVariant","secondary" from an external API on app launch time . Let’s Solve it: This is a common … Read more

Jetpack Compose – Detect size constraint applied through Modifier

All we need is a simple explanation of the problem, which is provided below. How can I detect inside of my composable what height constraint was attached to it via the modifier? Column1 { Text("abc") Text("abc") } Column2(Modifier.fillMaxHeight()) { Text("abc") Text("abc") } Column3(Modifier.height(200.dp)) { Text("abc") Text("abc") } I want the Text (or other possible Composable) … Read more

How to make a @Preview in JetpackCompose, when the component depends of some data provide by ViewModel

All we need is a simple explanation of the problem, which is provided below. I was developing an App where I try to implement some new technologies, as Jetpack Compose. And in general, it’s a great tool, except the fact that it has hard pre-visualize system (@Preview) thn the regular xml design files. My problem … Read more

Android Jetpack Compose Multiple Layer Navigation

All we need is a simple explanation of the problem, which is provided below. I have multiple destination,and some of the destinations also have subsidiary destinations represented by a Navigation component to interact with. NavigationBar { page1 { NavigationBar { innerPager1 innerPager2 ….. } } page2 {….} } I want only the part excluding the … Read more

dynamically change text in cards – Jetpack Compose state

All we need is a simple explanation of the problem, which is provided below. New to Compose and struggling hard with more complex state cases. I cant seem to change the text dynamically in these cards, only set the text manually. Each button press should change the text in a box, starting left to right, … Read more

How to arrange BottomNavigationItems in Compose?

All we need is a simple explanation of the problem, which is provided below. How can I arrange the two inner BottomNav Items so that they are not so close to the "+" FAB? I tried surrounding the forEach which displays the Items with a Row and use the Arrangement modifier like so: Row(horizontalArrangement = … Read more

How can I get string resource in Jetpack composable test

All we need is a simple explanation of the problem, which is provided below. We can get the string resource in Composable through stringResource like @Composable fun Heading( @StringRes textResource: Int ) { Text( text = stringResource(id = textResource), color = colorBlack, ) } But how can we get this string resource in composable test. … Read more

how to make cursor on BasicTextField be centered on jetpack compose?

All we need is a simple explanation of the problem, which is provided below. I have a problem, where I need a BasicTextField to customize the TextField as I want. Here I have tried to do a custom, but there is a problem with the cursor in the BasicTextField, it doesn’t center align, what I … Read more

dimensionResource crashes with "NotFoundException: Resource ID type #0x4 is not valid"

All we need is a simple explanation of the problem, which is provided below. Here I have stuck with dimensionResource(id). I don’t know why it is not working but other stringResource(id), colorResource(id) and painterResource(id) are working fine. Here are associated files. 1)Ui Composable (DimenErrorTest.kt) package com.kot.androidkotapp.ui.common import android.content.res.Configuration.UI_MODE_NIGHT_NO import android.content.res.Configuration.UI_MODE_NIGHT_YES import androidx.compose.foundation.* import androidx.compose.foundation.layout.* import … Read more