B4A Library [B4X] AS WheelDateTimePicker - based on ASWheelPicker

arvin

Member
I can not install the lib, or i have another mistake?
I just copy "ASWheelPicker.b4xlib" to Libraries folder of B4A
 

Attachments

  • 1673635598059.png
    200.2 KB · Views: 239

Alexander Stolte

Expert
Licensed User
Longtime User
ASWheelPicker.b4xlib
You need this lib. the DateTimePicker is based on this. The WheelPicker is not free to use.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Is it possible to set a maximum and minimum date for the date picker?
A little information. I have already started working on the next update that will include exactly this. Unfortunately it is not an easy task to adapt this dynamically per runtime to the MinDate, I have already invested 2 hours and assume that I need at least 1-2 more hour of work time. The MaxDate is already inside and works smoothly.
 
Hi guys,
I want to set the "Color fade" to transparent in the designer, but it always throws me black in the app.
I tried by code


I tried by code before and after the refresh and I get the same error
B4X:
AS_WheelDateTimePicker1.FadeColor = Colors.Transparent
AS_WheelDateTimePicker1.MonthName = AS_WheelDateTimePicker1.CreateASWheelDateTimePicker_MonthName("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Sseptiembre","Octubre","Noviembre","Diciembre")
AS_WheelDateTimePicker1.Refresh
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.09
    • BugFixes
I want to set the "Color fade" to transparent in the designer, but it always throws me black in the app.
Hey please download the newest version of AS_WheelPicker and AS_WheelDateTimePicker.
Thanks
 

MarcoRome

Expert
Licensed User
Longtime User
Hi dear.
If you use this code in new version of libraries ( AS_WheelDateTime 1.09 + AsWheelPicker 3.13 ) dont work.

B4X:
AS_WheelDateTimePicker3.Date = DateTime.Now
    AS_WheelDateTimePicker3.Hour = DateTime.GetHour(DateTime.Now)
    AS_WheelDateTimePicker3.Minute = DateTime.GetMinute(DateTime.Now)
    
    AS_WheelDateTimePicker3.MonthNameShort =      AS_WheelDateTimePicker3.CreateASWheelDateTimePicker_MonthNameShort("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic")
    AS_WheelDateTimePicker3.WeekNameShort = AS_WheelDateTimePicker3.CreateASWheelDateTimePicker_WeekNameShort("Lun","Mar","Mer","Gio","Ven","Sab","Dom")
    AS_WheelDateTimePicker3.Refresh


The date starts from January 1st.
The code works perfectly on older libraries ( 1.08 + 3.08 )
 

Attachments

  • Project.zip
    182.6 KB · Views: 197

MarcoRome

Expert
Licensed User
Longtime User
Hi dear.
Another thing that could be useful and give the times different steps.
For example currently if you select a time, the minutes start from 1,2,3,4, etc up to 59. It could be useful to make sure that, for example, you have the "wheel" of the minutes that can only be chosen with a step of 15 minutes, so for example by selecting the minutes we could see 15,30,45 or step 10 minutes for 10,20,30,40,50... and so.
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Dear.
I downloaded version 1.12.
There are some problems. I also attach the project.
On android there is no problem, on iOS instead there are multiple problems, which i list below:
1. The AS_WheelDateTime object is not seen in the designer. as in the following picture.


2. If you enter AS_WheelDateTime and use the following code it crashes:
B4X:
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root
    Root.LoadLayout("lay_page2")
   
    Panel1.Visible = True
   
    DateTime.TimeFormat = DateTime.DeviceDefaultTimeFormat
    DateTime.DateFormat = DateTime.DeviceDefaultDateFormat
   
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.


Sub B4XPage_Appear
    AS_WheelDateTimePicker1.Date = DateTime.Now
    AS_WheelDateTimePicker1.Hour = DateTime.GetHour(DateTime.Now)
    AS_WheelDateTimePicker1.Minute = DateTime.GetMinute(DateTime.Now)
   
    AS_WheelDateTimePicker1.MonthNameShort = AS_WheelDateTimePicker1.CreateASWheelDateTimePicker_MonthNameShort("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic")
    AS_WheelDateTimePicker1.WeekNameShort = AS_WheelDateTimePicker1.CreateASWheelDateTimePicker_WeekNameShort("Lun","Mar","Mer","Gio","Ven","Sab","Dom")
    AS_WheelDateTimePicker1.Refresh
End Sub


if you comment this line it doesn't crash

B4X:
AS_WheelDateTimePicker1.Date = DateTime.Now

but i have hours and minutes starting from 0 even if i enter this code:
B4X:
AS_WheelDateTimePicker1.Hour = DateTime.GetHour(DateTime.Now)
AS_WheelDateTimePicker1.Minute = DateTime.GetMinute(DateTime.Now)
 

Attachments

  • Project.zip
    188.7 KB · Views: 151

Alexander Stolte

Expert
Licensed User
Longtime User
1. The AS_WheelDateTime object is not seen in the designer. as in the following picture.
No idea why there are no events under the dialog, just use the right-click menu to list the events. I never use this generate event dialog.
2. If you enter AS_WheelDateTime and use the following code it crashes:
It is a mistake to process this in the B4XPage_Appear event.

Also, what if the user briefly puts the app in the background because they need to look something up somewhere else, then every time the previous entry is set to the current date.
 

MarcoRome

Expert
Licensed User
Longtime User
It is a mistake to process this in the B4XPage_Appear event.

If you insert it in Event Created the result does not change.



I had tried to insert it in the Appear event because if you insert a panel and inside the Panel insert the object when you open the app "lose" the following instructions
B4X:
AS_WheelDateTimePicker1.MonthNameShort = AS_WheelDateTimePicker1.CreateASWheelDateTimePicker_MonthNameShort("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic")
    AS_WheelDateTimePicker1.WeekNameShort = AS_WheelDateTimePicker1.CreateASWheelDateTimePicker_WeekNameShort("Lun","Mar","Mer","Gio","Ven","Sab","Dom")
    AS_WheelDateTimePicker1.Refresh
and repeats everything in English
 

Alexander Stolte

Expert
Licensed User
Longtime User
The problem is not my lib. the problem is in the native scrollview. You are using AddPageAndCreate, the problem is, the panel is not visible. This is the same as if I make an xCustomListView invisible, then fill it and only then show it, an error occurs. And your panel where you put the view. on it, you also made invisible.

Make sure that when you build the view it is visible, that is important. And switch to AddPage instead of AddPageAndCreate.

I don't have time right now to write you a sample project that shows exactly this behavior with a simple xCustomListView.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…