This view was developed from scratch based on the AS_DatePicker and the AS_CalendarViewWeek from the AS_Scheduler. Both combined results in a fantastic new view.
Those who have already purchased AS_CalendarAdvanced can use the same key to use this library.
This library is not free, because, it cost a lot of time and gray hair to create such views.
Thanks for your understanding.
The calendar can be collapsed and expanded
3 Types of Appointments
AppointmentType_1
AppointmentType_2
AppointmentType_3
Make sure you are using ASViewPager V2.02+
AS_CalendarExpandable
Author: Alexander Stolte
Version: 1.00
Changelog
Those who have already purchased AS_CalendarAdvanced can use the same key to use this library.
This library is not free, because, it cost a lot of time and gray hair to create such views.
AS CalendarExpandable
The view is inspired on the calendar view in the outlook app.https://www.b4x.com/android/forum/threads/b4x-xui-as-calendarexpandable📅-payware.146808/
payhip.com
The calendar can be collapsed and expanded
3 Types of Appointments
AppointmentType_1
AppointmentType_2
AppointmentType_3
Make sure you are using ASViewPager V2.02+
B4j: jXUI,jDateUtils,ASViewPager
B4a: XUi,DateUtils,ASViewPager
B4i: iXUI,iDateUtils,ASViewPager
B4a: XUi,DateUtils,ASViewPager
B4i: iXUI,iDateUtils,ASViewPager
Author: Alexander Stolte
Version: 1.00
- ASCalendarExpandable_AppointmentType1
- Fields:
- Color As Int
- Date As Long
- IsInitialized As Boolean
Tests whether the object has been initialized.
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_AppointmentType1_ItemProperties
- Fields:
- Height As Float
- IsInitialized As Boolean
Tests whether the object has been initialized. - Padding As Float
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_AppointmentType2
- Fields:
- Color As Int
- Date As Long
- IsInitialized As Boolean
Tests whether the object has been initialized. - Text As String
- TextColor As Int
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_AppointmentType2_ItemProperties
- Fields:
- CornerRadius As Float
- Height As Float
- IsInitialized As Boolean
Tests whether the object has been initialized. - Padding As Float
- TextAlignment_Horizontal As String
- xfont As B4XFont
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_AppointmentType3
- Fields:
- Color As Int
- EndDate As Long
- IsInitialized As Boolean
Tests whether the object has been initialized. - StartDate As Long
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_AppointmentType3_ItemProperties
- Fields:
- AlphaColor As Int
- CornerRadius As Float
- Height As Float
- IsInitialized As Boolean
Tests whether the object has been initialized.
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_BodyProperties
- Fields:
- IsInitialized As Boolean
Tests whether the object has been initialized. - TextColor As Int
- xFont As B4XFont
- IsInitialized As Boolean
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_CustomDrawDay
- Fields:
- BackgroundPanel As B4XView
- IsInitialized As Boolean
Tests whether the object has been initialized. - xlbl_Date As B4XView
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_HeaderProperties
- Fields:
- ButtonIconSize As Float
- Height As Float
- IsInitialized As Boolean
Tests whether the object has been initialized. - TextColor As Int
- xFont As B4XFont
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_MonthNameShort
- Fields:
- April As String
- August As String
- December As String
- February As String
- IsInitialized As Boolean
Tests whether the object has been initialized. - January As String
- July As String
- June As String
- March As String
- May As String
- November As String
- October As String
- September As String
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_WeekNameShort
- Fields:
- Friday As String
- IsInitialized As Boolean
Tests whether the object has been initialized. - Monday As String
- Saturday As String
- Sunday As String
- Thursday As String
- Tuesday As String
- Wednesday As String
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASCalendarExpandable_WeekNumberProperties
- Fields:
- Color As Int
- IsInitialized As Boolean
Tests whether the object has been initialized. - Text As String
- TextColor As Int
- Width As Float
- xFont As B4XFont
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- AS_CalendarExpandable
- Events:
- CustomDrawDay_MonthView (Date As Long, Views As ASCalendarExpandable_CustomDrawDay)
- CustomDrawDay_WeekView (Date As Long, Views As ASCalendarExpandable_CustomDrawDay)
- SelectedDateChanged (Date As Long)
- SelectedDateRangeChanged (StartDate As Long, EndDate As Long)
- Fields:
- mBase As B4XView
- Tag As Object
- Functions:
- Add_AppointmentType1 (Date As Long, Color As Int) As String
Call Refresh if you add something - Add_AppointmentType2 (Date As Long, Color As Int, Text As String, TextColor As Int) As String
Call Refresh if you add something - Add_AppointmentType3 (StartDate As Long, EndDate As Long, Color As Int) As String
Call Refresh if you add something - AppointmentsReset As String
- ChangeView (NewView As String) As String
<code>AS_CalendarExpandable1.ChangeView(AS_CalendarExpandable1.CurrentView_YearView)</code> - Class_Globals As String
- Close As String
- CreateAppointmentType1 (Date As Long, xpnl_Date As B4XView) As String
- CreateAppointmentType2 (Date As Long, xpnl_Date As B4XView) As String
- CreateAppointmentType3 (Appointment As ASCalendarExpandable_AppointmentType3, xpnl_Appointments_Type3 As B4XView) As String
- CreateASCalendarExpandable_AppointmentType1 (Date As Long, Color As Int) As ASCalendarExpandable_AppointmentType1
- CreateASCalendarExpandable_AppointmentType1_ItemProperties (Height As Float, Padding As Float) As ASCalendarExpandable_AppointmentType1_ItemProperties
- CreateASCalendarExpandable_AppointmentType2 (Date As Long, Color As Int, Text As String, TextColor As Int) As ASCalendarExpandable_AppointmentType2
- CreateASCalendarExpandable_AppointmentType2_ItemProperties (xfont As B4XFont, Height As Float, Padding As Float, CornerRadius As Float, TextAlignment_Horizontal As String) As ASCalendarExpandable_AppointmentType2_ItemProperties
- CreateASCalendarExpandable_AppointmentType3 (StartDate As Long, EndDate As Long, Color As Int) As ASCalendarExpandable_AppointmentType3
- CreateASCalendarExpandable_AppointmentType3_ItemProperties (Height As Float, AlphaColor As Int, CornerRadius As Float) As ASCalendarExpandable_AppointmentType3_ItemProperties
- CreateASCalendarExpandable_BodyProperties (xFont As B4XFont, TextColor As Int) As ASCalendarExpandable_BodyProperties
- CreateASCalendarExpandable_CustomDrawDay (BackgroundPanel As B4XView, xlbl_Date As B4XView) As ASCalendarExpandable_CustomDrawDay
- CreateASCalendarExpandable_HeaderProperties (Height As Float, xFont As B4XFont, TextColor As Int, ButtonIconSize As Float) As ASCalendarExpandable_HeaderProperties
- CreateASCalendarExpandable_MonthNameShort (January As String, February As String, March As String, April As String, May As String, June As String, July As String, August As String, September As String, October As String, November As String, December As String) As ASCalendarExpandable_MonthNameShort
- CreateASCalendarExpandable_WeekNameShort (Monday As String, Tuesday As String, Wednesday As String, Thursday As String, Friday As String, Saturday As String, Sunday As String) As ASCalendarExpandable_WeekNameShort
- CreateASCalendarExpandable_WeekNumberProperties (Width As Float, Color As Int, xFont As B4XFont, TextColor As Int, Text As String) As ASCalendarExpandable_WeekNumberProperties
- DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
Base type must be Object - Expand As String
- getAppointmentType1 As List
- getAppointmentType1_ItemProperties As ASCalendarExpandable_AppointmentType1_ItemProperties
- getAppointmentType2 As List
- getAppointmentType2_ItemProperties As ASCalendarExpandable_AppointmentType2_ItemProperties
- getAppointmentType3 As List
- getAppointmentType3_ItemProperties As ASCalendarExpandable_AppointmentType3_ItemProperties
- getBodyColor As Int
- getBodyProperties As ASCalendarExpandable_BodyProperties
- getCurrentDateColor As Int
- getCurrentView As String
- getCurrentView_CenturyView As String
- getCurrentView_DecadeView As String
- getCurrentView_MonthView As String
- getCurrentView_YearView As String
- getDragPanelColor As Int
- getDragPanelIndicatorColor As Int
- getFirstDayOfWeek As Int
- GetFirstDayOfWeek2 (Ticks As Long, FirstDayOfWeek As Int) As Long
FirstDayOfWeek:
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - getGridLineColor As Int
- getHeaderColor As Int
- getHeaderProperties As ASCalendarExpandable_HeaderProperties
- getInactiveDaysVisible As Boolean
- getMaxDate As Long
- getMinDate As Long
- GetMonthNameByIndex (index As Int) As String
- getMonthNameShort As ASCalendarExpandable_MonthNameShort
Call Refresh if you change something
<code>AS_DatePicker1.MonthNameShort = AS_DatePicker1.CreateASCalendarExpandable_MonthNameShort("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec")</code> - getMouseHoverFeedback As Boolean
- getSelectedDate As Long
- getSelectedDateColor As Int
- getSelectedEndDate As Long
Only in SelectMode "Range" - getSelectedStartDate As Long
- getSelectMode As String
- getSelectMode_Day As String
- getSelectMode_Month As String
- getSelectMode_Range As String
- getShowGridLines As Boolean
- getShowWeekNumbers As Boolean
Gets or sets the number of visible weeks
Call Refresh to commit changes - getStartDate As Long
- GetWeekNameByIndex (Index As Int) As String
1 = Sunday - getWeekNameHeight As Float
- getWeekNameShort As ASCalendarExpandable_WeekNameShort
- getWeekNumberProperties As ASCalendarExpandable_WeekNumberProperties
Call Refresh if you change something
Default Values
Width: <code>20dip</code>
Color: <code>xui.Color_ARGB(255,32, 33, 37)</code>
xFont: <code>xui.CreateDefaultFont(15)</code>
TextColor: <code>xui.Color_White</code> - GetWeekNumberStartingFromMonday (ticks As Long) As Int
- Initialize (Callback As Object, EventName As String) As String
- IsInitialized As Boolean
Tests whether the object has been initialized. - MonthBetween (Date1 As Long, Date2 As Long) As Int
Compute month between 2 dates
Version: 1, ( ) WIP (X) Release
Prior set DateTime.DateFormat
Date1/2: Date formatted DateTime.DateFormat
Return: mont - 0 if same month - NumberOfWeeksBetween (StartDate As Long, EndDate As Long) As Int
- Rebuild As String
- Refresh As String
- RefreshHeader As String
- Remove_Appointment (TypeNumber As Int, Date As Long, RemoveAll As Boolean) As String
Call Refresh if you remove something
TypeNumber: 1,2 or 3
RemoveAll: If true, then remove all appointments on this date - setAppointmentType1_ItemProperties (ItemProperties As ASCalendarExpandable_AppointmentType1_ItemProperties) As String
- setAppointmentType2_ItemProperties (ItemProperties As ASCalendarExpandable_AppointmentType2_ItemProperties) As String
- setAppointmentType3_ItemProperties (ItemProperties As ASCalendarExpandable_AppointmentType3_ItemProperties) As String
- setBodyColor (Color As Int) As String
- setBodyProperties (BodyProperties As ASCalendarExpandable_BodyProperties) As String
- setCurrentDateColor (Color As Int) As String
- setCurrentView (CurrentView As String) As String
- setDragPanelColor (Color As Int) As String
- setDragPanelIndicatorColor (Color As Int) As String
- setFirstDayOfWeek (number As Int) As String
1-7
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - setGridLineColor (Color As Int) As String
- setHeaderColor (Color As Int) As String
- setHeaderProperties (HeaderProperties As ASCalendarExpandable_HeaderProperties) As String
- setInactiveDaysVisible (Visible As Boolean) As String
- setMaxDate (MaxDate As Long) As String
Will restrict date navigations features of forward, and also cannot swipe the control using touch gesture beyond the max date range - setMinDate (MinDate As Long) As String
Will restrict date navigations features of backward, also cannot swipe the control using touch gesture beyond the min date range - setMonthNameShort (MonthNameShort As ASCalendarExpandable_MonthNameShort) As String
- setMouseHoverFeedback (Feedback As Boolean) As String
- setSelectedDate (Date As Long) As String
- setSelectedDateColor (Color As Int) As String
- setSelectedEndDate (Date As Long) As String
- setSelectedStartDate (Date As Long) As String
- setSelectMode (Mode As String) As String
- setShowGridLines (Show As Boolean) As String
- setShowWeekNumbers (Show As Boolean) As String
- setStartDate (Date As Long) As String
- setWeekNameHeight (Height As Float) As String
- setWeekNameShort (WeekNameShort As ASCalendarExpandable_WeekNameShort) As String
Call Refresh if you change something
<code>AS_DatePicker1.CreateASCalendarExpandable_WeekNameShort("Mon","Tue","Wed","Thu","Fri","Sat","Sun")</code> - setWeekNumberProperties (WeekNumberProperties As ASCalendarExpandable_WeekNumberProperties) As String
- Add_AppointmentType1 (Date As Long, Color As Int) As String
- Properties:
- AppointmentType1 As List [read only]
- AppointmentType1_ItemProperties As ASCalendarExpandable_AppointmentType1_ItemProperties
- AppointmentType2 As List [read only]
- AppointmentType2_ItemProperties As ASCalendarExpandable_AppointmentType2_ItemProperties
- AppointmentType3 As List [read only]
- AppointmentType3_ItemProperties As ASCalendarExpandable_AppointmentType3_ItemProperties
- BodyColor As Int
- BodyProperties As ASCalendarExpandable_BodyProperties
- CurrentDateColor As Int
- CurrentView As String
- CurrentView_CenturyView As String [read only]
- CurrentView_DecadeView As String [read only]
- CurrentView_MonthView As String [read only]
- CurrentView_YearView As String [read only]
- DragPanelColor As Int
- DragPanelIndicatorColor As Int
- FirstDayOfWeek As Int
1-7
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - GridLineColor As Int
- HeaderColor As Int
- HeaderProperties As ASCalendarExpandable_HeaderProperties
- InactiveDaysVisible As Boolean
- MaxDate As Long
Will restrict date navigations features of forward, and also cannot swipe the control using touch gesture beyond the max date range - MinDate As Long
Will restrict date navigations features of backward, also cannot swipe the control using touch gesture beyond the min date range - MonthNameShort As ASCalendarExpandable_MonthNameShort
Call Refresh if you change something
<code>AS_DatePicker1.MonthNameShort = AS_DatePicker1.CreateASCalendarExpandable_MonthNameShort("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec")</code> - MouseHoverFeedback As Boolean
- SelectedDate As Long
- SelectedDateColor As Int
- SelectedEndDate As Long
Only in SelectMode "Range" - SelectedStartDate As Long
- SelectMode As String
- SelectMode_Day As String [read only]
- SelectMode_Month As String [read only]
- SelectMode_Range As String [read only]
- ShowGridLines As Boolean
- ShowWeekNumbers As Boolean
Gets or sets the number of visible weeks
Call Refresh to commit changes - StartDate As Long
- WeekNameHeight As Float
- WeekNameShort As ASCalendarExpandable_WeekNameShort
Call Refresh if you change something
<code>AS_DatePicker1.CreateASCalendarExpandable_WeekNameShort("Mon","Tue","Wed","Thu","Fri","Sat","Sun")</code> - WeekNumberProperties As ASCalendarExpandable_WeekNumberProperties
Call Refresh if you change something
Default Values
Width: <code>20dip</code>
Color: <code>xui.Color_ARGB(255,32, 33, 37)</code>
xFont: <code>xui.CreateDefaultFont(15)</code>
TextColor: <code>xui.Color_White</code>
- Events:
- 1.00
- Release
- 1.01
- Add get and set WeekNameProperties
- 1.02
- Add Scroll2Date
- 1.03
- B4I BugFix
- 1.04
- BugFix
- 1.05
- BugFixes
- 1.06
- BugFixes
- 1.07
- In WeekView, the year gap is now only 2 years, instead of 5
- 1.08
- Add Event HeightChanged
- 1.09
- BugFixes
- Performance Improvements
- 1.10
- BugFixes
- 1.11
- Add Event PageChanged
- Add get CurrentMonthWeek
- BugFixes
- 1.12
- Add get MonthView
- Add get WeekView
- Add Event CustomDrawHeader
- BugFixes
AS CalendarExpandable
The view is inspired on the calendar view in the outlook app.https://www.b4x.com/android/forum/threads/b4x-xui-as-calendarexpandable📅-payware.146808/
payhip.com
Attachments
Last edited: