android-theme

My action bar title is taking the wrong color from theme

不打扰是莪最后的温柔 提交于 2019-12-11 11:44:40
问题 I'm attempting to modify the theme for my application. I've been able to successfully set the background color for my app, and the background color for my action bar. Unfortunately, the background color of the items WITHIN the action bar are taking the background color of the app, not the bg color of the action bar. Here's my code from styles.xml <!-- Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. --> <style name=

ActionBarSherlock mirrod attributes — when to use “android:” prefix?

独自空忆成欢 提交于 2019-12-11 10:08:48
问题 When styling ActionBarSherlock I was wondering when I have to use the prefixed attribute, when the non-prefixed attribute, and when both. For example: <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> I found this explanation on the ActionBarSherlock website: Mirrored Attributes Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android

Why don't AppCompat v21 SearchView styles work in my app?

百般思念 提交于 2019-12-11 09:14:51
问题 I am trying to follow the "SearchView Widget" section in this blogpost to style my SearchView. I have added searchIcon , queryBackground and submitBackground values in my res/values-v21/styles.xml but the styles don't seem to apply: I am posting the code of the SSCCE and also posting the zipped eclipse project here , in case somebody will like to try it. SSCCE res/values-v21/styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="AppBaseTheme"> <!-- <item

use phone wallpaper as app background - Theme.Wallpaper like behaviour

孤人 提交于 2019-12-11 07:22:14
问题 I wanted to use Theme.Wallpaper in my app. This theme uses the phones current wallpaper as a background. The problem is it doesn't work on a 4.1 device. I also tried recreating the Theme.Wallpaper in my style resources but again it doesn't work for 4.1 devices. - note that it may not work for lower APIs as well, I only confirmed it working on 2.2.1 and not working on 4.1. I would like to know why it doesn't work and if there is any solution to that. 回答1: I have finally found the answer, it's

How to make a custom tite bar without changing the AppTheme to CustomTheme?

≡放荡痞女 提交于 2019-12-11 06:51:35
问题 I dont like how the CustomTheme looks and I want to keep the AppTheme. but when I use a customized title bar with AppTheme it crashes telling me I cant combine numerous styles. How can I do that? Thanks! 回答1: First crate your own custom layout for the ActionBar tab_header.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:gravity="center" android:layout_height="match_parent"> <TextView

getTheme().applyStyle(…) multiple times without overwriting the previous one

橙三吉。 提交于 2019-12-11 04:23:08
问题 When I apply extra attributes to the AppTheme multiple times it overwrites the previous one. This is the code I am using: MainActivity: @Override protected void onCreate(@Nullable Bundle savedInstanceState) { getTheme().applyStyle(R.style.AppTheme_OverlayPrimaryRed); // If you change `false` to `true`, the overlay above is overwritten. if (false) { getTheme().applyStyle(R.style.AppTheme_OverlayAccentRed); } super.onCreate(savedInstanceState); ... } AppTheme.OverlayPrimaryRed: <style name=

android-button background drawable doesn't work

亡梦爱人 提交于 2019-12-11 03:22:07
问题 this is my xml drawbale code with the name of btntheme.xml : <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/customactionbartheme_btn_default_normal_holo_light" android:state_enabled="true" android:state_window_focused="false"/> <item android:drawable="@drawable/customactionbartheme_btn_default_disabled_holo_light" android:state_enabled="false" android:state_window_focused="false"/> <item android:drawable="@drawable/customactionbartheme

Material Design support below Lollipop - crashes

和自甴很熟 提交于 2019-12-11 02:47:26
问题 I've been trying to implement the Material Design theme, following these instructions. I'm not using ToolBar (must I?) ALL my Activities extends ActionBarActivity. Using getSupportActionBar() all across the project. I'm compiling and targeting to API 21 in gradle (minimun is API 15). My <application> tag contains android:theme="@style/AppTheme" Running the application on Lollipop device (with a specific v21 similar theme works). My styles.xml: <style name="AppBaseTheme" parent="@style/Theme

How to use Android's AppCompat theming application-wide?

人走茶凉 提交于 2019-12-11 02:19:20
问题 IDE : Android Studio 1.1.0 ENV : Debugging on usb-connected phone using Android API v10. I'm trying to use AppCompat to support Android API v8 and up. Compiles fine but crashes when the activity is drawn, saying: lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. ...however, in AndroidManifest.xml I have: <application android:name=".objects.PikCMS" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app

Holo light color code of Navigation drawer

半城伤御伤魂 提交于 2019-12-11 01:32:07
问题 What is the hex color code of the background of the view you draw out in the navigation drawer in the image (the left one) below? I found https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/colors.xml but cant seem to find the correct color. 回答1: Based on the screenshot, the background of the Option 1 element is #e7e8e9. 来源: https://stackoverflow.com/questions/17031727/holo-light-color-code-of-navigation-drawer