Questions tagged [android-compose]
14 questions
6
votes
1 answer
Android Compose unknown crash
This whole situation is just ridiculous – I've got this insanely weird crash messing with my sanity, and no matter how much I scour the internet, it's like this thing doesn't even exist in the online world. It's frustrating as heck. So, if you're…

eldartsa
- 181
- 1
- 8
2
votes
1 answer
How to save navigation state between configuration changes?
I have an android compose app that is set up with a single activity that uses NavController to navigate between screens.
However, when I rotate the screen (make a configuration change) the screen resets to the startDestination specified in the…

jojeyh
- 276
- 1
- 3
- 12
2
votes
2 answers
How to prevent ModalBottomSheet from overlapping with the system buttons?
I'm trying to add a ModalBottomSheet from Material3 into my app.
I have a main screen implemented like this:
@Composable
fun MainScreen() {
Surface(
modifier = Modifier.fillMaxSize(),
color =…

dacal
- 65
- 7
1
vote
1 answer
Jetpack Compose display value from lambda
I basically have a Composable function with a lambda returning a value which a text composable is supposed to display.
data class CustomUiState(
val lookupList: HashMap> = HashMap()
)
class CustomViewModel(
):…

OscarCreator
- 374
- 4
- 13
1
vote
1 answer
Is it possible to use Cubic bezier for animation in compose?
I am wondering how to use Cubic bezier in android compose for animations?
Mostly about touch effect of one object, for instance, on a button press or animate it. Also, is there any stable library to import/add to grade and use?

MaryG
- 23
- 4
1
vote
0 answers
Android Studio Download Sources Failed
I want to view the source code of androidx.compose, but when I click download sources, I will get error:
Executing tasks: [:module_widget:DownloadSources] in project…

Ven Shine
- 8,739
- 2
- 9
- 24
0
votes
0 answers
Android - Create custom colors in Compose with Material 3
I have been exploring Compose + Material 3 for the first time and I am having a really hard time trying to implement a custom color.
What I mean by this is doing the following based on how things could be done before Compose:
I have my custom…

Shadow
- 4,168
- 5
- 41
- 72
0
votes
0 answers
Handling java.lang.OutOfMemoryError with Image Loading in Android Compose using painterResource
I am encountering a recurring issue while working with the "Image" component in Android Compose. I am using the painterResource function to load images into the "Image" component. However, I'm facing frequent crashes related to…

eldartsa
- 181
- 1
- 8
0
votes
1 answer
Compose Toolbar overlaps status bar
Main Activity:
override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
ArchApp()
…

user25
- 2,873
- 2
- 30
- 66
0
votes
0 answers
enableEdgeToEdge - navigation system bar is not fully transparent
Why navigation system is not fully transparent?
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(
Color.TRANSPARENT,
Color.TRANSPARENT,
) { false },
navigationBarStyle = SystemBarStyle.auto(
lightScrim,
…

user924
- 8,146
- 7
- 57
- 139
0
votes
1 answer
Android Compose doesn't work with KSP, ROOM for multi-module projects
I noticed after enabling Android Compose for the project:
buildFeatures {
compose true
}
KSP with ROOM doesn't work properly finishing with exceptions like this during bulding project:
[ksp] [MissingType]: Element…

Gregorian
- 1
- 2
0
votes
1 answer
ViewModel repeats init block in Compose
Been trying to figure this out for two days and I'm at my wits end.
I have a ViewModel
data class ExampleUIState(
val samples: List = emptyList(),
val isLoading: Boolean = false,
val isError: Boolean = false,
)
class…

jojeyh
- 276
- 1
- 3
- 12
0
votes
0 answers
How to inject AndroidComposeTestRule into classes?
I want to achieve something like this:
// NavigateToUserAccountTest.kt
@ExperimentalMaterialApi
@HiltAndroidTest
class NavigateTest {
@EarlyEntryPoint
@InstallIn(SingletonComponent::class)
internal interface HiltTestEntryPoint {
…

Arst
- 3,098
- 1
- 35
- 42
0
votes
1 answer
I am trying to create TabRow with android compose kotlin. I couldn't add background color to tabrow. How can i do that?
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalFoundationApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val tabItems =…

Mahmut Umdi
- 13
- 4