Sub Globals
Private mLastScrollY As Int = 0
Private FabMenu As FloatingActionButton
Private clvSchemes As CustomListView
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("HomePage")
FabSetup
End Sub
Sub FabSetup
Dim p1 As MSIconicDrawable : p1.Initialize("gmd_menu") : p1.Color = 0xffffffff : p1.sizeDp(20)
FabMenu.Icon = p1.Drawable
FabMenu.Color = Colors.RGB(2,124,213)
FabMenu.ColorPressed = Colors.RGB(219,68,55)
FabMenu.ColorRipple = Colors.RGB(90,110,250)
'Set the offset of hide position. This is the amount the FAB moves on hide.
FabMenu.HideOffset = 100%y - FabMenu.Top
FabMenu.Hide(False)
'FabMenu.Show(True)
End Sub
'I understand that the following sub is not executed at all
'I am not sure that whether this Sub exists for CustomListView
Sub clvSchemes_ScrollChanged(Position As Int)
If Abs(Position - mLastScrollY) > 3dip Then
If Position > mLastScrollY Then
FabMenu.Hide(True)
Else
FabMenu.Show(True)
End If
End If
mLastScrollY = Position
Dim cText As String
cText = mLastScrollY
ActionBar.SubTitle = cText
ToastMessageShow("Yes",False)
End Sub