[B4X] [XUI] [Old] AS CalendarAdvanced ? - OneRow/FiveRow Calendar - Expand and Collapse [Payware]

Alexander Stolte

Expert
Licensed User
Longtime User
What i do for Remove Appointment Type
Waiting for the next update, sorry.
There is a way to reset the calendar in order to delete events, appointments, etc. ?
Added to the feature list.
Reset(APType1 (Boolean),APType2 (Boolean),APType3 (Boolean),SpecialDays (Boolean))
I set myself a deadline for tomorrow for the update.
 

asales

Expert
Licensed User
Longtime User
Code received. Thanks!
Works fine, but I had some issues about the design in different devices:

1 - In devices with more resolution, the number of the month overlaps the name of the month:
dia 7.jpg

dia 8.jpg


2 - The buttons to increase/decrease the week name overlaps one each other:

Galaxy S2 (older devide) - OK
btn1.jpg


Galaxy A71
btn2.jpg


Galaxy Tab S2
btn3.jpg


Thanks for your support.
 

Alexander Stolte

Expert
Licensed User
Longtime User
2 - The buttons to increase/decrease the week name overlaps one each other:
laziness has won ? changed in the next updated example.
1 - In devices with more resolution, the number of the month overlaps the name of the month:
The question is how to solve the problem. What I can do, I can try to calculate the perfect text size, as I have already done in other libraries.
 

asales

Expert
Licensed User
Longtime User
The question is how to solve the problem. What I can do, I can try to calculate the perfect text size, as I have already done in other libraries.
Maybe a little ajust in the size os the label (or panel) that you use in the month number and go down 3dip or something like this?
 

Alexander Stolte

Expert
Licensed User
Longtime User
1 - In devices with more resolution, the number of the month overlaps the name of the month:
you can already fix that:
B4X:
ASCalendarAdvanced1.ExtraInfosTextProperties.TextFont = xui.CreateDefaultFont(8)'default is 10'
set the value before you call CreateCalendar.
In the next update you can change the size or the style with "CommitStyleChanges" at any time.

The next update is a 2.00 version, because i add a lot of things.
 

Alexander Stolte

Expert
Licensed User
Longtime User
A major update that fixes many bugs, adds features and improves the user experience.
However, not everything is perfect yet, I am working hard to deliver more updates in the near future.
Update
2.00

  • BugFixes
  • Expand with fingers is now smooth
  • Add AppointmentType2 - Text Label above date
    • Add AddAppointmentType2 - adds an appointment to a date
  • Add AppointmentType3 - mark a range between 2 dates
    • Add AddAppointmentType3 - adds an range appointment between 2 dates
  • Add set and get AppointmentType2_ItemPropertiest - change the properties to customize AppointmentType2 look and feel e.g. corner_radius or padding
  • Add set and get AppointmentType3_ItemPropertiest - change the properties to customize AppointmentType3 look and feel e.g. corner_radius or aplha color
  • Add get and set BottomHeight - gets or sets the height of the drag-panel on the bottom, to expand or collapse the view
  • Add CommitStyleChanges - a simple Base_Resize, but all visible items ar updated
  • Add Event TouchDown - fires if the user touch the expand panel
  • Add Event TouchUp - fires if the user release the expand panel
  • Add Function GetExpandedViewHeight - gets the view height of the expanded view height
  • Add RemoveOneAppointmentType1 - if there are multiple AppointmentType1 on the date, then one of them will be removed
  • Add RemoveAppointmentType1 - if there are multiple AppointmentType1 on the date, then all of them will be removed
  • Add RemoveAppointmentType2 - removes AppointmentType2 on that day
  • Add Reset - removes all appointments or special days. Set to "True" to control what should be reset
  • Add set ExtraItemGap - is to prevent the font from covering the month number
AppointmentType2
You can now add 1 text to a date.
In the future, multiple should be supported, e.g. to display icons
1619706304209.png

B4X:
Dim p As Period
p.Days = 4
'Add AppointmentType2
ASCalendarAdvanced1.AddAppointmentType2(DateUtils.AddPeriod(DateTime.Now,p),xui.Color_ARGB(255,45, 136, 121),"Birthday",xui.Color_White)'green

'Remove this Appointment
ASCalendarAdvanced1.RemoveAppointmentType2(DateUtils.AddPeriod(DateTime.Now,p))
AppointmentType3
Now you can mark a range between 2 dates.
Currently, overlaps are not yet supported.
1619706987717.png

B4X:
Dim p As Period
p.Days = 5
Dim pp As Period
pp.Days = 7
'Add AppointmentType3
ASCalendarAdvanced1.AddAppointmentType3(DateUtils.AddPeriod(DateTime.Now,p),DateUtils.AddPeriod(DateTime.Now,pp),xui.Color_ARGB(255,45, 136, 121))
i haven't found a reliable way to remove them yet, the only way at the moment is to delete them all.
Example:
B4X:
ASCalendarAdvanced1.Reset(False,False,True,False)
 

MarcoRome

Expert
Licensed User
Longtime User
A major update that fixes many bugs, adds features and improves the user experience.
However, not everything is perfect yet, I am working hard to deliver more updates in the near future.
Update
2.00

  • BugFixes
  • Expand with fingers is now smooth
  • Add AppointmentType2 - Text Label above date
    • Add AddAppointmentType2 - adds an appointment to a date
  • Add AppointmentType3 - mark a range between 2 dates
    • Add AddAppointmentType3 - adds an range appointment between 2 dates
  • Add set and get AppointmentType2_ItemPropertiest - change the properties to customize AppointmentType2 look and feel e.g. corner_radius or padding
  • Add set and get AppointmentType3_ItemPropertiest - change the properties to customize AppointmentType3 look and feel e.g. corner_radius or aplha color
  • Add get and set BottomHeight - gets or sets the height of the drag-panel on the bottom, to expand or collapse the view
  • Add CommitStyleChanges - a simple Base_Resize, but all visible items ar updated
  • Add Event TouchDown - fires if the user touch the expand panel
  • Add Event TouchUp - fires if the user release the expand panel
  • Add Function GetExpandedViewHeight - gets the view height of the expanded view height
  • Add RemoveOneAppointmentType1 - if there are multiple AppointmentType1 on the date, then one of them will be removed
  • Add RemoveAppointmentType1 - if there are multiple AppointmentType1 on the date, then all of them will be removed
  • Add RemoveAppointmentType2 - removes AppointmentType2 on that day
  • Add Reset - removes all appointments or special days. Set to "True" to control what should be reset
  • Add set ExtraItemGap - is to prevent the font from covering the month number
AppointmentType2
You can now add 1 text to a date.
In the future, multiple should be supported, e.g. to display icons
View attachment 112515
B4X:
Dim p As Period
p.Days = 4
'Add AppointmentType2
ASCalendarAdvanced1.AddAppointmentType2(DateUtils.AddPeriod(DateTime.Now,p),xui.Color_ARGB(255,45, 136, 121),"Birthday",xui.Color_White)'green

'Remove this Appointment
ASCalendarAdvanced1.RemoveAppointmentType2(DateUtils.AddPeriod(DateTime.Now,p))
AppointmentType3
Now you can mark a range between 2 dates.
Currently, overlaps are not yet supported.
View attachment 112518
B4X:
Dim p As Period
p.Days = 5
Dim pp As Period
pp.Days = 7
'Add AppointmentType3
ASCalendarAdvanced1.AddAppointmentType3(DateUtils.AddPeriod(DateTime.Now,p),DateUtils.AddPeriod(DateTime.Now,pp),xui.Color_ARGB(255,45, 136, 121))
i haven't found a reliable way to remove them yet, the only way at the moment is to delete them all.
Example:
B4X:
ASCalendarAdvanced1.Reset(False,False,True,False)
Another donate. Very good mayor ( 97515436TX303113J )
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Hi Alexander, All.

I was trying version 2.
When I enter the following code to remove AppointmentType2, the application crashes
B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.RemoveAppointmentType2(Date)
    ASCalendarAdvanced1.CommitStyleChanges

End Sub

if instead I use the reset to remove the AppointmentType3
removes the same, but the days "disappear" from the calendar

B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.Reset(False, False, True, False)

End Sub

1619774712618.png


Where i wrong ?
Thank you
Marco
 

MarcoRome

Expert
Licensed User
Longtime User
I've seen that a few things change between Android and iOS.
For iOS it asks for the GestureRecognition library (written just for iOS) for Android it does not ask for any additional library / class.
Android
In the example you wrote, if you open the same it says that the BAS file is missing, as per following image:
1619781885402.png


However selecting the ASCalendarAdvanced library the demo runs normally.
If you try as already told to the thread above the following functions:

I was trying version 2.
When I enter the following code to remove AppointmentType2, the application crashes
B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.RemoveAppointmentType2(Date)

End Sub

if instead I use the reset to remove the AppointmentType3
removes the same, but the days "disappear" from the calendar

B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.Reset(False, False, True, False)

End Sub

1619782878524.png



and after removing with Reset, if you try to scroll the calendar, it will in crash with the following error:
java.lang.RuntimeException: Type does not match (class anywheresoftware.b4a.BALayout)



iOS
In the example you wrote, if you open the same it says that the BAS file is missing, as per following image:

1619782190700.png


However selecting the ASCalendarAdvanced and import as class GestureRecogniter the demo runs normally.
If you try as already told to the thread above the following functions:

When I enter the following code to remove AppointmentType2, the application work
B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.RemoveAppointmentType2(Date)

End Sub

if instead I use the reset to remove the AppointmentType3
removes the same, but the days "disappear" from the calendar ( as in Android )

1619783201751.png


B4X:
Sub ASCalendarAdvanced1_SelectedDateChanged(Date As Long)
    Log("SelectedDateChanged: " & DateUtils.TicksToString(Date))

    ASCalendarAdvanced1.Reset(False, False, True, False)

End Sub

and after removing with Reset, if you try to scroll the calendar, it will in crash with the following error:
[<B4IPanelView 0x10752b7f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key font.
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
In the example you wrote, if you open the same it says that the BAS file is missing, as per following image:
this is because in my environment, instead of using the B4XLib, I use the .BAS file to be able to make changes directly.

i'll send you a PM, i already have an update ready, i can't update until later.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.01
    • BugFix - Back2CurrentDay the current day panel has covered the day label
    • BugFix - AppointmentType3
    • Add get HeaderPanel - gets the header panel (code example)
    • Add set and get SelectedDate - gets or sets the selected date
    • BugFix - Removing Appointments
Example for using the getHeaderPanel:
B4X:
'changes saturday and sunday text color to red
ASCalendarAdvanced1.getHeaderPanel.GetView(5).GetView(0).TextColor = xui.Color_ARGB(255,221, 95, 96)
ASCalendarAdvanced1.getHeaderPanel.GetView(6).GetView(0).TextColor = xui.Color_ARGB(255,221, 95, 96)
IMG_5846.jpg
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Update
  • 2.01
    • BugFix - Back2CurrentDay the current day panel has covered the day label
    • BugFix - AppointmentType3
    • Add get HeaderPanel - gets the header panel (code example)
    • Add set and get SelectedDate - gets or sets the selected date
    • BugFix - Removing Appointments
Example for using the getHeaderPanel:
B4X:
'changes saturday and sunday text color to red
ASCalendarAdvanced1.getHeaderPanel.GetView(5).GetView(0).TextColor = xui.Color_ARGB(255,221, 95, 96)
ASCalendarAdvanced1.getHeaderPanel.GetView(6).GetView(0).TextColor = xui.Color_ARGB(255,221, 95, 96)
View attachment 112578

Tested on all environments, everything is now ok
Great work Alex.
Have a nice day
Marco
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Alex.
if you try today May 1st the example you sent (B4i) crashes, if you change the date in the iphone and postpone it to April or a May day that is different from May 1st, everything works.
Same thing for B4A e B4J


Application_Start
VisibleRangeChanged StartDate: 04/26/2021 11:50:06 EndDate: 05/30/2021 11:50:06
HeightChanged: 89.47219
Error occurred on line: 654 (ASCalendarAdvanced)
-[B4IPanelView setTextAlignment:]: unrecognized selector sent to instance 0x151649bf0
Stack Trace: (
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 1202304
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 182620
UIKitCore 8518EAE3-832B-3FF0-9FA5-9DBE3041F26C + 12586228
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 1213496
CoreFoundation _CF_forwarding_prep_0 + 96
AS CalendarAdvanced Example 0x0000000100f294b8 -[B4XViewWrapper SetTextAlignment::] + 144
AS CalendarAdvanced Example 0x0000000100e848b4 -[b4i_ascalendaradvanced _updateextraitem::] + 648
AS CalendarAdvanced Example 0x0000000100e76c20 -[b4i_ascalendaradvanced _base_resize:::] + 7252
AS CalendarAdvanced Example 0x0000000100e74708 -[b4i_ascalendaradvanced _addappointmenttype1:::] + 2756
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 1222900
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 7672
AS CalendarAdvanced Example 0x0000000100ed7ab8 +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AS CalendarAdvanced Example 0x0000000100f3533c -[B4IShell runMethod:] + 448
AS CalendarAdvanced Example 0x0000000100f34058 -[B4IShell raiseEventImpl:method:args::] + 2172
AS CalendarAdvanced Example 0x0000000100f3778c -[B4IShellBI raiseEvent:event:params:] + 1580
AS CalendarAdvanced Example 0x0000000100f41e24 +[B4IDebug delegate:::] + 80
AS CalendarAdvanced Example 0x0000000100eac04c -[b4i_b4xmainpage _b4xpage_created::] + 412
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 1222900
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 7672
AS CalendarAdvanced Example 0x0000000100ed7ab8 +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AS CalendarAdvanced Example 0x0000000100edda98 -[B4ICommon CallSubDebug4::::] + 1080
AS CalendarAdvanced Example 0x0000000100edd320 -[B4ICommon CallSubDebug2::::] + 372
AS CalendarAdvanced Example 0x0000000100eb9b1c -[b4i_b4xpagesmanager _createpageifneeded::] + 1152
AS CalendarAdvanced Example 0x0000000100eb6200 -[b4i_b4xpagesmanager _showpage::] + 828
AS CalendarAdvanced Example 0x0000000100eb472c -[b4i_b4xpagesmanager _addpage:::] + 1428
AS CalendarAdvanced Example 0x0000000100eb4a60 -[b4i_b4xpagesmanager _addpageandcreate:::] + 640
AS CalendarAdvanced Example 0x0000000100eb3f4c -[b4i_b4xpagesmanager _initialize:::] + 1892
AS CalendarAdvanced Example 0x0000000100ecb85c -[b4i_main _application_start:] + 700
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 1222900
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 7672
AS CalendarAdvanced Example 0x0000000100ed7ab8 +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AS CalendarAdvanced Example 0x0000000100f3533c -[B4IShell runMethod:] + 448
AS CalendarAdvanced Example 0x0000000100f34058 -[B4IShell raiseEventImpl:method:args::] + 2172
AS CalendarAdvanced Example 0x0000000100f3778c -[B4IShellBI raiseEvent:event:params:] + 1580
AS CalendarAdvanced Example 0x0000000100ed6e48 __33-[B4I raiseUIEvent:event:params:]_block_invoke + 60
libdispatch.dylib B92757B1-0434-3E9B-A3AC-B6DA6B81945C + 8780
libdispatch.dylib B92757B1-0434-3E9B-A3AC-B6DA6B81945C + 15792
libdispatch.dylib _dispatch_main_queue_callback_4CF + 836
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 659740
CoreFoundation 727F2644-EB4E-3D57-BC2E-E6803BA92366 + 635168
CoreFoundation CFRunLoopRunSpecific + 600
GraphicsServices GSEventRunModal + 164
UIKitCore 8518EAE3-832B-3FF0-9FA5-9DBE3041F26C + 12357352
UIKitCore UIApplicationMain + 168
AS CalendarAdvanced Example 0x0000000100e6d618 main + 128
libdyld.dylib 21B19919-1334-38BC-B233-896E929945E0 + 5808
)
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Application_Active
 
Last edited:
Top