android-theme

How to override styles of a library which has its own Activity

不想你离开。 提交于 2019-12-21 08:23:52
问题 I have a library which has its own Activities with colorPrimary and colorPrimaryDark attributes. In the application which is using this library, there are different values for these color attributes. Is there a way to make the library use the style provided by the caller application? So that in the end, if the app has a green toolbar, the activities in the library would have a green toolbar, not the one defined in library theme. This is the library's theme: <style name="LibraryTheme" parent=

How to override styles of a library which has its own Activity

拥有回忆 提交于 2019-12-21 08:22:43
问题 I have a library which has its own Activities with colorPrimary and colorPrimaryDark attributes. In the application which is using this library, there are different values for these color attributes. Is there a way to make the library use the style provided by the caller application? So that in the end, if the app has a green toolbar, the activities in the library would have a green toolbar, not the one defined in library theme. This is the library's theme: <style name="LibraryTheme" parent=

Inherit editText from Theme.Light with Holo parent theme

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 05:02:23
问题 I want to inherit the editText from android:Theme while my parent theme is android:Theme.Holo.Light . Is there any "clean" way to do this short of copying the resources from the android sdk folder into my project? 回答1: So my idea would be to have a custom theme (really just a style) that extends from android:Theme.Holo.Light , and then overwrites the EditText attributes to use the parent settings from android:Theme . It looks like android:Theme.Holo.Light uses an editTextStyle attribute

How to change SearchView elements' color?

孤街浪徒 提交于 2019-12-21 03:36:30
问题 I want to use SearchView in my project, but I have a problem with elements' color. Let me show you: its fragmentDialog where I have my SearchView I dont need to change bg color. The next picture is for example. I want to see SearchView elements without black bg. I have tried to change theme change style change tint but nothing is working. The search icon and anoter elements still white. Maybe I'm losing something? Can I do this in XML? Please, help me. 回答1: You need to use android.support.v7

Set menu item background color on hover in Android

有些话、适合烂在心里 提交于 2019-12-20 20:15:08
问题 I have menu items in my app, and I would like to change color of item background, when it is clicked (please see screenshot - item 1 is clicked) I just want one color here - either light blue, or dark one. However, as you can see, there are two of them on the first item. Here is my code: Toolbar in activity: <android.support.v7.widget.Toolbar xmlns:sothree="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_toolbar"

Toolbar Search Suggestions Theming

非 Y 不嫁゛ 提交于 2019-12-20 10:41:39
问题 I’m trying to change search suggestions to “light theme”. I’m using appcompat-v7:22.2.0 library and read about new feature for customizing search view widget (android.support.v7.widget.SearchView). FIRST TRY SECTION Toolbar <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android

Applying AppCompat theme to individual preferences in a PreferenceFragment

让人想犯罪 __ 提交于 2019-12-20 09:54:12
问题 I have been wrestling with trying to get my PreferenceFragment to have the same Material-based theme and styling (via AppCompat) as the rest of my application. The PreferenceFragment that I am using to manage all of my application settings is shown below: As you can see from the screenshot above, I was able to customize the PreferenceFragment by using colorAccent , colorPrimary , and a few other attributes. My theme for the PreferenceFragment is as follows: <style name="settingsTheme" parent=

Android Material Design: Failed to find style 'toolbarStyle' in current theme

最后都变了- 提交于 2019-12-20 09:53:55
问题 I am trying to use the toolbar widget in android 21 with a custom style but I can't get rid off this error : Failed to find style 'toolbarStyle' in current theme . Here is my layout xml file : <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/patient_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:theme="@style/AppTheme.Patient" /> Here is the Patient theme : <resources> <!-- Base application theme. --

Android Material Design: Failed to find style 'toolbarStyle' in current theme

可紊 提交于 2019-12-20 09:50:13
问题 I am trying to use the toolbar widget in android 21 with a custom style but I can't get rid off this error : Failed to find style 'toolbarStyle' in current theme . Here is my layout xml file : <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/patient_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:theme="@style/AppTheme.Patient" /> Here is the Patient theme : <resources> <!-- Base application theme. --

Theme preview fails in Eclipse

元气小坏坏 提交于 2019-12-20 09:33:30
问题 I have made a simple username/password dialog to which I want to apply a theme (it basically defines windowBackground ) and would also like to preview in Eclipse . I see that my theme is displayed along other themes in the Theme combo box, but selecting it produces the following error: Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'textViewStyle' in