B4A Library [B4X] [XUI] AS DatePickerTimeline

asales

Expert
Licensed User
Longtime User
I don't know if it helps but lib works fine in Xiaomi 8T and Xiaomi 7A. Tomorrow i'll try to install in XIaomi 9A if my daughter give it to me
Did you use the Release (obfuscated)?
I tested in a Redmi 8A and get the same issue.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Last edited:

asales

Expert
Licensed User
Longtime User
I check the B4J example and the list is show, but don't show the current day too.

Maybe could be related to my language settings (Brazilian Portuguese - pr_BR - dd/MM/yyyy - first day = Sunday) ?

 

Alexander Stolte

Expert
Licensed User
Longtime User
Maybe could be related to my language settings (Brazilian Portuguese - pr_BR - dd/MM/yyyy - first day = Sunday) ?
No, because the displayed date are in december and not this month.
The problem is that the xCustomListView doesn't jump to the current day after adding the items, normally a Sleep(0) after adding solves that, I extended that and added a Do While loop that does Sleep(0) until the first visible index is greater than 0. But for whatever reason that doesn't work for you either.

You can try this for testing:
B4X:
Sleep(4000)
AS_DatePickerTimeline.Scroll2Date(DateTime.Now)
do you see the current date?
 

asales

Expert
Licensed User
Longtime User
do you see the current date?
In B4J: yes. Started with the initial date (Jan 1) and show the current date after a while.

In B4A, started with the initial date and after a while, I get this error:
B4X:
** Activity (main) Resume **
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'int b4a.example3.customlistview._getsize()' on a null object reference
    at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1719)
    at android.os.Handler.handleCallback(Handler.java:914)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:225)
    at android.app.ActivityThread.main(ActivityThread.java:7563)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int b4a.example3.customlistview._getsize()' on a null object reference
    at com.stoltex.datepickertimeline.asviewpager._getvvvvvvvvvv6(asviewpager.java:560)
    at com.stoltex.datepickertimeline.as_datepickertimeline._vvvvvvvvvvvvvvvvvvvvvvvvv4(as_datepickertimeline.java:1526)
    at com.stoltex.datepickertimeline.b4xmainpage$ResumableSub_B4XPage_Created.resume(b4xmainpage.java:94)
    at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1717)
    ... 7 more
 

asales

Expert
Licensed User
Longtime User
Remove all code and try it clean.
I tried. I cleaned the project. I created a new project.

Still the same behaviou: it showed 1 Jan and after a while it seems to move a new day, but show 1 Jan again.

The strange is that in Android 7 (Moto G4) works fine.

Edit: tested in a Samsung tablet with Android 6 and works fine too.
 

Alexander Stolte

Expert
Licensed User
Longtime User
The strange is that in Android 7 (Moto G4) works fine.

Edit: tested in a Samsung tablet with Android 6 and works fine too.
Do the devices have the same time zone as the devices where it does not work?
My guess is that the view does not see the right first day of week for the current week. That means StartIndex = 0 = No List scrolling
 

asales

Expert
Licensed User
Longtime User
Do the devices have the same time zone as the devices where it does not work?
Yes, but I made some tests in Android 7:
- If I disable the Automatic time zone and changed the GMT to 00:00 it works.
- If I return to my GMT-03:00 - São Paulo, I can't see the List and date remains in 1 Jan.
- After this tests, I return the settings to automatic and now Moto G4 with Android 7 has the same issues from the others (no List and initial date = 1 Jan).

Same tests in Redmi 9A:
- GMT+00:00 works.
- my GMT-03:00 don't.
- Even without Sleep(4000) and Scroll2Date the GMT 00:00 works; the problem is with GMT-03:00
 

pliroforikos

Active Member
Licensed User
Hello again
Is there any way to lock and unlock day change for a while until my data will be retrieved?
 

pliroforikos

Active Member
Licensed User
However, this does not sound performant. Imagine you want to jump back 4 weeks and have to wait until everything is loaded.
I am using this
B4X:
    If AS_DatePickerTimeline2Clicked = True Then 
        Return 
    End If
    AS_DatePickerTimeline2Clicked = True

   Do something ........


  AS_DatePickerTimeline2Clicked = False

but date change in view can occur
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.12
    • Add get and set Enabled - If False then click events and scroll (only on paging mode) is disabled
Is there any way to lock and unlock day change for a while until my data will be retrieved?
B4X:
AS_DatePickerTimeline2.Enabled = False
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…