How to use Holo.Theme in ActionbarSherlock? - android

I was using Theme.Holo as parent in my application before trying to target lower versions of Android OS. To adapt my application to older versions, I have to use ActionBarSherlock library. But it requires the theme of the application be one of ActionBarSherlock's own themes (Theme.Sherlock.Light.DarkActionBar instead of Theme.Holo).
I still need to use Theme.Holo. But it is not possible by default.
Are there any modifications done do make this happen?

Holo theme is not known to older versions of android, ActionBarSherlock defines necessary parts of Holo Style for ActionBar.
If you need to have Same look on older versions (Although it doesn't look native) you can use HoloEverywhere Library.
As an alternative you can generate Holo-Styled drawables using Android Holo Colors Generator Project

Related

Is AppCompat libraries still neccessary?

With the number of users moving to 7+ android version, is AppCompat still necessary or can I use the new libraries instead. This is specially related to styling. I want to switch to the Material design library for styling. What i'm asking is, is it recommend to use the new Material design library versus AppCompat?
The Material Design Components are built on top of AppCompat, so while you may use Material styles in place of AppCompat, you still need AppCompat under the hood to provide a consistent base across all API levels. This also means you need to continue to extend AppCompatActivity, etc.

Dumping AppCompat for API 21

So I'm creating an app that is Lollipop 5.0 API 21 and up with zero interest in supporting older devices. Do I still need the appcompat library when using Material Design like UI elements & layouting (sidebar aka nav bar, ink, etc) ? When stripping it down I often encounter crashes when trying to move away from the AppCompat stuff. Changing activity types from the AppCompat one to the Normal one, I end up with problems regarding dependencies on layout types like the coordinator layout that aren't there.
I'm still new to android and this is very confusing, as my theme is currently in limbo somewhere between the appcompat theme & material design when I tried to change it from one of the template.
I've read that this is an android studio issue because it always uses appcompat regardless of your set dependencies & minimum API levels. Forcing you to manually override every implicit hidden appcompat call.
When trying to dump AppCompat, what changes to I need to do to make that happen ? Manifest, Activities, Menus, Layout, Styles ? It seems to touch all these things. If going exclusive without Appcompat, do you still need the v21 folders or will it grab the default ones ?
Do I still need the appcompat library when using Material Design like UI elements & layouting (sidebar aka nav bar, ink, etc) ?
If you are using classes out of the Design Support library, such as NavigationView, you generally need to use appcompat-v7 and AppCompatActivity. As of early May 2016, Google has not shipped a Design Support library analogue that works with Theme.Material. You may be able to find third-party library replacements for some of those widgets, and seasoned Android developers can sometimes "cross-port" these components to eliminate the appcompat-v7 dependencies.
I've read that this is an android studio issue because it always uses appcompat regardless of your set dependencies & minimum API levels. Forcing you to manually override every implicit hidden appcompat call.
The only place that Android Studio really cares about appcompat-v7 is in the new-activity wizards, which you do not have to use.
When trying to dump AppCompat, what changes to I need to do to make that happen ? Manifest, Activities, Menus, Layout, Styles ?
That is difficult to answer in the abstract. You would need to:
Stop using Design Support library widgets and containers
Stop inheriting from AppCompatActivity
Change your app: attributes in your menu resources to their android: equivalents
Change your theme to not use Theme.AppCompat
If going exclusive without Appcompat, do you still need the v21 folders or will it grab the default ones ?
-v21 resource directories are not tied to appcompat-v7. They will still be used, on API Level 21+ devices.

Android lollipop UI in KitKat

I am developing an android app and I would like to have android l ui on it even for KitKat. I have seen apps like inbox and pushbullet to use this such as the rotation of the circle button and the status bar recolor. How do they do this?
Make use of the Android Support Library to maintain backwards compatibility.
According to the documentation:
The v7 Support Libraries r21 and above includes the following material
design features:
Material design styles for some system widgets when you apply one of
the Theme.AppCompat themes.
Color palette theme attributes in the Theme.AppCompat themes.
Source: https://developer.android.com/training/material/compatibility.html

What is an AppCompat theme in android?

I'm just starting with Android development so bear with me. I've downloaded Android Studio, and when i start a new project it a theme called Theme.AppCompat.Light (even tough I've selected Holo Light when creating a new project). So my question is, why does android use this and what is it useful for? I've tried changing it to android:Theme.Holo.Light but it just gives me an error:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
I'm using this SDK configuration:
android:minSdkVersion="7"
android:targetSdkVersion="18"
So my question is, why would you use AppCompat, and what do i have to do to enable my app to use the Holo theme.
My activity class is just the default that is generated (it extends ActionBarActivity).
Holo Themes were introduced in API level 14.
Change your android:minSdkVersion="7" to android:minSdkVersion="14"
If you want to keep it 7 at least, use this project to get the Holo themes: HoloEverywhere
That's because you use SDK 7 (Android 2.1) which knows nothing about Holo.
The Android Team provides a compatibility theme that looks (almost) like Holo.
On a side node you should switch to SKD 10 at least, It will make your life a lot easier.
See the ActionBar was introduced in API 11 so after that to make backward compatible Google released the support library. You and read about that here Android Support Library here you can also find how to use them in your app.Not only for Action Bar Google has support library for backward compatibility for many new features available on new devices and make them work on older devices.
The Default Activity when creating the project inherits from ActionBarActivity on min api level 15 or above, I changed this to Activity and now my activity inherits from Activity. Now I can change to Holo or other theme. I guess inheriting from ActionBarActivity requires appcompat theme.

Set Holo theme in older Android versions?

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.

Categories

Resources