How to do Android's DigitalClock show the date? - android

When the mobile screen locks, its shown a time and date widget.
I'm trying to how it using DigitalClock, but I can show only time.
Any idea how to show date either (with this or other built-in widget)?
--update
I found some pages talking about alternatives to Android Calendar, but I don't find Android Calendar widget nowhere..

There is no built-in widget to show the date, sorry.

Related

input date picker on android shows wrong picker on WebView

I've got an HTML5 INPUT (type="datetime-local") in a WebView, but when I select it, it shows a date-time field that looks like this:
But the same identical element in Chrome looks like this:
This is under Android 7.1, with Chrome v55 installed, so Chrome is being used the WebView component. So, both should show the same thing, right?
I need the latter picker to show up in the WebView, it is much more user friendly (to scroll you can just flick up and down rather than having to repeatedly press the plus or minute buttons.
How do I accomplish this?
Update: I have tried creating this natively using a DatePickerDialog and it does the same thing! I'm targeting minSdkVersion=22, targetSdkVersion=25 (although I have also tried minSdkVersion=25). How do I force Android to display the correct picker for my app?
Update 2: I downloaded a sample app using the native DatePickerDialog and it displays the dialog ok. I don't like the idea of having to try to find the difference between the two projects which is causing the behavioral difference as it could be anything and take an excessive amount of time to find.
Update 3: Using the answer provided by Oleg, I was able to reproduce the second picker using android:Theme.Holo.Light.DarkActionBar. But if I use android:Theme.DeviceDefault.Light I can get a calendar view for input type="date". But the corresponding time picker in the Default theme (the round clock) does not show up for input type="time" and ``input type="datetime-local"` doesn't use the calendar view either.
As discussed in comments, you are likely missing the proper theme. Given that you have access to working app, please apply the same theme, it should solve it

How to open a new datepicker displaying an old date in Android tablet

I am working on a C# Android tablet project. If I open a new datePicker, it usually displays the current date. I would like to display a specific date (say, 5/9/2010) in the pop up datePicker. How can I do that? I would appreciate if anyone can help out.
I develop android in Java. In my case I use
DatePicker.init(year, month, day, DatePicker.OnDateChangedListener)
method to initialize the DatePicker before it shows on the screen. I didn't develop android in C#. But I think there must be a similar method to initialize it. Or you can get more information on the API website.

Implementing Calendar Control in Android

Here's my requirement :
Display Calendar (Monthly view) in the application.
Upon clicking on any cell in that widget, the daily events on the selected date will be displayed to the user in a list (below the calendar).
Is there a widget that can be used to display the calendar on a fragment?.
(
I did some searching online on this but I see people quipping that there is no native support for displaying calendar in Android which to me is a bit odd :(
)
I used this calendar for my project once. It many work for you too.
But its really sad that there is no native support.

Android datepicker dialog

How can I disable the day on a datepicker dialog for android? Meant only the month and year is visible. Currently using android 2.2
You can use a custom DatePicker in that case, for exemple refer to this google project that present an alternative time and date picker for android
Sorry but prior to I think 4.0 you cant do this, you only have the option for a full date or full time picker.
You could create your own, but this might take a while, have a look at what others have done.. Heres an example of a full date picker, but you could just take the day out of this as it is xml.
Custom date picker with months and years
Also I think it is a possible duplicate as Custom date picker with months and years
You can do custom date picker using ready to use framework for this.
The Dateslider is a framework for a range of date picker widgets based on the principle of sliding bars. This results in a very intuitive and enhanced user experience.
Check it out it may produce something like to meet your needs.
Thanks

Built-in date time picker control in Android that looks like the datetime picker of the Calendar Application

Is the control shown in the image below built-in in the Android Framework or it is a custom control. If it is custom control, should it be built using a button with background that pops a calendar dialog on click?
Thanks
These are just normal TextViews with a custom background selector and an OnClickListener that triggers the dialog.
If you want to know how a certain view or layout is built, you can use a tool called hierachyviewer (which I used here too). It shows the view hierachy of running apps on your device and is included in the Android SDK in your ANDROID_SDK/tools directory. The program is a bit unintuitive at first, but certainly a useful thing to know. See the documentation for more information about this.

Categories

Resources