android-styles

How to Change CardView background color from a theme

泄露秘密 提交于 2021-02-10 20:27:06
问题 In an app that has multiple themes, how would you change the background color of the CardView from the styles file? styles.xml <style name="AppTheme1" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimaryTheme1</item> <item name="colorPrimaryDark">@color/colorPrimaryDarkTheme1</item> <item name="colorAccent">@color/colorAccentTheme1</item> </style> <style name="AppTheme2" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color

Why backgroundTint requires android: prefix after API 21 but not before?

倖福魔咒の 提交于 2021-02-08 14:59:25
问题 Declaring a style, when I define an item android:backgroundTint , I get a warning that this is available as of API 21 onward, while my minimum API specified is lower (API 17). On the other hand, when I replace that with simply backgroundTint , the warning is gone. Does anyone know why is that? <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name=

Why backgroundTint requires android: prefix after API 21 but not before?

孤街醉人 提交于 2021-02-08 14:59:01
问题 Declaring a style, when I define an item android:backgroundTint , I get a warning that this is available as of API 21 onward, while my minimum API specified is lower (API 17). On the other hand, when I replace that with simply backgroundTint , the warning is gone. Does anyone know why is that? <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name=

Android toolbar icon color not so bright

廉价感情. 提交于 2021-02-05 10:40:59
问题 I am developing an app in which there are multiple tabs with icon without any title. The problem is that the icons are not looking as bright it should. I used white color(FFFFFF) in creating icon assets. Still it doesn't looks so good. The pic above shows Facebook Messenger and my App. There is difference between color(although both are white). Any suggestion will be appreciated. 回答1: Yeah I have experienced similar problem. I think it is fault of android asset studio when I create icon with

Android toolbar icon color not so bright

怎甘沉沦 提交于 2021-02-05 10:40:53
问题 I am developing an app in which there are multiple tabs with icon without any title. The problem is that the icons are not looking as bright it should. I used white color(FFFFFF) in creating icon assets. Still it doesn't looks so good. The pic above shows Facebook Messenger and my App. There is difference between color(although both are white). Any suggestion will be appreciated. 回答1: Yeah I have experienced similar problem. I think it is fault of android asset studio when I create icon with

Difference between style.xml and theme.xml android studio?

我与影子孤独终老i 提交于 2021-01-29 04:21:50
问题 Hey I'm trying to change the background of my action bar but I'm not quiet sure I understand the structure of the style files. So basically I have style.xml which is to pass on some elements a desired style. Then I've Theme.xml which is to have a group of styles in it, correct ? How do you link the two in other words how do I tell the theme I want the specified style in it ? I can't manage to change the background of the action bar so here is my code: style.xml: <!-- Base application theme. -

Night Mode color is not applying to the recycler view background

强颜欢笑 提交于 2021-01-27 21:03:08
问题 I want to implement night mode for my android app so I have used Theme.AppCompat.DayNight theme for implementing Night Mode. But I have to customize the color of the Toolbar and recycler view during the Night Mode. For that, I have declared the attribute in the attrs.xml file and use that attribute as a background in the recyclerview. Here is the attrs.xml file <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="ds"> <attr name="rv_color" format="color"/> </declare

layout_width and layout_height is not applying to edittext from the theme

假如想象 提交于 2021-01-27 05:28:27
问题 Below i have added EditText style in theme. I have added width and height also. So i removed android:layout_width and android:layout_height from my edittext view. But it is saying error. If i add width and height it is working fine. What is the difference. Is theme is not applying to my edittext view? <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:editTextStyle">@style/custom

layout_width and layout_height is not applying to edittext from the theme

坚强是说给别人听的谎言 提交于 2021-01-27 05:26:26
问题 Below i have added EditText style in theme. I have added width and height also. So i removed android:layout_width and android:layout_height from my edittext view. But it is saying error. If i add width and height it is working fine. What is the difference. Is theme is not applying to my edittext view? <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:editTextStyle">@style/custom

layout_width and layout_height is not applying to edittext from the theme

天大地大妈咪最大 提交于 2021-01-27 05:25:22
问题 Below i have added EditText style in theme. I have added width and height also. So i removed android:layout_width and android:layout_height from my edittext view. But it is saying error. If i add width and height it is working fine. What is the difference. Is theme is not applying to my edittext view? <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:editTextStyle">@style/custom