[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:



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

Galaxy S2 (older devide) - OK


Galaxy A71


Galaxy Tab S2


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

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.

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
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



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:


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




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:



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 )



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)
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User

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


 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…