﻿B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=10.12
@EndOfDesignText@
Sub Class_Globals
	Private Root As B4XView 'ignore
	Private xui As XUI 'ignore
	
	Private fnt As B4XFont
	Private lbl1 As Label
	Private lbl2 As Label
	Private lbl3 As Label
	Private lbl4 As Label
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
	fnt = xui.CreateFont(LoadWebFont,26)
	Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
	Root = Root1
	'load the layout to Root
	Root.LoadLayout("frmWebFont")

#IF B4A
	Dim IconsFont As Typeface =Typeface.LoadFromAssets("materialdesignicons-webfont.ttf")
	lbl1.Typeface = IconsFont
	lbl2.Typeface = IconsFont
	lbl3.Typeface = IconsFont
	lbl4.Typeface = IconsFont
#ELSE B4J
	Dim IconsFont As B4XFont = xui.CreateFont(LoadWebFont,26)
	fnt = xui.CreateFont(IconsFont, 25dip)
	lbl1.Font = fnt
	lbl2.Font = fnt
	lbl3.Font = fnt
	lbl4.Font = fnt
#End If
	lbl1.Text = $"${Chr(0xf521)} toggle-switch"$
	lbl2.Text = $"${Chr(0xf522)} toggle-switch-off"$
	lbl3.Text = $"${Chr(0xfa18)} toggle-off-outline"$
	lbl4.Text = $"${Chr(0xfa19)} toggle-switch-outline"$
End Sub

Private Sub LoadWebFont As Object
	#if B4J
	Dim fx As JFX
	Return fx.LoadFont(File.DirAssets, "materialdesignicons-webfont.ttf", 30)
	#else if B4A
	Return Typeface.LoadFromAssets("materialdesignicons-webfont.ttf")
	#else if B4i
'	For Each f As String In Font.AvailableNames
'		LogPrt(f)
'	Next
	Return Font.CreateNew2("Material-Design-Icons", 32)
	#End If
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.