Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [material-components-android]

Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Android apps.

material-components-android
1 vote
0 answers
10 views

setIcon funcgion does not work on MaterialButton, setCompoundDrawableWithIntrinsicBounds does

I am on material version "1.9.0". I have a UI that use different presentations of a material button. When the icon is set in xml it works & is visible. However when I try to set the ...
user1743524's user avatar
1 vote
2 answers
139 views

How to Align Drawable / Icon to Right of Text in a Button?

In my Android app, I want to have a drawable ( or icon) immediately to the right of the button's text, but I'm facing an issue where the drawable is too far from the text, and the app:icon attribute ...
Paul Sizon's user avatar
0 votes
0 answers
241 views

How to add material3 components to the XML design palette?

So I followed this guide here on how to add material3 to the gradle and I was able to get the colors XML.However, when I go to the layout XML, the palette does not have any of material3's components (...
CoffeeBean's user avatar
0 votes
0 answers
22 views

Set the same elevation for all cards in recyclerview kotlin

I'm using this card xml in my item for recyclerview and it looks like the shadow increases when the position comes more down, but I want to make it one for all of them <com.google.android.material....
Mohamed Anwer's user avatar
0 votes
1 answer
588 views

Jetpack Compose: Screen freezes when dissmiss ModalBottomSheet by swiping down by touching drag handle

I'm trying to create a ModalBottomSheet that will be visible and invisible depending on the value of a boolean state showBottomSheet. if showBottomSheet value is true, ModalBottomSheet will be ...
Himel Mazumder's user avatar
0 votes
1 answer
33 views

Android Cucumber UI test problem with com.google.android.material

I wrote a test scenario with the help of Cucumber and espresso and when I run the test it crashes wherever I use the com.google.android.material library. For example : com.google.android.material....
MeNoVa's user avatar
  • 89
0 votes
0 answers
31 views

Start Icon in Materal Design 3's Input Text seems to be ignoring MinSize property

I've been trying to utilize leading icons in my input texts while developing a mobile app, however, I cant seem to resize the icon to match the size of the input text. code 1: result 1: Also tried ...
Rafael Rapacci's user avatar
0 votes
1 answer
279 views

How to create a custom text input layout like material 3 in android, Because for me existing material 3 and material 2 not satisfying the requirement

I got requirement from designer for custom edit text or input text layout, so for that i tried to look in to MD2 and MD3 documentation, But i didn't found anything useful. This is the requirement, ...
Avinash Kumar Singh's user avatar
0 votes
0 answers
23 views

How to use a custom background for selected button in MaterialButtonToggleGroup?

Here the expectation is as below- Currently the design is- activity.xml <com.google.android.material.button.MaterialButtonToggleGroup android:id="@+id/toggleButton" ...
Dev_Cob's user avatar
  • 87
1 vote
0 answers
78 views

How to implement a custom EdgeTreatment for a complex shape?

I need to create a view with a custom appearance, like the following: custom shape with rounded zig-zagged border. Since there is a strong need of having shadows, I'd like to use a MaterialCardView to ...
Vincenzo Liguori's user avatar
1 vote
0 answers
55 views

Is it possible to change the shape of the material design slider? Android, Kotlin

The slider by material design has by default a pill shape. Is it possible to change that shape to a rectangle? This is my goal. Green is the background, purple is 10% of progress, black is the 90% of ...
MaDudeeK's user avatar
0 votes
0 answers
61 views

How to add textwatcher to material datepicker dialog's text field input in android?

I am trying to add a slash(/) when user type date in this format DD/MM/YYYY, I need to add slash automatically once user type DD and MM, I am thing of using text watcher here but how can I access ...
General Tony's user avatar
0 votes
1 answer
366 views

How to declare colors based on dark theme enabled or not, in compose with material 3

in my app, I have some custom colors and I use this method to know if the dark theme is enabled but there are some colors I want to make global based on the dark theme to use it from any composable ...
Dr Mido's user avatar
  • 2,614
2 votes
1 answer
599 views

Chip: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant)

I want to add a Chip view to ChipGroup in my project but always I get below error My code in Activity for (int i = 0; i < names.size(); i++) { Chip chip = new Chip(getApplicationContext()); ...
abolfazl bazghandi's user avatar
0 votes
1 answer
22 views

Disable future days after today in MaterialDatePicker

I want to disable future days on MaterialDatePicker. Here is my code, MaterialDatePicker<Long> datePicker = MaterialDatePicker.Builder.datePicker() .setTitleText("Select ...
Dulitha Bandaranayake's user avatar

15 30 50 per page
1
3 4
5
6 7
91