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
37
votes
10 answers

Jetpack Compose collapsing toolbar

I can't find any doc on the matter, is there something similar to a CollapsingToolbar in Compose? All I found was a mention of it here, but nothing on how to set it up
33
votes
6 answers

Not able to use rememberScaffoldState() in android compose Material3

I want to use rememberScaffoldState() in android material3 compose, but not able to use it. @OptIn(ExperimentalMaterial3Api::class) @Composable fun AppFeatureScreen(viewModel: AppFeatureViewModel = viewModel()) { val scaffoldState =…
29
votes
6 answers

How to implement BottomSheet in Material 3 Jetpack Compose Android

I know how to implement BottomSheet in Material 2 Jetpack Compose using BottomSheetScaffold. But there is no BottomSheetScaffold in Material 3. Also, there is nothing in official samples about BottomSheet.
23
votes
2 answers

How to add border to card view with jetpack compose

I find the way Border(1.dp, Color.Black) can not work with the border property of Card view, what's the best way to work around of it?
20
votes
11 answers

How to align title at layout center in TopAppBar?

TopAppBar( backgroundColor = Color.Transparent, elevation = 0.dp, modifier= Modifier.fillMaxWidth(), navigationIcon = { IconButton( onClick = { TODO }, enabled = true, …
17
votes
1 answer

How to set Background Color for Material3 Card in Android Compose?

I try to set the background color for the Material3 Card in Android Jetpack Compose, using the backgroundColor parameter. implementation 'androidx.compose.material3:material3:1.0.0-alpha14' // * Card with background color argument Card( …
13
votes
1 answer

Jetpack Compose ExposedDropdownMenu not showing up when pressed

I'm working on a Jetpack Compose (1.3.0-beta03) and Material3 (1.0.0-beta03) app. I'd like to show the user a simple dropdown with different languages, and the following code isn't very different from what you'll find…
13
votes
4 answers

Jetpack compose ui : How to create cardview?

I want to create Cardview using jetpack compose but i am not able to find any example.
12
votes
2 answers

Compose TopAppBar has no background color

I want to add a TopAppBar to my Compose app, so I did the following: @OptIn(ExperimentalMaterial3Api::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { …
12
votes
2 answers

Drawer usage in Compose Material3

Is there a way to have the menu overlap the header and footer here? I am using androidx.compose.material3.Scaffold and NavigationDrawer. It seems like the Scaffold's drawer slot is removed -…
12
votes
4 answers

Jetpack Compose Change Slider Thumb Size

Is there any way to change slider thumb size? I think for now we can only manipulate colors var sliderPosition by remember { mutableStateOf(0f) } Text(text = sliderPosition.toString()) Slider( value = sliderPosition, onValueChange = {…
12
votes
7 answers

Create chip with outline Jetpack Compose

I have the following composable function to build a Chip: @Composable fun CategoryChip( category: String, isSelected: Boolean = false, onSelectedCategoryChanged: (String) -> Unit, onExecuteSearch: () -> Unit ) { Surface( modifier =…
10
votes
1 answer

Jetpack Compose Material3 Pull to Refresh functionality

I am trying to migrate a project from Material2 specs to Material 3 compose library following this guide. The current LazyColumn in Material2 has integrate Pull to refresh functionality, found here However, i did not find any such functionality for…
9
votes
1 answer

Material3 Color Harmonization in Jetpack Compose

While using the view-based system, we can harmonize a color using the below code. MaterialColors.harmonizeWithPrimary(context, colorToHarmonize) In a project that is fully migrated to Jetpack Compose and all the color values are stored in the…
9
votes
1 answer

How to set half expand ratio to bottom sheet in Compose?

In XML we have material3 bottom sheet. It allows us to set behavior of bottom sheet. It can be updated like: bottomSheetBehavior.halfExpandedRatio = 0.6 bottomSheetBehavior.state = BottomSheetBehavior.STATE_HALF_EXPANDED I'm migrating project to…
1
2 3
14 15