Has anyone been able to modify the datepicker in android to have both date and time selector? I have searched far and wide and have not been able to find something. Google tasks has a very nice datepicker that looks like this:
custom datepicker in google tasks app
Material Components library - in case you haven't checked out their implementation yet, they have a nice one that is similar to what you might be looking for (unfortunately no iOS implementation in the library, if that's something important to you):
https://material.io/components/date-pickers/android#date-pickers
You could always build a custom view that is partly composed of the material date picker as well if you wanted more functionality.
Related
I'am trying to create a DateTimePicker for react-native android,the ios side has it in one view but for android its separate. Calling it is not a task but i like to include it both in one view like in ios (my concept in below screenshot).
Not completely like the above some how customize it reduce both its size, is there an option to place them at specific portions of screen.
I repeat the case is react-native(react-js) not android(java)
It is not possible to customize the android picker and reduce their sizes
you suggested.
Instead I would use this library: react-native-date-picker. With that picker you are able to select time and date in the same picker, even in Android. I had exactly the same problem myself and couldn't find any solution to it, so I ended up creating that picker.
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
I want to implement something like WhatsApp file picker in Android, but I do not really know how to do it.
WhatsApp Android version has a nice file picker ripple transition and I want to implement it in my app.
Is there any ready component to do something like this or maybe I should extend a dialog?
I have also been searching for a library like that for ages and today, I found it here
Universal Media Picker
Screenshot
Try it out and let me know if you liked it :)
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.
I want to show a calendarview on my android application.
Default android calendar is not very nice.
I would like to improve the visual appearance and functionality of this calendar.
To do this, does anyone have a recommendation?
If you find extending CalendarView to be as much of a headache as I did, you can always create your own CustomCalendarView.
In your own View you can steal whatever functionality you like from the native CalendarView:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.1_r2/com/android/calendar/CalendarView.java
https://code.google.com/p/ancal/source/checkout
That project obtains ability of creating appointments, tasks and notes on calendar.