'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
' ''''''''''''''''''' Drawer '''''''''''''''''''''''''''''''''
drManager.Initialize(Me, "Drawer", Root, 200dip)
drManager.Drawer.CenterPanel.LoadLayout("frmSettings2")
drManager.Drawer.LeftPanel.LoadLayout("drawerMenu")
createMenu
' ''''''''''''''''''' Drawer '''''''''''''''''''''''''''''''''
createFloatMenu
end sub
Private Sub createFloatMenu
floatButtons.ButtonIconText.Font = xui.CreateMaterialIcons(24)'because the icon we want to display is an Material Icon
floatButtons.ButtonIconText.Text = Chr(0xE145)
floatButtons.ItemButtonProperties.IconText_Font = xui.CreateMaterialIcons(20)'because the next 2 item we want to add is a Material Icon
floatButtons.AddItem(Null,Chr(0xE145),"Insert","")
floatButtons.ItemButtonProperties.IconText_Font = xui.CreateFontAwesome(20)'because the next item we want to add is a FontAwesome Icon
' floatButtons.ItemButtonProperties.BackgroundColor = xui.Color_ARGB(255, 255, 159, 71)'the next item should be a blue button
' floatButtons.ItemTextProperties.BackgroundColor = xui.Color_ARGB(255, 255, 159, 71)
floatButtons.AddItem(Null,Chr(0xF029),"Scan","")
floatButtons.ItemButtonProperties.BackgroundColor = xui.Color_ARGB(255,73, 98, 164)'the next item should be a blue button
floatButtons.ItemButtonProperties.IconText_Font = xui.CreateFontAwesome(20)'because the next item we want to add is a FontAwesome Icon
' floatButtons.ItemButtonProperties.BackgroundColor = xui.Color_ARGB(255, 29, 100, 59)'the next item should be a blue button
' floatButtons.ItemTextProperties.BackgroundColor = xui.Color_ARGB(255, 29, 100, 59)
floatButtons.AddItem(Null,Chr(0xF00C),"Set","")
floatButtons.ItemButtonProperties.BackgroundColor = xui.Color_ARGB(255,228, 68, 68)'the next item should be a blue button
floatButtons.ItemTextProperties.BackgroundColor = xui.Color_ARGB(255,228, 68, 68)
floatButtons.ItemButtonProperties.IconText_Font = xui.CreateMaterialIcons(20)'because the next 2 item we want to add is a Material Icon
floatButtons.AddItem(Null,Chr(0xE872),"Remove","")
#end if
End Sub
Sub ASFloatingActionButton1_ItemClicked(index As Int,Value As Object)
Log("ASFloatingActionButton1_ItemClicked: " & index)
'ASFloatingActionButton1.CloseMenu
End Sub
Sub ASFloatingActionButton1_ButtonClicked(open As Boolean)
Log("ASFloatingActionButton1_ButtonClicked: " & open)
'works only if you set a image as icon
' If open = True Then
' ASFloatingActionButton1.Base.GetView(1).SetRotationAnimated(250,135)
' Else
' ASFloatingActionButton1.Base.GetView(1).SetRotationAnimated(250,0)
' End If
If open = True Then
ASFloatingActionButton1.ButtonIconText.SetRotationAnimated(250,135)
Else
ASFloatingActionButton1.ButtonIconText.SetRotationAnimated(250,0)
End If
End Sub