Creating a DateTimePicker React-Native Android? - android

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.

Related

Custom Settings in Android Studio

I want to make a section in my app to allow the user to specify a range of time. I'm trying to make the design to something like android timers at the moment, but I'm having trouble. Would I need to make a custom preference for the design, or would I need to use SharedPreferences in a Fragment?
Image of Android Clock Design
Additional Question:I'm using a Crystal double range seekbar that is visible when I run the app, but it doesn't show when in Android XML design.
I am not getting your usecase here. As far my understand, you need a screen to ask the user to the enter the date range like date from & to. If so, my suggestion would have the different screen to get those values and storre those in a SQLite.

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

Xamarin Forms ToolBarItem (Number over the Icon) Notification

I wish to display notifications as shown in the image link below using Xamarin Forms shared project. Is there a way to add text/number over the icon of the toolbar item?
Follow this link to view example since i cant post images.
This is not possible out of the box in Xamarin Forms at the moment (v1.4). You can however create a custom renderer in your iOS and Android project that does the trick.
This article might help you: Creating a Cross-Platform Application Bar for Xamarin
On TabBarItem (for iOS) there is a possibility to set BadgeValue which probably is what you are looking for. This property does not exist on ToolBarItem.
Another, uglier, solution is to add images with different numbers and in your view model select the appropriate image.

What do they utilize to build android apps with custom graphics and controls ?

What I mean to say while you're just getting started with the development and say you add a slider theres a predefined skin for that and you can place it somewhere on the screen, but in some apps there are things like a knob in a place of slider which you can rotate to do the same stuff what the slider does . How do they do that, does it require openGL or something I am not asking for a complete tutorial or something just curious on what stuff goes into building such thing
Mostly, if something is not provided out of the box, you will have to build your own control.
For example, you mention a Knob. That isn't available in the Android SDK. Such a control could prove to be useful.
Here is a tutorial to build such a custom Control: http://go-lambda.blogspot.in/2012/02/rotary-knob-widget-on-android.html
This is an image of the final result from the tutorial linked above:
Here is an example of a custom slider / seek bar: http://permadi.com/blog/2011/11/android-sdk-custom-slider-bar-seekbar/
This should give you a rough idea on how to go about creating your own custom views.
And finally, what I personally find the best possible resource for keeping track of almost all good Custom Views is here: http://www.androidviews.net/
The androidviews.net website has shut down. Android Arsenal is a new website that lists several third party Android libraries.

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