material-components-android

Remove space between bounds and button border

别等时光非礼了梦想. 提交于 2020-03-16 06:42:22
问题 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

How to set a gradient background in a Material Button from Material Components?

时光毁灭记忆、已成空白 提交于 2020-03-16 06:13:28
问题 I've been trying to set a gradient background in a Material Button from Material Components for Android, but it's not working. So, how to set a gradient background in a Material Button? 回答1: From the documentation for MaterialButton: Do not use the android:background attribute. MaterialButton manages its own background drawable, and setting a new background means MaterialButton can no longer guarantee that the new attributes it introduces will function properly. If the default background is

How to change color in Material Components PROGRAMMATICALLY on Android?

浪尽此生 提交于 2020-03-03 09:08:10
问题 I'm looking for a solution to change the color of some Android Material Components layout objects. How can I change the color of text or borders in a Material Button programmatically? All functions like MaterialButton.setTexColor() do not work. Same thing for the StrokeColor. The change must be made logically, directly from code. No XML styles, colors must be able to change in live, based on values read from a database. Things like these don't work : //renewSetDate is a Material Button Object

How to change color in Material Components PROGRAMMATICALLY on Android?

て烟熏妆下的殇ゞ 提交于 2020-03-03 09:06:26
问题 I'm looking for a solution to change the color of some Android Material Components layout objects. How can I change the color of text or borders in a Material Button programmatically? All functions like MaterialButton.setTexColor() do not work. Same thing for the StrokeColor. The change must be made logically, directly from code. No XML styles, colors must be able to change in live, based on values read from a database. Things like these don't work : //renewSetDate is a Material Button Object

How to change color in Material Components PROGRAMMATICALLY on Android?

偶尔善良 提交于 2020-03-03 09:06:14
问题 I'm looking for a solution to change the color of some Android Material Components layout objects. How can I change the color of text or borders in a Material Button programmatically? All functions like MaterialButton.setTexColor() do not work. Same thing for the StrokeColor. The change must be made logically, directly from code. No XML styles, colors must be able to change in live, based on values read from a database. Things like these don't work : //renewSetDate is a Material Button Object

Tabbar layout active tab textcolor is same as primary color

断了今生、忘了曾经 提交于 2020-03-03 07:07:39
问题 This is my style: <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> <style name="AppTheme

How to remove those dark circular background from floating action button?

[亡魂溺海] 提交于 2020-02-25 04:15:08
问题 I am not able to remove those dark circle background from floating action button. By default it has a circle button with above circular shade. but some how couldnt find a way to remove that shade. xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android

How to change toolbar text color from MaterialComponents.DayNight theme?

橙三吉。 提交于 2020-02-22 04:14:06
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the

How to change toolbar text color from MaterialComponents.DayNight theme?

試著忘記壹切 提交于 2020-02-22 04:13:59
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the

How to change toolbar text color from MaterialComponents.DayNight theme?

天涯浪子 提交于 2020-02-22 04:13:25
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the