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

All Questions

0 votes
1 answer
130 views

How to change inflated toolbar item icon color in Actionmode from App Theme

This is the main theme we use for all our apps: <resources> <!-- Learn more about theming: https://m2.material.io/design/material-theming/implementing-your-theme.html#color --> <...
Chris's user avatar
  • 13
1 vote
1 answer
37 views

Updating android styles to recognize material components

I just recently change the parent reference of my AppTheme, to have compatibility with recent tools, but now some old styles are not been applied.. <style name="AppTheme" parent="...
Jose Navío's user avatar
0 votes
1 answer
395 views

I cant use from style OutlinedBox Dense - Android

I am using from this style="@style/Widget.Material3.AutoCompleteTextView.OutlinedBox.Dense" but get me bellow error: Caused by: android.view.InflateException: Binary XML file line #26: ...
jo jo's user avatar
  • 1,838
2 votes
1 answer
1k views

MaterialButton style being overridden, how do I keep it?

I'm trying to use a MaterialButtonToggleGroup inside my BottomSheetDialog. However the style for the button is being overriden by the current theme I'm using for the BottomSheet In a regular fragment: ...
DIRTY DAVE's user avatar
  • 2,641
0 votes
1 answer
39 views

Are there any difference between `Widget.MaterialComponents.LinearProgressIndicator.MyStyleName` and `MyStyleName`?

Are there any difference between Widget.MaterialComponents.LinearProgressIndicator.MyStyleName and MyStyleName? <style name="Widget.MaterialComponents.LinearProgressIndicator.MyStyleName" ...
Taha Sami's user avatar
  • 1,649
2 votes
1 answer
1k views

How to change colorPrimary programmatically with a color given from an API?

I need to change the colorPrimary and colorAccent programmatically. The color values are fetched from a web service once we login to the application. These values will be any, because it is setting ...
KIRAN K J's user avatar
  • 712
1 vote
1 answer
813 views

Getting toolBar elevation in dark mode with material styles (PrimarySurface)

According to Material documents you could use "PrimarySurface" styles for components like toolbar and tab layout to switch their background color between color Primary and Surface in light ...
Prs2's user avatar
  • 113
0 votes
1 answer
336 views

SwitchMaterial doesn't change textStyle after applying style

code: fragment: <com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/changeDateFormatSwitch" android:layout_width="wrap_content&...
icecube's user avatar
  • 111
1 vote
2 answers
291 views

Is Button's background colored by colorPrimary, not colorAccent?

My Settings: minSdkVersion 19 && compileSdkVersion 30 I tried below code. I expected the button's background to be colored as colorAccent, but it was colored as colorPrimary. When I change ...
pitachips's user avatar
  • 104
3 votes
0 answers
62 views

Full Documentation, i.e. Reference, of Android Material Themes and Styles

I have two specific and several more general questions which are all related to the availability of documentation for material theming in Android. The general questions are the result of the specific ...
user2690527's user avatar
  • 1,821
1 vote
1 answer
133 views

How to create a custom view inflater and set it to a style resource?

I would like to create a custom view inflater that will inherit from MaterialComponentsViewInflater and override the createButton function to return a new AppCompatButton instead of a new ...
Omer Levy's user avatar
  • 367
2 votes
2 answers
948 views

Material Design TextInput change label and helper size

In Material Desing TextInput how do you change the size of the label and helper with styles XML. I've followed the Material Design codelab, the code lab shows a label that is at least 3 times the size ...
Shawn's user avatar
  • 1,342
0 votes
1 answer
2k views

Change BadgeDrawable Typeface in Android

I need to use a custom font for BadgeDrawable appears on top of my bottom navigation bar item. So I created a custom style for badge like this: <style name="CustomBadge" parent="...
asajadi84's user avatar
  • 549
0 votes
2 answers
3k views

Android material button taking color primary instead of color accent

I have my layout button as - <com.google.android.material.button.MaterialButton android:id="@+id/save_button" style="@style/buttonView" android:text="Save" app:...
Ma2340's user avatar
  • 707
8 votes
1 answer
3k views

Change Color from material outlined button doesn't work

I want to change the color of the active toggle button. But just the change of the rippleColor makes a difference. I wish to customize the background color of the active button and the text color. <...
hanni789's user avatar
  • 113

15 30 50 per page