android-theme

Theme style for custom view

最后都变了- 提交于 2019-11-28 08:52:28
问题 My app has several themes from which the user can chose (red, blue, green etc.) Every theme has a corresponding button style (RedTheme => RedButton). Now I have created a custom view which slightly extends "Button" and unfortunately this button does not get any style, except I use the "style" attribute in a layout.xml. I don’t use any additional attributes, I just want that my Button style is applied. I want to do something similar than: <item name="android:imageButtonStyle">@style

How to change default text color using custom theme?

喜夏-厌秋 提交于 2019-11-28 06:41:18
What I'm trying should be quite easy with themes, but I can't find out how to: I want all text to be white by default in my app. I created a custom theme in theme.xml: <style name="Theme" parent="@android:Theme"> </style> <style name="TextAppearance.Theme" parent="@android:TextAppearance.Theme"> <item name="android:textColor">#ffffffff</item> </style> and set it for the whole application: <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Theme"> But labels are still black. What's missing? PS: How can I additionally define styles for different

Setting Android Theme background color

别等时光非礼了梦想. 提交于 2019-11-28 06:39:39
I'm trying to modify the default background theme color, which should be easy but surprisingly I can't get it working. Please note that I want the change to be across the entire app, not just for a single activity. Here is my code: styles.xml <resources> <color name="white_opaque">#FFFFFFFF</color> <color name="pitch_black">#FF000000</color> <style name="AppTheme" parent="android:Theme.Light"> <item name="android:background">@color/white_opaque</item> <item name="android:windowBackground">@color/white_opaque</item> <item name="android:colorBackground">@color/white_opaque</item> </style> <

Android: Theme.Holo.Light.NoActionBar vs Theme.Light.NoTitleBar

▼魔方 西西 提交于 2019-11-28 05:22:25
In res/values-v11/styles.xml , I can't use Theme.Holo.Light.NoActionBar because it was added in API level 13. Can I use Theme.Light.NoTitleBar instead, with no visual differences? As far as I can tell, they should both have a white background, status and navigation bars, and nothing else. Alexander Lucas Theme.Light.NoTitleBar is slightly different. The easiest way to resolve this and stay compatible back to Honeycomb is to create your own style that extends Theme.Holo.Light, but removes the Action Bar. Just create a style with the following definition: <style name="MyTheme" parent="android

Theme dependent colors of selected widgets

时光毁灭记忆、已成空白 提交于 2019-11-28 04:34:27
I'm pretty sure that this question already has been answered somewhere. It just seems too common. But I can't find the answer. I can't also figure out the solution. Here's the problem: I want one of my TableRow's to have different background color. It's simple, I just need to add android:background="#123456" In TableRow's XML Declaration. But, I also want my application to have two themes. In the other theme, the TableRow should have different background color. I just can't find a way to define a color value inside a theme and use it. I would like to type something like this: <style name=

Android: message font size in alertdialog through styles

假装没事ソ 提交于 2019-11-28 04:12:22
问题 I'm trying to change font size of message in alert dialog through styles but I can't make it work. There is a lot of answers describing how to do this but almost all of them I found do it programmatically. I want to do this once in styles, not with every new alertdialog. What I've done so far: In \AndroidSDK\platforms\android-23\data\res\layout\alert_dialog.xml I see the TextView that is showing the message: <TextView android:id="@+id/message" style="?android:attr/textAppearanceMedium"

Android how to get AppCompat.Translucent type theme with support actionbar?

笑着哭i 提交于 2019-11-28 03:26:41
I would like to add the support actionbar to one of my activities, I previously had been using the theme.translucent with this activity but in order to make the support actionbar work I needed to inherit the Theme.AppCompat, I need to maintain a translucent theme in this activity but unfortunately there isnt a Theme.AppCompat.translucent that i can see by default, is there any way that this can be done? Cameron Ketcham You can create a new set of styles to use which have the same properties as Theme.Translucent from themes.xml . Add the following to your styles.xml file: <style name="Theme

Custom ListView in Fragment not adhering to parent theme

我只是一个虾纸丫 提交于 2019-11-28 01:23:08
问题 I'm currently having an issue with using custom ListView adapters with the Holo.Light theme. Within the activities and fragments, any TextViews are displayed in the theme's normal colours ( textColorPrimary ). However, any text within the custom ListAdapter uses textColorPrimary from the default Holo theme, effectively making the text unreadable. Here is an example from my app's main menu: list_main_menu.xml - The row layout for the ListAdapter <?xml version="1.0" encoding="utf-8"?>

How to style ActionaBar Tab text in Android?

久未见 提交于 2019-11-28 00:35:10
问题 I am using ActionBarShrelock to provide Action Bars for pre honeycomb devices. I have following code in my themes.xml file... <style name="My.Tab.Style" parent="@android:style/Widget.TabWidget"> <item name="android:textAppearance">@style/MyCustomTabTextStyle</item> </style> <style name="MyCustomTabTextStyle" parent="Widget.Sherlock.ActionBar.TabText"> <item name="android:textAppearance">@android:style/TextAppearance.Medium</item> <item name="android:textSize">14sp</item> <item name="android

Android themes change checkbox item text color

余生颓废 提交于 2019-11-28 00:29:45
问题 How do I just change the text color of checkbox views in Android Studio's styles.xml? I want to create a theme where all checkbox items are a color different from the default black like: Except I want the box itself to be the same color as the text. Should I be using the following in my theme? <item name="android:checkboxStyle">@style/App_CheckboxStyle</item> 回答1: I know that this question is asked long time ago but I want to add my solution. It works with all SDK versions. You are right that