Questions tagged [material3]
127 questions
17
votes
6 answers
android material design sample code giving missing resources errors
I am trying to run android material design same taken from below https://github.com/material-components/material-components-android
but getting these errors :
failed
:lib:packageDebugResources
tokens.xml
Can't determine type for tag '

neerajt
- 391
- 1
- 2
- 11
9
votes
6 answers
Changing card elevation is changing card color in Jetpack compose with Material 3
I am using the Card composable and I want it to be colored white.
But when I add some elevation to it, it changes color to more like the primaryContainer color.
I have seen documentation where they have somehting called as elevationOverlay. But…

nayan dhabarde
- 1,734
- 1
- 19
- 38
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…

Mehul Kanzariya
- 888
- 3
- 27
- 58
8
votes
4 answers
How to use a FilledButton in flutter (Material 3)
link1 (Screenshot) : https://flutter.github.io/samples/web/material_3_demo/#/
link2 (Document) : https://api.flutter.dev/flutter/material/FilledButton-class.html#material.FilledButton.1
flutter doctor
[✓] Flutter (Channel stable, 3.3.10, on macOS…

silvershort
- 257
- 4
- 10
7
votes
3 answers
Flutter/Material 3: AppBar ignores icon themes
In my AppBar the title is displayed with white text, but the icons are a dark grey or something.
I Would like to have the icons white, too.
But the colors in the icon themes have no effect!
Not when added directly to the AppBar...
Scaffold(
…

SouthbayDev
- 698
- 5
- 10
6
votes
1 answer
Customization of Material 3 LargeTopAppBar
I'm currently working on a Header in Compose that uses LargeTopAppBar from Material 3. The issue is, that the title is not very customizable and neither is the scrolling animation(that uses nestedScroll). I would like to add a subtitle underneath…

SHIFD
- 63
- 6
5
votes
1 answer
How to show snackbar in Jetpack Compose material 3
I started to learn Jetpack Compose and it looks confusing how to implement a simple snackbar, using material3 dependencies.
Documentation shows I need a scaffold and it needs a content with padding (?).
Do I need put my screen composable inside…

Talkative Breakdown
- 63
- 4
4
votes
1 answer
Where is the Matarial 3 surface container color in flutter
I found that there is no surface container colors in flutter
ColorScheme.fromSeed({
// ...
Color? background, // In m3, we should use surface as background color
Color? surface,
Color? surfaceVariant,// And use surface container color as the…

Heachen Bear
- 83
- 3
4
votes
2 answers
Material 3 Search Bar
I'm trying to use the new Material 3 Search Bar (https://github.com/material-components/material-components-android/blob/master/docs/components/Search.md). So I implemented it like this

Cameo07
- 41
- 3
4
votes
1 answer
How to define shape for Button in Jetpack compose when using Material design 3
I am using Material design 3 with Jetpack compose.
By default the Shape for Button has a corner radius of type full which is 20dp. As per the documentation.
https://m3.material.io/components/buttons/overview
If I look at the shape documentation, I…

nayan dhabarde
- 1,734
- 1
- 19
- 38
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 =…

Mervin Hemaraju
- 1,921
- 2
- 22
- 71
4
votes
1 answer
How to move cursor to the end of the TextField after screen rotation or system theme change and keep keyboard shown?
I have a screen with a Textfield as a Search bar which is autofocused when the screen is first displayed. The problem is, after screen rotation or system theme change (Dark mode/light mode), the cursor moves at the beginning of TextField even if the…

PopJoestar
- 462
- 1
- 4
- 10
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,
…

SapuSeven
- 1,473
- 17
- 30
3
votes
3 answers
Flutter how to get material 3 tonal palettes
Using the material 3 theme builder custom colors we have 4 colors that we need to choose from: Primary, Secondary, Tertiary, Neutral.
The site then generates a full both light and dark scheme that is based on the colors.
After adding the material…

Guy Luz
- 3,372
- 20
- 43
3
votes
1 answer
Material 3 - Change switch icon size in style.xml
I'm trying to add an icon to a switch control via thumbIcon, but I can't find a way to resize the icon. I'm trying to learn about this on this Page but I haven't been able to.
If I use the drawable without a selector, the icon displays the correct…

Espada
- 173
- 1
- 10