Questions tagged [android-jetpack-compose-material3]

Jetpack Compose now has Material 3 support! This tag is for questions specifically related to Material 3 Composables, or the migration process from Material 2 -> Material 3 in Compose.

Jetpack Compose now has Material 3 support, though as of late 2022 there are still various experimental APIs and some aspects are not implemented.

Package documentation can be found here.

226 questions
4
votes
2 answers

Compose : scaffold unnecessary systemBar padding due to `WindowCompat.setDecorFitsSystemWindows(window, false)`

working on an edge2edge display app, i came across a situation about scaffold, according to the official doc, the scaffold padding values are used to offset the top and bottom bars, if they exist. Turns out that when i use scaffold without providing…
4
votes
2 answers

Jetpack Compose not taking the colorScheme

I have an android app written in Jetpack Compose. I am trying to set Icon colors using the defined colorScheme in my app, but it's not working. Below is my code. Color.kt import androidx.compose.ui.graphics.Color val green =…
4
votes
0 answers

Compose nestedScrollConnection not being triggered with animated scroll

I've created a collapsible header in Compose with the NestedScrollConnection. Everything works perfectly but one addition had to be made: automatic scrolling to a certain item. The problem I have is that the header (connected using the…
4
votes
1 answer

push an animation in composable function to start again whenever I click a button/ JetPack/ Kotlin

**every time the user click the button i want to show different icon inside the box and the transition should start again from its initial state ** fun card(iconColor: Color){ val animateShape = remember { Animatable(50f) } Card( …
4
votes
1 answer

ModalNavigationDrawer doesn't totally collapse in Jetpack Compose

Here is the code that produces this strange behavior: ModalNavigationDrawer( drawerState = drawerState, drawerContent = { Column( modifier = Modifier.fillMaxSize() ) { items.forEach { item -> …
4
votes
1 answer

Jetpack Compose Material3 - Label for Switch

I need to implement a switch with a label with Jetpack Compose and Material3. My solution so far (it basically just extends the existing switch component and adds the label property): @Composable fun LabeledSwitch( checked: Boolean, …
4
votes
0 answers

Jetpack Compose Material 3 and Material 2 theming

My app uses Material 3; however, I'm also using some libraries that use Material 2. The problem is: to get colors with Material 3 you have to use MaterialTheme.colorScheme, but to get them with Material 2 you have to use MaterialTheme.colors. So,…
4
votes
2 answers

Why does accompanist-systemuicontroller not work when using Jetpack Compose with Material3?

I'm learning the use of Material3 in jetpack compose, and I'm trying to set the statusbar to be transparent just as I used to. However, with the following code: WindowCompat.setDecorFitsSystemWindows(window, false) setContent { val…
4
votes
2 answers

How to change background colour of SmallTopAppBar, CenterAlignedTopAppBar, MediumTopAppBar and LargeTopAppBar

How can a color resource be used to change the background colour for a MD3 top app bar in Jetpack Compose? Understandably, a colors property is available but it's not clear what to use for the above. Color.kt val MyColor =…
4
votes
1 answer

How do I theme `NavigationBar()` and `NavigationBarItem()` in Jetpack Compose?

I'm having a terribly hard time trying to change the color(s) of selected/unselected icons and the active indicator. The docs don't have examples or proper Kdocs and I can't seem to find any examples online (please point me to any you know of). The…
4
votes
1 answer

Jetpack compose DropdownMenu With rounded Corners

Hello I can't figure out how to make a cut corners menu in jetpack compose 1.0.0-beta02. I tried wrapping the while menu with a surface but It didn't work. TopAppBar( modifier = Modifier .statusBarsPadding(), title =…
3
votes
1 answer

How to create a collapsing element inside compose scaffold? (not collapsing top app bar)

I want this row of chips to collapse when you scroll up in the lazy grid but appear again when you scroll down, basically the same behaviour you would get by using TopAppBarDefaults.enterAlwaysScrollBehavior() with the top app bar. The row is not…
3
votes
1 answer

Make HorizontalPager central item on top of other elements

How to make HorizontalPager center item on top of right items? (Blue is the "focused"/centered item from the viewpager) I've tried playing with zIndex but without succeed .zIndex(if(page == currentPage) 1f else 0f) Additional…
3
votes
1 answer

Jetpack Compose: Top app bar scroll behavior not changing status bar color

I've implemented the pinned top app bar scroll container, and it works for changing the app bar color on scroll, however the status bar color isn't affected at all. Here's what I have: val scrollBehavior =…
Nathan
  • 73,987
  • 14
  • 40
  • 69
1 2
3
14 15