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,361
questions
225
votes
29
answers
169k
views
Round corner for BottomSheetDialogFragment
I have a custom BttomSheetDialogFragment and I want to have round corners in top of Bottom View
This is my Custom class that inflates my layout that I want to appear from bottom
View mView;
@Override
...
219
votes
14
answers
249k
views
Adjust icon size of Floating action button (fab)
The new floating action button should be 56dp x 56dp and the icon inside it should be 24dp x 24dp. So the space between icon and button should be 16dp.
<ImageButton
android:id="@+id/fab_add"
...
187
votes
10
answers
130k
views
Toolbar overlapping below status bar
I want to have appcompat v21 toolbar in my activity. But the toolbar I'm implementing is overlapping below status bar. How can I fix it?
Here is the activity layout xml:
<LinearLayout xmlns:...
165
votes
8
answers
106k
views
Material Design not styling alert dialogs
I've added the appCompat material design to my app and it seems that the alert dialogs are not using my primary, primaryDark, or accent colors.
Here is my base style:
<style name="...
104
votes
5
answers
48k
views
BottomSheetBehavior not in androidX libraries
I was using the BottomSheetBehavior with the original support library:
implementation 'com.android.support:design:27.1.1'
When I migrated to use the new androidx libraries though the ...
97
votes
8
answers
53k
views
MaterialComponents theme alert dialog buttons
Recently I switched from support library to com.google.android.material:material:1.0.0
But now I have a problem, in this pages there's a note https://github.com/material-components/material-...
96
votes
7
answers
63k
views
material-1.5.0-alpha03\res\values-v31\values-v31.xml:3:5-94: AAPT: error: resource android:color/system_neutral1_1000 not found
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="m3_ref_palette_dynamic_neutral0">@android:color/system_neutral1_1000</color>
...
88
votes
18
answers
90k
views
Put constant text inside EditText which should be non-editable - Android
I want to have constant text inside editText like:
http://<here_user_can_write>
User should not be able to delete any chars from "http://", I searched about this and found this:
editText....
86
votes
11
answers
167k
views
Android Button background color not changing
In this android project im creating a default button style.
my styles.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item ...
82
votes
10
answers
34k
views
How to center icon in a MaterialButton which has no text?
I'm using the latest version of the com.google.android.material:material library (i.e. 1.1.0-alpha03) and I have a MaterialButton defined with an icon and no text as follows:
I was hoping the ...
77
votes
10
answers
73k
views
Material design button with border
I know how to make Material Design button with color fill:
style="@style/Widget.AppCompat.Button.Colored"
And no-bordered transparent button:
style="@style/Widget.AppCompat.Button.Borderless....
73
votes
16
answers
107k
views
bottomSheetDialogFragment full screen
What I'm trying to achieve is something like Instagram in-app web browser, used when you click an ad:
what I did, is I used a WebView bottomSheetDialogFragment, and I override onCreateDialog to get ...
72
votes
12
answers
59k
views
java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute
I have a com.google.android.material.button.MaterialButton component in one of my layout file and I get this error when I am using the latest version of the Material Components library (com.google....
64
votes
4
answers
73k
views
Issue: change border color or box stroke for unfocused TextInputLayout in android
I have a very specific issue for changing the outline of the textbox for TextInputLayout when it's unfocused. I can't seem to find an attribute to change the color for the border of my "unfocused" ...
64
votes
9
answers
45k
views
Set com.google.android.material.chip.Chip selected color
How do I set the selected com.google.android.material.chip.Chip color? I don't want it to be the default gray. This is a single selection chip group.
Original documentation here
<com.google....