numberpicker widget and holoeverywhere missing theme - android

I'm trying to get Simons Number Picker to work together with Holoeverywhere. however holoeverwhere requires me to set android:theme="#style/Holo.Theme" whereas the number picker requires android:theme="#style/SampleTheme.Light". I'm not very familiar with styles and themes yet, what are my options? Right now the number picker displays incorrectly:
PS. I need backwards comp. till 2.2 and would prefer keeping the holo theme

There is a built in NumberPicker in HoloEverywhere.
You can test it with the demo application.
org.holoeverywhere.widget.NumberPicker
Here is a link to the source code:
https://github.com/ChristopheVersieux/HoloEverywhere/blob/master/library/src/org/holoeverywhere/widget/NumberPicker.java
MOVED TO: https://github.com/Prototik/HoloEverywhere/blob/master/library/src/org/holoeverywhere/widget/NumberPicker.java
Maybe there is a way to use Simons widget on a dark theme, should be possible.

Related

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

Using holo light colors in android Lower API

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.

How can i change Timpicker Style wheel?

How can I change Timepicker Style to whee?
When I make Timepicker in my layout
like this
but I want this style
i know that is default style. I don't know how I can change the timepicker style
what can I do?
That is because you use old api (lower than ICS 4.0). To use the new styled TimePicker import SimonVT's TimePicker library. It has exactly the same style, that android > 4.0 TimerPicker has. It can be used starting from Android 2.1.
Use wheel picker library. You can style it any way you like and there is no limit to the type of content you can put in it. It's written by a Google Developer and I've used it in the past with no issues. I think it's compatible for Android 2.1+.

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 do I use common UI styles in Android?

I am writing my little Android app. I pop up a dialog control which is a nice, non-fullscreen, rounded-corners dialog by setting android:theme="#android:style/Theme.Dialog" on the activity in my manifest. That all works just as I expected. However it is just a drab, grey-titled dialog as in this screenshot:
I've noticed however that a LOT of applications, when they pop up dialogs have a nice, blue-themed title as in this screen shot.
I would assume this theme is some common theme, as it shows up in a LOT of different apps. I would assume it is something built in to the OS. (My phone is a Captivate with the official Froyo release). Of course it COULD be something that every developer simply re-coded on their own, but I doubt that.
Assuming that this is a common theme, how do I utilize it in my app? What changes do I need to make to my activity to have it use that theme?
Thanks in advance!
You can set your activity to use a default theme like Theme.Black. There are default themes and they are in R.style - although i'm not sure which are available to which platforms(i.e. i think the holo themes are for 3.0 and up...
http://developer.android.com/reference/android/R.style.html
see here http://developer.android.com/guide/topics/ui/themes.html for defining your own custom themes and scroll all the way down for using the "platform styles" and themes.
Rather messy (there doesn't seem to be a good reference for this), but the platform styles are defined in \platforms\android-\data\res\values\styles.xml and \platforms\android-\data\res\values\themes.xml. You can dig through those and figure out the theme/style IDs that are available at compile time.
Other than that its really just trial and error.
To make a dialog you need to extend the dialog class. And to have a nice title bar you can use:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
and have your own custom title.
to have a title use:
setTitle("MyTitle");
You can also assign your custom view for the title.

Categories

Resources