I am developing an application for Android and I'm using the API level 8. However I would like this app would use the theme of ICS when running on Froyo and Gingerbread because the theme of the ICS is much more beautiful. I wish that at least the color scheme and shape of the buttons were equal. Is there any way to do this?
The first thing you might want to look at is ActionbarSherlock as it adds a lot of consistency to your pre-ics code, even though this is not directly related to the theme.
Then take a look at the HoloEverywhere project on GitHub for using the Holo theme on apps designed for pre-ics devices.
The best i found is android-holo-colors in which you will get all the controls and also can choose holo-light or holo-dark with custom colors you want.
I hope this will help you
The SDK folder contains most of the themes, styles and drawables used in ICS. Check
SDK folder\platforms\android-15\data\res.
You can apply themes/styles in your app like this
Related
If we want to support both Lollipop and pre-Lollipop devices for an app with Material design which among the following is the right method ?
Use Android Support Library alone: Use only support library for the whole app and don't use any of the API 21. I have tested this and it works in emulator. I could get the material features in a Lollipop device in emulator.
Use both API 21 and Android Support Library simultaneously in the App: Provide alternative styles, alternative layouts etc... one using API 21 and other one using Android Support Library as mentioned in Android's documentation.
My confusion is, if I am going with option 1, is it the right approach for Lollipop devices ? Will that be lesser memory efficient ?
Otherwise if I am going with option 2, will it be an overkill if that is not actually required ?
Also in 2nd option, for using Toolbar, we can have alternative layouts in two folders (layouts and layouts-v21) with layout in first folder using android.support.v7.widget.Toolbar and layout in second folder using Toolbar.
But to have it set as ActionBar it is sufficient for Lollipop to have the activity to inherit from Activity class. But pre-Lollipop will need to inherit from ActionBarActivity. So will we need to have two activity files too ?
Please point out if I have blurted out any blunders.
Some features are only available in v21 like riplle effect, so if you want to use ripple effect in your app than use both support library for back support and v21 for lollipop.
Use custom XML/Java for pre lollipop, for lollipop just add your animation/design in v21 folders
As in my question title, is it a default theme in Android or I need to do it manually? I want to have it from Froyo devices and above. Any guideline or hint to achieve it?
Are you asking for the Holo theme for older Android versions than 3.0? If you do, then take look at the library HoloEverywhere: https://github.com/ChristopheVersieux/HoloEverywhere
Many developers use it and it does exactly what you expect.
Can the background for the CAB (contextual action bar) in android, be changed?
I am using it in my application, and when the application is installed on a tablet (3.0 - 3.2 API) the CAB has a yellow color and one look, and when the application is installed on phone with 4.0+ API it has some kind of blue background and another look.
Can I do sth about this and have the same look everywhere?
note: my application is intended to run on 3.0+ api's
You could do this by defining your own themes. Use one of the standard themes (in your case you can use Theme.Holo since you are targeting Honeycomb+) as a start point and customize (i.e., override) those pieces that you want to change. In your case you would customize just the style for the CAB.
The Styles and Themes section of Android dev site introduces you to this in brief. Two additional places to look for real world example of how this has been done are:
Actionbar Sherlock. Look at the actual library source (rather than the samples).
Google IO 2012 app.
I have used several applications which appear to use Android 4.0's 'Holo' theme, whilst still running on an older version of Android (2.3). Is there a supported way to do this or have these developers designed their own custom themes?
Thanks.
I am working on this:
https://github.com/ChristopheVersieux/HoloEverywhere
EDIT: Moved to: https://github.com/Prototik/HoloEverywhere
Might be really fit your needs.
Look here SDK/platforms/android-15/data/res/
There are all styles and related resource data used on latest Android 4.
You can also download it from here:
https://github.com/android/platform_frameworks_base/tree/master/core/res
And you can grab what you need from here to your app. Only remove android: prefix to use it in you project. This is only way how to defines the same theme as is used in the latest Android versions.
I'm developing an app for Android 2.2 and higher.
I use the great ActionBarSherlock (thank you, Jake Wharton !!) to use the action bar on pre-ICS devices.
While the actionbar looks great, all other gui elements have the look of the default theme of the device (in my case HTC Sense 3).
Is there a possibility to style my (>= Android 2.2) app on all android devices with the Holo.Dark.Theme?
I compile my app with Android 4.0.3, the minSDK version is 8.
Enjoy HoloEverywhere, that's the whole purpose of the project!
(Edit) new adress: https://github.com/Prototik/HoloEverywhere
No. That would require a back port of the complete Holo theme and styling, which Google chose not to do. It would also be a rather ambitious undertaking and I would think it is out of scope of the ActionBarSherlock project, whose focus is on ActionBar compatibility.
The best you can do is cherry pick the resources you most want from the ICS source and create your own custom theme/styles.