android-styles

Android theme style for button not applying

孤者浪人 提交于 2019-12-03 17:03:23
问题 I have three simple buttons in my main activity view. What I am trying to do is apply a buttonstyle to all my buttons but I fail to do so. Here's my xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/minecraft_portrait" android:alpha="0.75" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="

Android: Background change in styles.xml

[亡魂溺海] 提交于 2019-12-03 13:50:38
I'm trying to change the background color to black in styles.xml. The background changes fine but the actionbar got dirty. Some part of the actiobar background stays the same while the other portion turns black. I don't want the actionbar to change color. Please help <style name="Theme.ApplicationTheme" parent="@style/Theme.Sherlock"> <item name="android:background">#000000</item> <!-- This line is changing the actionbar color --> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> </style> <style name=

applying a theme to an appwidget

主宰稳场 提交于 2019-12-03 13:09:52
问题 i'm trying to define a theme for an appwidget, and have it applied at the application level. i have a theme like, <style name="theme.dark"> <item name="android"background">#000000</item> </style> in my manifest, i set android:theme="@style/theme.dark" at the application. however, when i run the appwidget, it does not pick up the items from the style. i tried setting style="@style/theme.dark" on an individual element in my view layout, and that does work ... but that's not what i want. i don't

How can I get the primary color from my app theme?

狂风中的少年 提交于 2019-12-03 12:44:24
问题 In my Android java code, how can I reference the color "colorPrimary" set in my theme? I have the following theme definition: <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="colorPrimary">@color/myColor1</item> <item name="colorPrimaryDark">@color/myColor2</item> <item name="colorControlNormal">@color/myColor3</item> <item name="colorControlActivated">@color/myColor4</item> </style> I could reference the color resource directly (R.color.myColor1), but I

Styling android search view and drop down list in actionbar

微笑、不失礼 提交于 2019-12-03 11:40:32
问题 In my app, I have a searchview that displays search suggestions. I want the dropdown/spinner and text to be a particular color. Currently the only change I've been able to make is the text color of the inputted text via the following: <style name="MyApp.AutoCompleteTextView" parent="Widget.AppCompat.Light.AutoCompleteTextView"> <item name="android:textColor">@color/white</item> <item name="android:textCursorDrawable">@null</item> <item name="android:background">@color/myBackgroundColor</item>

Android Fixed size dialog dimension- What is Major & Minor?

淺唱寂寞╮ 提交于 2019-12-03 10:25:15
What are these attributes stands for? The difference between major dimension and minor dimension? <style name="Theme.Base.AppCompat.Dialog.FixedSize" parent="android:Theme.Dialog"> <item name="windowFixedWidthMajor">@dimen/dialog_fixed_width_major</item> <item name="windowFixedWidthMinor">@dimen/dialog_fixed_width_minor</item> <item name="windowFixedHeightMajor">@dimen/dialog_fixed_height_major</item> <item name="windowFixedHeightMinor">@dimen/dialog_fixed_height_minor</item> ....... </style> windowFixedHeightMajor : A fixed height for the window along the major axis of the screen, that is,

How to give the user the possibility to switch between different colors skin in your App

假如想象 提交于 2019-12-03 09:55:54
问题 I want to give the user the opportunity to select wich color skin will have the app. For example, i whould implement a black skin with black colours with different tonalities and also a white skin with withe tonalities. Which whould be the best approach to achieve this? For example i know that there is a colors.xml file in Android that should contain the colours of your app. Whould be a way to have two colors files or something and to use one or other depending of user selection? Maybe a

Android: default AppTheme background colors

为君一笑 提交于 2019-12-03 08:16:57
问题 What are the default background colors for Activities in Android's AppTheme style? I'm looking for the hex code, or something that I can reference. It should be one for the LIGHT theme and one for the DARK theme. Or where can I look them up? I'm confused by all the files and can't find the place where they actually say the color. Thanks for your help. Update: I found entries in the SDK in /data/values/colors.xml , which are referenced by @android:color/background_holo_light @android:color

How to add custom item in android Theme declaration?

我是研究僧i 提交于 2019-12-03 07:04:06
I'm having few custom themes in my styles.xml Now whenever the activity takes the theme, it uses the colorPrimary , colorPrimaryDark and colorAccent values. For my layout's background I'm using ?attr/colorAccent , so it can pick the background color based on the selected theme. If I use any of the above values it works fine. But I want to define a custom item value for my background color. I tried like this below but it didn't worked. any ideas to make it work ? My custom theme with custom value: <style name = "customTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">

How to set height of actionbar tabs for android

久未见 提交于 2019-12-03 06:15:35
Basically, I want to change the height of the tabs in actionbars. This questions has been asked several times on stackoverflow, for example: ActionBar tabs height I have tried most of the solutions but nothing work, here is my code. <style name="CustomActionBarTheme" parent="@android:style/Theme.Holo"> <item name="android:scrollHorizontally">false</item> <item name="android:paddingLeft">0dp</item> <item name="android:paddingRight">0dp</item> <item name="android:actionBarSize">80dp</item> <item name="actionBarSize">80dp</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle<