android-theme

Change the project theme in Android Studio?

大憨熊 提交于 2019-12-03 07:28:07
问题 I created some project using the light theme and now I want to change it to dark and I can't figure out how to do that. BTW, I'm not asking on how to do it in code, just how to change the project's default theme. 回答1: In the AndroidManifest.xml, under the application tag, you can set the theme of your choice. To customize the theme, press Ctrl + Click on android:theme = "@style/AppTheme" in the Android manifest file. It will open styles.xml file where you can change the parent attribute of

How do I apply the HoloEverywhere android theme when using ActionBarSherlock?

你。 提交于 2019-12-03 07:25:00
问题 I'm building an application that should work on android 2.3 and I added both ActionBarSherlock and HoloEverywhere libraries. In order to use ActionBarSherlock I have to use Theme.Sherlock like so : <application ... android:theme="@style/Theme.Sherlock" ... > And that's ok. My main activity is pretty simple : just a ListView with 5 rows (I don't use ListAcivity). <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height=

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">

Set menu item background color on hover in Android

冷暖自知 提交于 2019-12-03 06:43:14
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" sothree:theme="@style/MyActionBar" android:layout_alignParentTop="true" style="@style/toolbarButton"> ... <

Customizing dialog by extending Dialog or AlertDialog

孤街醉人 提交于 2019-12-03 05:49:00
问题 I want to make a custom Dialog . Because I don't like its style, I want to have rounded rectangle rather than sharp corners. I know how to implement it by theme in AndroidManifest.xml , for example, I use: android:theme="@style/Theme.CustomDialog" And Theme.CustomDialog.xml : <style name="Theme.CustomDialog" parent="android:style/Theme.Dialog"> <item name="android:windowBackground">@drawable/filled_box</item> <item name="android:windowNoTitle">true</item> filled_box.xml <shape xmlns:android=

ResourcesCompat.getDrawable() vs AppCompatResources.getDrawable()

此生再无相见时 提交于 2019-12-03 04:40:46
问题 I'm a bit confused with these two APIs. ResourcesCompat.getDrawable(Resources res, int id, Resources.Theme theme) Return a drawable object associated with a particular resource ID and styled for the specified theme. Various types of objects will be returned depending on the underlying resource -- for example, a solid color, PNG image, scalable image, etc. Prior to API level 21, the theme will not be applied and this method simply calls through to getDrawable(int). AppCompatResources

How to get Holo Light theme working in my Xamarin application

依然范特西╮ 提交于 2019-12-03 04:22:15
I'm trying to get my app to use the Holo.Light theme. I've created a custom theme for Holo and put it in Resourses\values-v11\FsmTheme.xml <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="FsmTheme" parent="@android:style/Theme.Holo.Light"> </style> </resources> I've also created one for older versions and put it in Resourses\values\FsmTheme.xml <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="FsmTheme" parent="@android:style/Theme.Light.NoTitleBar"> </style> </resources> Then I added it to my AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest

Change title color in toolbar?

六月ゝ 毕业季﹏ 提交于 2019-12-03 04:12:03
问题 I have a toolbar that I use, and set title with: ((ActionBarActivity)getActivity()).getSupportActionBar().setTitle("Home"); Is there a way to change the color from black to white? I tried making its own theme and setting it in the xml like this, but no dice: <resources> <!-- Base application theme. --> <style name="AppTheme2" parent="Theme.AppCompat"> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="colorPrimary">@color/primary</item> <item

What theme attributes do I need to override to change the blue highlight color of my dialogs?

蓝咒 提交于 2019-12-03 03:32:57
I have a theme called "greenhighlight" — this theme was generated using the Android Action Bar Style Generator , and inherits from the default ActionBarSherlock theme. The theme does nothing except change the highlight at the bottom of the ActionBar from blue to green. To theme all my activities, I just do: <application android:theme="@style/Theme.greenhighlight"... This works pretty well for activities (note the green highlight on the bottom of the ActionBar): However, I'm having difficulty theming my dialogs to match my activities: My "greenhighlight_Dialog" theme is defined as: <style name=

Dialog themed activity : positive and negative buttons

有些话、适合烂在心里 提交于 2019-12-03 03:02:55
I'm trying to theme an activity as an AlertDialog . The problem I'm facing is that I can't find a way to put two buttons on the bottom of my window that would look like the positive and negative buttons of an AlertDialog I've already added that line to my Activity in the manifest (I'm using Sherlock Library): android:theme="@style/Theme.Sherlock.Dialog" And the Activity is looking exactly like a Dialog, but I can't find a theme to set on the buttons. What could I do? Alright, if you're developping an application for HC/ICS, without Sherlock, the answer is here : https://gist.github.com/2348305