2. Colors
On to some coloring. Add a subroutine set_background and give it an argument for the color integer.
Private Sub set_background(intcolor As Int) As StateListDrawable
Private cd,cd2 As ColorDrawable
Private sd As StateListDrawable
cd.Initialize2(intcolor,5,1,Colors.Black)
cd2.Initialize2(Colors.Red,5,1,Colors.Black)
sd.Initialize
sd.AddState(sd.State_Pressed,cd2)
sd.AddState(sd.State_Enabled,cd)
Return sd
End Sub
In the set_label subroutine you can now give the background of the label a color. Add the following line of code:
lbl.Background = set_background(intbackground)
Change the arguments of the set_label subroutine to include the intbackground variable.
private Sub set_label(lbltext As String, intbackground As Int) As Label
In the calls to the set_label subroutine you need to add a color. You can use the standard colors or you can specify the color with the Colors.ARGB method.
set_label(mnth & " / " & yr, Colors.ARGB(100,182,221,249))
set_label(lstdaynames.Get(i-1), Colors.ARGB(100,255,255,135))
set_label("",Colors.ARGB(100,230,230,230))
set_label("", Colors.ARGB(100,230,230,230))
set_label(daynumber, Colors.ARGB(100,255,50,50))
set_label(daynumber, Colors.ARGB(100,255,210,179))
set_label(daynumber,Colors.ARGB(100,158,255,150))
Now the calendar app looks like this: