I'm using the DatePickerDialog and it's displayed via DialogFragment(from support library).
The datepicker dialog displays correctly in ICS, if android:theme
is set to "android:Theme.Light". But if it is set to #android:style/Theme.NoTitleBar"
Datepickerdialog displays as if in the Android versions below 3.0
Since the app do not display the title bar, we need to use "NoTitleBar".
I'm not sure which value I need to set for android:theme to make
Datepickerdialog to work properly in ICS. I tried changing the
style and theme using the setStye() in DialogFragment, but it didn't work.
Any suggestions which theme I need to set?
Thanks
Related
I have an activity that uses Theme.Holo.Light containing EditText, RadioButtons and DatePicker. I want to use Theme.Holo.Light for entire activity, except DatePicker which I want to be Theme.Light style. How can I do this?
Have you tried something like
<DatePicker
...
style="#android:style/Widget.DatePicker"/>
?
Holo uses #android:style/Widget.Holo.DatePicker while #android:style/Widget.DatePicker is the one you need to use.
Links:
Style list
Style list's source code
Update:
It seems that DatePicker is built with 3 NumberPickers. My answer is correct, but it is incomplete. The best approach I found to solve your problem was to recreate ans make your own DatePicker (copypaste from source code) and give style to the DatePicker AND the 3 NumberPickers inside.
Link of the Layout on GitHub:
DatePicker Layout
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+.
The problem is, the dialog's title background color is different in my emulator and on my real phone (each manufacturer uses it's own theme by default).
So I want to explicitly specify that I want to use the style that's using the emulator.
I'm guessing I can do it with
setStyle(style, theme)
inside DialogFragment but how can I find out which style/theme uses the emulator for building DialogFragments?
in your manifest use default phone theme. Theme.DeviceDefault
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.
I've spent all day trying to find this to no avail! I want a summary for my users after using my app, and a simple dialog is the obvious solution. However, I am unable to customise the theme to change the background and buttons. Every tutorial and explanation I've found on this matter is using API 11 techniques and I'm targeting API 8.
Is there a way to set the dialog theme for API 8 so I can change the background drawable, font, icons, etc? I've found various techniques for changing font, icon, adding a drawable, etc. (eg. http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application), but nothing that changes the background graphic or colours.
//set up dialog
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.dialog_layout);
Just specify a custom layout file for you dialog and specify there all the attributes you need including background drawable etc.