android-theme

Android: making a fullscreen application

最后都变了- 提交于 2019-11-26 15:37:37
问题 What is the simplest change that I can make to a new Blank Activity, as created by the latest version of Android Studio, to get the app to appear fullscreen? I want to create a fullscreen Android application. I'm working with Android Studio. This post suggests that I add a line such as ... android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" ... to the AndroidManifest.xml file, as shown below: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas

Change background popupMenu in Android

淺唱寂寞╮ 提交于 2019-11-26 14:38:40
问题 I tried to change background of popupmenu, but my implementation does not work. This is my code: <style name="MyHoloLight" parent="android:Theme.Holo.Light"> <item name="android:popupMenuStyle">@style/popupMenuStyle</item> </style> <style name="popupMenuStyle" parent="@android:style/Widget.PopupMenu"> <item name="android:popupBackground">@color/bgPopumMenu</item> </style> Apply in AndroidManifest.xml <application android:hardwareAccelerated="true" android:label="@string/app_name" android:icon

Implementing user choice of theme

 ̄綄美尐妖づ 提交于 2019-11-26 14:08:51
I want to give the user the choice between a few different themes, and was wondering if this is an alright way of doing things. I did a little test with this method and it worked, but I think there may be better ways and think it may cause some problems later on, so wanted to ask. I was thinking of creating a different layout for each theme, and in onCreate just having a switch for the setContentView() method. I'd load a saved SharedPreference value (integer) first and depending on what that value was display the corresponding layout. Obviously the user could change the SharedPreference value

How to hide status bar in Android

筅森魡賤 提交于 2019-11-26 13:05:57
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 attribute android:theme="@android:style/Theme.NoTitleBar.Fullscreen" in manifest i was unable to scroll to

What are the default color values for the Holo theme on Android 4.0?

余生颓废 提交于 2019-11-26 12:49:39
问题 Does anyone have access to a list of the default colours used in the Holo them (light and dark) on Android 4.0? I\'m looking for things like list backgrounds, primary and secondary text, ActionBar, etc. Google gives some examples at the Themes and Color style guidelines, but they don\'t really go into the actual color values being used. I can grab them from the images, but I’d rather use something a little more accurate. 回答1: perhaps this is what you're looking for: https://github.com/android

Switching application-wide theme programmatically?

若如初见. 提交于 2019-11-26 12:11:55
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", "theme_twilight"); setTheme(someOtherChosenTheme); But that seems messy, and I'd rather set the theme for the

How to set Toolbar text and back arrow color

半世苍凉 提交于 2019-11-26 11:49:58
问题 Toolbar background is dark color, I want text and back arrow to be white. I tried following, but it doesnt work. <style name=\"Theme.MyTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\"> <item name=\"colorPrimary\">@color/blue</item> <item name=\"colorPrimaryDark\">@color/blue_darker</item> <item name=\"colorAccent\">@color/purple</item> <!-- item name=\"android:textColorPrimary\">@color/white</item--> // I don\'t want to set this, changes everywhere. <item name=\"android:textColorSecondary

How to reference style attributes from a drawable?

随声附和 提交于 2019-11-26 11:07: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 in Views, and not in Drawables . For example, referencing a value from a View inside a layout works: <TextView

How can I style an Android Switch?

老子叫甜甜 提交于 2019-11-26 11:00:57
The switch widget introduced in API 14 is styled by default with holo theme. I want to style it slightly different, changing its colors and shape a bit for branding reasons. How does one go about this? I know it must be possible, as ive seen the difference between default ICS and Samsung's touchwiz theme I assume I'll need some state drawables, and I've seen a few styles in http://developer.android.com/reference/android/R.styleable.html with Switch_thumb and Switch_track that look like what I might be after. I just don't know how to go about using them. I'm using ActionbarSherlock if that

How do I style appcompat-v7 Toolbar like Theme.AppCompat.Light.DarkActionBar?

ⅰ亾dé卋堺 提交于 2019-11-26 10:06:21
问题 I\'m trying to recreate the look of Theme.AppCompat.Light.DarkActionBar with the new support library Toolbar. If I choose Theme.AppCompat.Light my toolbar will be light and if I choose Theme.AppCompat it will be dark. (Technically you have to use the .NoActionBar version but as far as I can tell the only difference is <style name=\"Theme.AppCompat.NoActionBar\"> <item name=\"windowActionBar\">false</item> <item name=\"android:windowNoTitle\">true</item> </style> Now there\'s no Theme