#Region Project Attributes
#ApplicationLabel: b4aDynamicCalendar
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\LibRes
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private mdc As myDynamicCalendar
Dim maxindex As Int = 0
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
Activity.AddMenuItem("Month", "Month")
Activity.AddMenuItem("Month with Events", "MonthWithEvents")
Activity.AddMenuItem("Week", "Week")
Activity.AddMenuItem("Day", "Day")
Activity.AddMenuItem("Agenda", "Agenda")
Activity.AddMenuItem("Today", "Today")
Dim dates() As String = Array As String("10-06-2017","15-06-2017", "16-06-2017", "19-07-2017", "18-07-2017", "18-07-2017", "30-06-2017")
Dim starttime() As String = Array As String("08:00", "08:00", "09:00", "10:00", "14:00", "17:00", "15:00")
Dim endtime() As String = Array As String("08:30", "08:15", "09:25", "10:45", "14:55", "17:25", "15:15")
Dim events() As String = Array As String("Safety Meeting", "Quality Meeting", "Supplier Meeting", "Customer Meeting", "IR Meeting", "My Time", "Finance Meeting")
Dim weekdaynames() As String = Array As String("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
'Dim weekdaynames() As String = Array As String("星期一", "星期二", "星期四", "星期三", "星期五", "星期六", "星期日")
Dim holidays() As String = Array As String("14-06-2017", "17-06-2017", "25-12-2017", "26-12-2017", "01-01-2018")
mdc.showMonthView
For i = 0 To 6
mdc.addEvent(dates(i), starttime(i), endtime(i), events(i))
Next
For i = 0 To 4
mdc.addHolidays(holidays(i))
Next
mdc.HolidayCellBackgroundColor = Colors.LightGray
mdc.HolidayCellTextColor = Colors.Red
mdc.CalendarBackgroundColor = Colors.White
mdc.HeaderBackgroundColor = Colors.White
mdc.HeaderTextColor = Colors.Magenta
mdc.NextPreviousIndicatorColor = Colors.Blue
mdc.WeekDayLayoutBackgroundColor = Colors.Blue
mdc.WeekDayLayoutTextColor = Colors.White
mdc.isSaturdayOff(True, Colors.LightGray, Colors.Red)
mdc.isSundayOff(True, Colors.LightGray, Colors.Red)
mdc.ExtraDatesOfMonthBackgroundColor = Colors.Black
mdc.ExtraDatesOfMonthTextColor = Colors.White
mdc.DatesOfMonthBackgroundColor = Colors.Cyan
mdc.DatesOfMonthTextColor = Colors.ARGB(200, 255, 0, 100)
mdc.WeekDayNames = weekdaynames
mdc.CurrentDateBackgroundColor = Colors.Red
mdc.CurrentDateTextColor = Colors.White
mdc.EventCellBackgroundColor = Colors.White
mdc.EventCellTextColor = Colors.Blue
mdc.BelowMonthEventTextColor = Colors.Black
mdc.BelowMonthEventDividerColor = Colors.Red
mdc.HolidayCellClickable = True
mdc.ListOfEvents 'see the event being raised - Sub mdc_get_events(eventname As String, eventstartdate As String, eventstrattime As String, eventendtime As String)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Month_Click
mdc.showMonthView
End Sub
Sub MonthWithEvents_Click
mdc.showMonthViewWithBelowEvents
End Sub
Sub Week_Click
mdc.showWeekView
End Sub
Sub Day_Click
mdc.showDayView
End Sub
Sub Agenda_Click
mdc.showAgendaView
End Sub
Sub Today_Click
mdc.showToday
End Sub
Sub mdc_get_events(eventname As String, eventstartdate As String, eventstarttime As String, eventendtime As String, index As Int)
Log("eventname = " & eventname)
Log("eventstartdate = " & eventstartdate)
Log("eventstarttime = " & eventstarttime)
Log("eventendtime = " & eventendtime)
Log("index = " & index)
maxindex = index
Log("maxindex = " & maxindex)
Log("***************************")
End Sub
Sub Button1_Click
mdc.deleteEvent(0)
mdc.showMonthViewWithBelowEvents
Log("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
mdc.ListOfEvents 'see the event being raised - Sub mdc_get_events(eventname As String, eventstartdate As String, eventstrattime As String, eventendtime As String)
End Sub
Sub mdc_previous_selected()
Log("arrow previous clicked")
End Sub
Sub mdc_next_selected()
Log("arrow next clicked")
End Sub
Sub mdc_month_view_event_selected(eventlist As Object)
Dim mylist As List = eventlist
For i = 0 To mylist.Size - 1
Log("mdc_month_view_event_selected(" & i & ") = " & mylist.Get(i))
Next
End Sub
Sub mdc_day_clicked(day As String, time As String)
Log("DAY = " & day)
Log("TIME = "& time)
Log("*******************")
End Sub