android-theme

How to change color / appearance of EditText select handle / anchor?

北城余情 提交于 2019-11-26 09:39:46
问题 So I changed the style of the Holo Theme with the Holo Colors Generator and Action Bar Style Generator to my own color. But when I select text inside an edit text, the \"markers\" at the selected positions are still blue. How can I change it? 回答1: The worst part here was to find the "name" for this item and how it is called inside the theme. So I looked through every drawable in the android SDK folder and finally found the drawables named "text_select_handle_middle", "text_select_handle_left"

How to use device default theme for app?

流过昼夜 提交于 2019-11-26 08:05:59
问题 I have an app that I want to develop for Android 2.1, 2.2, 2.3.3, 3.0/3.1 and 4.0.x. Between those API levels, there are about 3 different types of Themes. The latest 4.0.x theme is Holo. Anyways, I want my app to use the default Android theme for whatever device it\'s on. If it\'s on a 4.0.x device, I want it to use Holo. If it\'s on 2.3.3 I want it to use the theme from that version of Android. etc... Is there a simple way to approach this? I noticed that with 4.0, they added a Theme

How to use Holo.Light theme, and fall back to 'Light' on pre-honeycomb devices?

不想你离开。 提交于 2019-11-26 06:55:41
问题 I\'d like to use the Holo.Light theme on devices that support it, and fall back to the regular Light theme on other devices. At the moment, referencing Holo.Light works fine on 3.0+, but older APIs simply revert to the default \'dark\' theme. Can I achieve what I want with with style inheritance? 回答1: You have to create a custom theme and save it in some directories to finally set this theme as the default one for the app First, in values add a themes.xml like this: <?xml version="1.0"

Set theme for a Fragment

穿精又带淫゛_ 提交于 2019-11-26 06:34:21
I'm trying to set the theme for a fragment. Setting the theme in the manifest does not work: android:theme="@android:style/Theme.Holo.Light" From looking at previous blogs, it appears as though I have to use a ContextThemeWrapper. Can anyone refer me to a coded example? I can't find anything. Setting Theme in manifest is usually used for Activity. If you want to set Theme for Fragment, add next code in the onCreateView() of the Fragment: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // create ContextThemeWrapper from the original

How to hide status bar in Android

不问归期 提交于 2019-11-26 03:38:17
问题 I referred this link. In that if the user clicks on EditText(for ex To: ) at that time keyboard will be popped out and at the same time the user can be able to scroll to see all remaining views(ex: compose,subject, send button) in that screen. Similarly in my app I have one activity in that I am having some widgets or views. Suppose if the user clicks on Edittext which is in my Activity then keyboard is popping out and i can be able to scroll to see remaining views. But if i give this

Switching application-wide theme programmatically?

家住魔仙堡 提交于 2019-11-26 02:53:44
问题 I\'m attempting to get a user-chosen theme and feel like I\'m frustratingly close. Defining the theme in AndroidManifest.xml works as it should, but (as best I can tell) can\'t change based on app preferences: <application android:theme=\"@style/theme_sunshine\" android:icon=\"@drawable/icon\" android:label=\"@string/app_name\"> Alternatively, setting it dynamically in each activity also works: someChosenTheme = PreferenceManager.getDefaultSharedPreferences(this).getString(\"themePreference\"

How to: Define theme (style) item for custom widget

做~自己de王妃 提交于 2019-11-26 02:39:54
问题 I\'ve written a custom widget for a control that we use widely throughout our application. The widget class derives from ImageButton and extends it in a couple of simple ways. I\'ve defined a style which I can apply to the widget as it\'s used, but I\'d prefer to set this up through a theme. In R.styleable I see widget style attributes like imageButtonStyle and textViewStyle . Is there any way to create something like that for the custom widget I wrote? 回答1: Yes, there's one way: Suppose you

How to reference style attributes from a drawable?

試著忘記壹切 提交于 2019-11-26 02:17:32
问题 I want to have 2 selectable themes for my application. In order to do that, I defined some attributes, like this: <attr format=\"color\" name=\"item_background\" /> Then, I created both themes, like this: <style name=\"ThemeA\"> <item name=\"item_background\">#123456</item> </style> <style name=\"ThemeB\"> <item name=\"item_background\">#ABCDEF</item> </style> This method works great, allowing me to create and modify several themes easily. The problem is that it seems that it can be used only

Set theme for a Fragment

空扰寡人 提交于 2019-11-26 02:06:01
问题 I\'m trying to set the theme for a fragment. Setting the theme in the manifest does not work: android:theme=\"@android:style/Theme.Holo.Light\" From looking at previous blogs, it appears as though I have to use a ContextThemeWrapper. Can anyone refer me to a coded example? I can\'t find anything. 回答1: Setting Theme in manifest is usually used for Activity. If you want to set Theme for Fragment, add next code in the onCreateView() of the Fragment: @Override public View onCreateView

Caused by: java.lang.UnsupportedOperationException: Can&#39;t convert to dimension: type=0x1

感情迁移 提交于 2019-11-26 01:08:21
问题 In Android I got following Error in emulator and some mobile device but not in Tablet : I can\'t understand what is the error actually? I have searched many tutorials but can\'t find any solution. Please Help me to solve this. Note: In this application i have used ActionbarSherlock and theme, may i got because of that library or any other problem? My Error Log is: 09-11 17:52:57.342: E/AndroidRuntime(9935): FATAL EXCEPTION: main 09-11 17:52:57.342: E/AndroidRuntime(9935): android.view