Background gradient not showing on Holo theme - android

In styles.xml inside of values/, values-v11/, and values-v14/, ive set the AppBaseTheme to android:Theme.Holo.
Now it seems to work well, except it is not showing the nice background gradient when I run it on a 4.2 AVD with API level 17.
I saw something along the lines of hardware acceleration. Could this be why it isn't showing the background gradient that the Holo theme should use? Is it something in the settings within the AVD? Or am I missing something else?
How do I get the Holo background gradient to show in my app when I run it on the AVD? I know this is purely cosmetic, but I think it looks nicer and I want my app to utilize it.

Related

?attr/colorPrimary support version?

I am in a fairly serious predicament. I have built my entire app using ?attr/colorPrimary to pick the color for background shapes, as I have devised a way to dynamically change the theme and color. This works perfectly on 5.0, but on all 4.x devices, ?attr/colorPrimary crashes the app. Why does Android studio not alert developers to this incompatibility?
Is there a support version of ?attr/colorPrimary?
colorPrimary is already part of AppCompat as of version 21 and works back to API 7. Your problem is instead with your theming code.
I believe it was added after Android Lollipop - API 21.
At least this link shows that it was added between API 20 and 21:
https://developer.android.com/sdk/api_diff/21/changes/android.R.attr.html
attr/colorPrimary just point to colorPrimary defined in current theme.
I'm not sure how you implemented your theme.. But you can create your own attr... This option is good only if you support several themes.
If you have a single theme, I believe you can replace it by a color.
API 21:
Material design style
Notifications are drawn with dark text atop white (or very light)
backgrounds to match the new material design widgets. Make sure that
all your notifications look right with the new color scheme. If your
notifications look wrong, fix them:
Use setColor() to set an accent color in a circle behind your icon
image. Update or remove assets that involve color. The system ignores
all non-alpha channels in action icons and in the main notification
icon. You should assume that these icons will be alpha-only. The
system draws notification icons in white and action icons in dark
gray.
The problem is a glitch in Android code. See this, it is not the exact same but the reason is.
In case anyone out there has this problem, I want to explain my workaround.
Remove all instances of "?attr/color(Primary, Dark, or Accent)" and attempt to mimic the effect in each individual element in each individual activity. This is not a full work around, but for me it works. Google really needs to resolve this issue. If you know a better work around, please let me know and I will accept it as the better answer as long as it works.

TimePickerDialog custom theme

I'm developping an Android app and right now I'm having an issue with a part of my UI: a TimePickerDialog. I'd like the top part of the Dialog to be orange instead of the classic
I know that I could create a custome theme, but my boss want it developp in 4.0 (API 15) so that it covers almost every device.. I don't know how to set a color with using settings covered by API 21 and up..
TimePickerDialog appearance is very different in the API levels you are testing on. The biggest redesign was probably made in Lollipop (API 21), where the default dialog has a totally different (circular) look:
If you are testing on API21+, you are probably seeing this one. The background color AFAIK can be changed by tweaking the android:color* attributes in your theme. I'm not sure which one (could be android:colorAccent, android:colorPrimary...), but it is easy to determine.
However, since you are going to deploy down to API 15, and default time picker there is quite different, I would recommend using an external library to give each user the same look and feel of Lollipop.
The most used is probably this one, and allows you to style the dialog in terms of colors and much more.
API>=21:You can define <item name="colorPrimary">xxxx</item> in your style of theme
API<21:Use libary for example material libary

How to get the new Android progress view that is in 4.0?

I have just tried implementing a ProgressBar with the following two styles:
?android:attr/progressBarStyleLarge
?android:attr/progressBarStyleSmall
However, they are the old, vanilla progress spinners that Android has always had. See below:
I'm looking for the progress bar that comes with the 4.+ theme. It's the one that has one progress indicator rotating clockwise, and a semi-transparent indicator running counterclockwise at a slower pace. The heads then intersect at 5 points (star formation) across the circle, like the image below.
How do I get this ProgressBar in my app?
You should define a custom theme, then have it inherit from Theme.Holo in API level 11+, and from Theme for all others (or their light variants). To do so, see Select a theme based on platform version.
That way the progressBarStyleLarge attribute will be mapped to the new resource (progress_large_holo) in devices that support it. This will also change all other resources though (such as backgrounds for EditText, &c).

Needing a example of how to style an EditText control in the Holo theme to be more like pre Holo

I am trying to more or less copy a PSD that has older controls in it with also using the ActionBar in ICS they like the old style that has the actual box instead of the underline. how would i be able to keep the holo theme and revert a control to the old styles?
Just wanted to show you how i made this happen as quick fix..
http://www.androidworks.com/changing-the-android-edittext-ui-widget
This covers the bases on how to style in depth .. and basically i built my own 9.png files..

How to handle the fact that Dialog background in Theme.Light are black on pre-ICS sdk and white on ICS

In my application, I use some dialogs to display information.
The theme of my application is Theme.Light since 2 years, and these dialogs have always been black since the beginning.
Now with ICS, it seems that Google just changed his mind and turned these dialogs into white:
See the screenshot of my Moto Xoom and my Galaxy Nexus:
What is the best practice to handle that true fragmentation?
I have been thinking about creating different layout: layout-v14 but I will soon become crazy, if I have to create layout-v15,v-16, etc for the future?
Or is there a way to tell "lower than v14" and "higher than v14"?
layout-v14 apply to v14 and higher, so if any different style will appear in future you able to add layout-vXX to support this. And all versions between v14 and vXX will apply v14 layout.

Categories

Resources