I'm building an Android app that should be able to run on Android 2.1 and above. The minSdkVersion is set to 7, and the targetSdkVersion is set to 14. In order to have ActionBar functionality, I am using the ActionBarSherlock library and setting the theme of the application to a derivative of Theme.Sherlock (etc.), as required.
Aside from providing an ActionBar, I notice that when I run the app on a Honeycomb/ICS device, some of the other widgets and dialogs now have a different (i.e. Holo) appearance. I want to have an ActionBar but keep the normal, non-Holo Android theme - the Holo styling does not fit well with the rest of the app. EditText views in particular look significantly different.
I see that ActionBarSherlock defines some custom themes in values-11 (Honeycomb) and values-14 (ICS), which inherit from Theme.Holo. There are also custom styles in values-14 which map the ABS styles to the native ones (since the native ActionBar is used in ICS+).
I have found that I have to do at least the following things:
Disable the custom themes for values-11 and values-14 - this stops Holo widgets/dialogs appearing.
Disable the use of the native implementation of the ActionBar for ICS+ - this stops the crashing on ICS since it relies on the native ActionBar provided as part of Holo theme. This requires modification of the library.
Disable the custom styles for values-14 - this messed with the look/styling of the compatibility ActionBar.
I am not sure if there are other issues that I have missed. Has anyone found a good way to use the non-Holo Android theme with ActionBarSherlock, without modifying the library? Are there any problems with using the compatibility ActionBar in ICS and above?
Related
While I was using the Material components for Android (https://material.io/develop/android/docs/getting-started/) I was forced to inherit my application theme from "MaterialComponent" instead of the classic "Theme.AppCompat" in order to make the material components work. While I was testing the application with the integrated material components, on Android 6.x.x Marshmallow I observed that there is is a strange theme for the popup items when I select a text in any of my EditTexts.
Here is an example with the actual Material theme
and here is the expected theme
Has anyone encountered the same issue before?
Given the following:
Android documentation says :
AppCompatActivity - Adds an application activity class that can be used as a base class for activities that use the Support Library action bar implementation.
I'm not considering adding action bar to my activity
I need some material design widgets, which I can control only through AppCompat or material theme, but the latest need API >= 21, which is not my case.
I tested Theme.AppCompat.Light.NoActionBar with Activity class and it works well.
--
Is there an issue with using Activity class with AppCompat theme in my case?
The AppCompat library is intended to make compatibility with olders API, so the Theme and all components may work well in older systems.
I think the only concern is to always use the AppCompat elements and not the regular ones.
Example, use AppCompatEditText, AppCompatTextView, etc... And always refers to they with the AppCompat (AppCompatEditText editText;)
I have used a lot the support library and not have others issues, considering the visual elements may be a little different when using an API minor than 21
No.There is not issues with AppcompactActivity & support libaray. You can refere this link
To gain more rich & amazing look go with support library,Try to do material design
I'm going to develop an android application in our school as a project.
I want to use the new Material Design by Google but i know its only available on Android-L Devices.
Jack Underwood has recently released the calendar called "Today Calendar", which is in the Material Style and running on Kitkat and lower Devices.
I know that the Actionbar height is a bit bigger than the older one and the navigation drawer toggle has a new style. And so one ...
How do i implement that?
Currently the Android-L contains the Material Theme which works only on Android-L release.
You can build a Material Style without this Theme.
For example:
you can use a custom ActionBar (it is a customView) with a solid color, without shadow and with the navdrawer icon insted of standard icon app.
You can build a subheader bar with a LinearLayout below the actionBar with the same color.
You can build a Floating Action Button with a floating circle (and a shadow in png)
and so on...
We don't know what will be available for older releases. May be something as the new class Toolbar will be available in support library (and it will semplify the actionbar).
I suggest you waiting a month.
appcompat v21 supports the toolbar on pre-lollipop devices as well.
You can check out Chris's blog for some help on this
https://chris.banes.me/2014/10/17/appcompat-v21/
Of course, the elevation attributes does not work on pre-lollipop devices, so you need to implement custom shadow for version < 21. I would suggest a gradient drawable with height around 4dp works fine.
The problem is that when I am using Holo theme colors for my app I am getting error that #android:color/ holo_bright_ blue requires higherAPI. I am using appcompat for my app. Any way to use holo theme colors in lower API?
You could use an approximation of the color instead of using the android reference. For instance, holo_blue_bright is fairly close to #31B6E7
You could try to use HoloEveryWhere library, that brings holo widgets and themes to the <4.0 devices.
I don't know if this would help you with your specific question, but it probably should.
Is there a way to use Holo theme in android 2.3 without using actionBar with it. I tried using Holoeverywhere library but it is showing actionbarbar as well.
Also I want the Holo UI same throughout the app no matter which OS version user is on (2.3.3 and above)
Apply theme Holo.Theme.NoActionBar on activity. For decrease a memory leak you can disable abs by setting requireSherlock = false in onCreateConfig, like in demo.