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.
Related
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.
I want to customize time picker style to default style in Android 4. I want to use this style either I am using Android 2.2 or any version.
You can take a look at Holo Everywhere library which aims to port Holo theme for android 1.6 onwards here: https://github.com/ChristopheVersieux/HoloEverywhere
You'll need to get the TimePicker's source code with all classes & resources that are required, put in in your project and then use them instead of the one's provided by the platform itself.
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
Considering Android Design Guidelines announcement what is the best way to make apps which are compliant with them on Android 2.x phones? E.g. what is the best way to implement the ActionBar pattern?
ActionbarSherlock is a starting point. It includes the compatibility libraries from Google and comes provided as a project rather than JAR offering greater flexibility, should you need to alter anything. Version 4 is on the way which will also include ICS stuff.
As far as I am aware I believe ABS is backward compatible to 1.6, and makes use of the minSdkVersion and targetSdkVersion. It uses an extended version of the holo theme to create a light and dark version that includes the extra ActionBar goodness, which in turn you can extend to style your app.
I recorded a tutorial on YouTube to get people started.
I think it's better to use the compatibilty libraries directly, instead of another library based on those. Additionally, refer to the Google I/O App as stated at the bottom of the first link I gave. You can find the best practices about implementing a UI for several devices with compatibility libraries.
I found ActionBarSherlock to be pretty good. It will emulate ActionBar on older devices and use the native one on modern ones. It's an extension to Android compatibility library - so you will also get fragments and other ICS stuff.
In the guidelines found in http://developer.android.com/guide/practices/ui_guidelines/index.html for menu and status icons, we have distinctive design approach for Android 2.2 and earlier and Android 2.3 and later.
My app is going to support Android 2.2 and later. I was thinking that i should follow the 2.3 and later guidelines.
Do you agree?
You can follow multiple styles by creating subfolders with the correct android version specifiers inside your res/ folder (e.g. drawable-v11 for API 11 - check the official documentation here). So I suggest supporting multiple styles.
This is obviously a bit more work. To make this easy for standard icons like notifications, check out the Android Asset Studio. This is a small webapp that creates these icons to your specifications and builds a zip with the multiple styles, already sorted into the different res/ subfolders.
On thing you could do is include assets for both builds, and at run time, figure out if you're on 2.2 or 2.3, and show the appropriate assets. This can be done with build.version or this method for earlier releases.
Of course, if you want multiple icons, I don't believe this method would work, as that needs to be build into the android manifest.