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+.
Related
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
I am using a calendar view inside a dialog fragment .I am getting the one as shown below. I am using the default calendarview provided.
But instead i want to get a calendar view as this one , which is shown by default in xml when i add:
I have tried changing the style to Widget.DeviceDefault.Light.CalendarView , Widget.Material.CalendarView but with same effect.
If you're using prolificinteractive materialcalendarview library, to change header style for year and month.
check my answer here:
How can I change Android MaterialCalendarView month color?
I don't know How to create Custom Calendar but you might check this GitHub library.You may succeed in creating the one, you are asking for with just little customization
https://github.com/prolificinteractive/material-calendarview
And also Refer to this Useful Stackoverflow post from which you will definitely be able to implement a CalenderView as you wanted.
Custom Android calendarView
At first I didn't understand why CalendarView component looks different in Android Studio and on my phone, but then I found this post https://stackoverflow.com/a/45368436/11052714
So the reason you are seeing this on your phone is because of API level. In the post I mentioned above, however I think wrong API level is mentioned, because I have the old calendar view with Android version 5.0.2 aka API level 21. It means that still in API level 21 old Calendar View visual look is used.
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'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
I am new to Android app. development. I need to change the existing style at runtime or can create new styles at runtime and I need to apply it for my buttons and textviews..
Can any one suggest me?
There are several methods to do so (most of them are provided by the super class TextView):
setTextColor to change the color of foreground
setTypeface to change the font style
setBackgroundResource(int) to change its backgrond
setPadding to add padding
All of them work for EditText, Button and others, since most of them extends the TextView class. So, my suggestion is: RTFM... just kidding... read the documentation to see the available functions.
Yesterday I was trying to do something similar.
This links gave me enough info:
Building Custom Components
Custom Android Button Style and Theme
Understanding Android Themes And Styles