material-components-android

Material Components Default to colorAccent instead of colorPrimary

时光总嘲笑我的痴心妄想 提交于 2020-05-24 03:57:49
问题 My AppTheme in styles.xml looks like this: <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:textColorPrimary">@color/textColorPrimary</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation"

Material Components Default to colorAccent instead of colorPrimary

泪湿孤枕 提交于 2020-05-24 03:56:21
问题 My AppTheme in styles.xml looks like this: <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:textColorPrimary">@color/textColorPrimary</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation"

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

非 Y 不嫁゛ 提交于 2020-05-23 21:10:33
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

…衆ロ難τιáo~ 提交于 2020-05-23 21:09:08
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please

material checkbox style after customize

落爺英雄遲暮 提交于 2020-05-23 21:05:25
问题 My customized checkbox ( MyCheckbox ) has extended from androidx.appcompat.widget.AppCompatCheckBox , but the default styles don't apply to it. <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> ... <item name="android:checkboxStyle">@style/CheckboxTheme</item> <item name="checkboxStyle">@style/CheckboxTheme</item> </style> <style name="CheckboxTheme" parent="@style/Widget.AppCompat.CompoundButton.CheckBox"> <!-- for example try to change background --> <item name=

material checkbox style after customize

人走茶凉 提交于 2020-05-23 21:05:05
问题 My customized checkbox ( MyCheckbox ) has extended from androidx.appcompat.widget.AppCompatCheckBox , but the default styles don't apply to it. <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> ... <item name="android:checkboxStyle">@style/CheckboxTheme</item> <item name="checkboxStyle">@style/CheckboxTheme</item> </style> <style name="CheckboxTheme" parent="@style/Widget.AppCompat.CompoundButton.CheckBox"> <!-- for example try to change background --> <item name=

OutlinedBox TextInputLayout and gravity center?

烂漫一生 提交于 2020-05-22 07:59:50
问题 How to achieve centered new OutlinedBox style with TextInputLayout ? Current behavior: <android.support.design.widget.TextInputLayout android:id="@+id/textInputLayout2" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="left" > <android.support.design.widget.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="left" android:hint=

Material design components button global theme overriding broken

廉价感情. 提交于 2020-05-15 08:06:08
问题 I want to simply apply styling to all buttons on a theme level like this <style name="BaseTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> ... <item name="buttonStyle">@style/DefaultButton</item> </style> <style name="DefaultButton" parent="Widget.MaterialComponents.Button"> <item name="android:textColor">@color/whatever</item> </style> <Button android:id="@+id/addChannelButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom

Can't set background color of button using Material Components library

折月煮酒 提交于 2020-05-15 08:03:07
问题 My code: <Button android:id="@+id/button_one" style="@style/ButtonStyle" android:text="@string/button_one" /> <style name="ButtonStyle"> <item name="android:textSize">32sp</item> <item name="android:textColor">@drawable/background_button_text_color</item> <item name="android:background">@drawable/background_button</item </style> background_button.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/white" android:state_pressed="true

Remove space between bounds and button border

南笙酒味 提交于 2020-03-16 06:42:28
问题 How do I remove those space between Button border and view bounds tried setting padding to 0dp but with no results. These is material button with default style. 回答1: The MaterialButton has a default style with these insets: <style name="Widget.MaterialComponents.Button"..> <item name="android:insetLeft">0dp</item> <item name="android:insetRight">0dp</item> <item name="android:insetTop">@dimen/mtrl_btn_inset</item> <item name="android:insetBottom">@dimen/mtrl_btn_inset</item> ... </style> The