android-styles

Extract Support Library layout attributes into styles

不羁岁月 提交于 2019-12-20 00:20:14
问题 I am extracting styles for views which are inside Support Library's GridLayout . Therefore, I have both attributes from the "android" namespace, e.g. android:layout_marginLeft="8dp" and attributes from the "app" (http://schemas.android.com/apk/res-auto) one, e.g. app:layout_columnSpan="2" . First, Android Studio doesn't recognize the attributes from "app" when I try to extract the attributes as a style. Second, it doesn't seem that extracting them into styles.xml manually brings any effect to

Change Activity theme deppending on fragment in use Android

泪湿孤枕 提交于 2019-12-19 10:14:12
问题 I have an activity that switches between several fragments. This activity has a default style, but when i change to some particular fragments i want it to change the style. I've done some research and i got this code that i run in the onCreateView() of a fragment: // create ContextThemeWrapper from the original Activity Context with the custom theme Context context = new ContextThemeWrapper(getActivity(), R.style.GreyTheme); // clone the inflater using the ContextThemeWrapper LayoutInflater

Why does Android Studio highlight “Theme” red in styles.xml?

梦想的初衷 提交于 2019-12-19 08:48:11
问题 Red highlight means Cannot resolve symbol 'Theme' Here are some configurations : styles.xml <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> <item name="android:windowNoTitle">true</item> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowNoTitle">true</item> <

How to make custom windowBackground theme style work on all Android devices?

ぃ、小莉子 提交于 2019-12-19 06:57:09
问题 I am trying to get all of my activities to have a custom theme style that should look like this: This theme works on many devices, including the Nexus 7, the Samsung Galaxy S4, and the Samsung Droid Charge (running Gingerbread). However, on other devices, such as HP Slate 7 and Motorola Droid RAZR, it ends up looking like this: I have the following in my AndroidManifest.xml 's application tag: android:theme="@style/AppTheme" The theme is as follows in res/values/styles.xml : <style name=

How to make custom windowBackground theme style work on all Android devices?

廉价感情. 提交于 2019-12-19 06:57:00
问题 I am trying to get all of my activities to have a custom theme style that should look like this: This theme works on many devices, including the Nexus 7, the Samsung Galaxy S4, and the Samsung Droid Charge (running Gingerbread). However, on other devices, such as HP Slate 7 and Motorola Droid RAZR, it ends up looking like this: I have the following in my AndroidManifest.xml 's application tag: android:theme="@style/AppTheme" The theme is as follows in res/values/styles.xml : <style name=

How to set bold title in Action Bar?

家住魔仙堡 提交于 2019-12-19 05:23:19
问题 I am editing the style xml trying to get the Activity title bold. <style name="MyTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name="android:background">#81CFEB</item> <item name="android:textStyle">bold</item> </style> But only what I can set is the background color desired. I do not why the textStyle is not set to bold. Anyone know

Android Use custom themes to modify style attributes

谁都会走 提交于 2019-12-18 08:49:36
问题 I want to create two themes, GrayTheme and RedTheme, that modify one style attribute. For example here are my two themes, default font color is white, which is fine for both themes: <style name="RedTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:textColor">@color/white</item> </style> <style name="GrayTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:textColor">@color/white</item> </style> But I have a style that I use for Header

Actionbarsherlock - change actionbar line colour

只愿长相守 提交于 2019-12-18 04:16:53
问题 I am currently working on making my application compatible with pre 3.0 devices with the aid of actionbarsherlock. My application has a custom theme which overide Holo.light changing the blue to orange. I am wanting to change the blue line which appears under the actionbar to orange. With the official actionbar I managed this by overriding <item name="android:background">@drawable/ad_tab_unselected_holo</item> Unfortunately this does not seem to be working in actionbarsherlock 4. 回答1: You

datepicker with different style than activity

烈酒焚心 提交于 2019-12-18 02:54:27
问题 I have activities with custom style, I want my activity with a custom title bar so I created below style: <style name="costum_titlebar"> <item name="android:background">@color/titlebar_background</item> </style> <style name="CustomTheme" parent="android:Theme"> <item name="android:windowTitleSize">@dimen/titlebar_size</item> <item name="android:windowTitleBackgroundStyle">@style/costum_titlebar</item> </style> In manifest I use: <application android:allowBackup="true" android:icon="@drawable

Android CollapsingToolbarLayout Title background

与世无争的帅哥 提交于 2019-12-17 23:29:11
问题 I'm working with the CollapsingToolbarLayout from the new Android Design Support Library. I have set its title and it is working fine, the only problem I still have is that when you scroll, the text is lost, depending on the image in the background. What I'd like to do, is set a background to the CollapsingToolbarLayout title, but I haven't find a way to do it. Is there anyway to achieve this? Thanks! Layout: <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content"