android-theme

Overriding text color for buttons not working

有些话、适合烂在心里 提交于 2019-12-10 16:28:54
问题 I've created a custom theme for a button bar using buttonBarStyle on each button and buttonBarButtonStyle on the layout. It works fine, but i want to change the text color for the buttons, but it still takes the default color (@android:color/primary_text_holo_light) My code is: <style name="ButtonBarTheme" parent="AppTheme"> <item name="buttonBarStyle">?android:attr/buttonBarStyle</item> <item name="buttonBarButtonStyle">?android:attr/buttonBarButtonStyle</item> <item name="android:textColor"

Using theme references in XML drawables requires API level 21

北战南征 提交于 2019-12-10 14:33:23
问题 Is there a way to make following code compatible with lower API levels: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?android:attr/selectableItemBackground"/> <item android:gravity="bottom"> <shape android:shape="rectangle"> <size android:height="1px"/> <solid android:color="#ccc"/> </shape> </item> </layer-list> The part: android:drawable="?android:attr/selectableItemBackground" produces this message: Using theme references in XML drawables

DatePickerDialog with theme Holo Light?

巧了我就是萌 提交于 2019-12-10 12:45:59
问题 How is it possible to get a DatePickerDialog with Holo Light theme? When creating a DatePickerDialog as follows: DatePickerDialog dpd = new DatePickerDialog(new ContextThemeWrapper(this, android.R.style.Theme_Holo_Light_Dialog_NoActionBar), new DateListener(v), mTime.year, mTime.month, mTime.monthDay); or with theme android.R.style.Theme_Holo_Light or android.R.style.Theme_Holo_Light_Dialog , I get a date picker with a standard title and standard buttons. I tried to use a custom theme with a

Wrong render order for button when material theme is applied

百般思念 提交于 2019-12-10 12:36:02
问题 Button widget draws on top of any other widget no matter what the layout structure is. It repeats in both RelativeLayout and FrameLayout when Material Dark/Light theme is applied. Check out the screenshots below for better illustration of this strange behaviour. Checked on Nexus 4 and Nexus 5. However I doubt it is related to devices. 回答1: Android 5.0 Lollipop along with Material Design introduced new property to specify the elevation (Z-index) of widgets. It is described here. To draw the

Material Design's 500 colors not enough contrast with white

天大地大妈咪最大 提交于 2019-12-10 12:08:08
问题 I tried Android Studio's Theme Editor today and got some warnings from it. According to the material design guidelines, I should use 500 as the primary colors but why is that the Theme Editor says that my primary color (Material Light Blue 500) doesn't have enough contrast with my textColorPrimary(#ffffff)? I also think that by not having the correct colors, my app title gets a black color on the recent apps screen which should be white. 回答1: The text color in Recent apps gets computed

Change Activity Theme From a Fragment

不问归期 提交于 2019-12-10 10:57:49
问题 I have a settings PreferenceFragment that allows the user to select a theme. The user can select a dark or light theme. After selecting a theme the user presses the back button to return to the previous fragment. This called the containing activity's onCreate method where the theme is read and applied. However the theme is not applied correctly, Switching from Holo.Light to Holo.Dark changes the background colour, action bar etc but does not change the text resulting in faded, hard to read

Applying a theme to v7 Support Action Bar

三世轮回 提交于 2019-12-09 18:01:16
问题 I am using the support v7 library to implement ActionBar in my app..I have this in my styles.xml file <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:actionBarStyle">@style/ActionBarTheme</item> </style> <style name="ActionBarTheme" parent="android:Widget.ActionBar"> <item name="android:background">#FFFF0000</item> </style> </resources>

Android : AccountPicker set Light Theme

会有一股神秘感。 提交于 2019-12-09 15:59:20
问题 Is it possible to set the theme of picker dialog ? import com.google.android.gms.common.AccountPicker; .... String[] accountTypes = new String[]{"com.google"}; Intent intent = AccountPicker.newChooseAccountIntent(null, null, accountTypes, false, null, null, null, null); activity.startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT); My base app theme is android:Theme.Light but that dialog is dark. Thanks. 回答1: If you wish to change the theme of the dialog, you should change the

Custom background color for selected item with “activatedBackgroundIndicator” Navigation Drawer

ⅰ亾dé卋堺 提交于 2019-12-09 14:45:51
问题 This question has been asked a lot on SO, and I have referenced all the answers. I am still left with the default Holo blue background for selected items on my navigation drawer. I am new to Java and I am confused about the "context" part of .setAdapter() . My project is a single Activity with multiple fragments swapped using the nav drawer. Here is my adapter: mDrawerListView.setAdapter(new ArrayAdapter<String>( // First parameter - Context getActionBar().getThemedContext(), // Second

Set Android Theme.Light for Alert Dialog

﹥>﹥吖頭↗ 提交于 2019-12-09 07:39:50
问题 I am trying to set the android Theme.Light theme for my alert dialog, but with no success so far. After reading a few tutorials I gathered that using AlertDialog.Builder we cannot set the theme directly in the constructor (atleast in API level 7). The alternate solution that I found is using a ContextThemeWrapper , which everyone assured would solve my problem. So I coded something like this: AlertDialog.Builder builder = new AlertDialog.Builder( new ContextThemeWrapper(context, R.style.popup