示例#1
0
 private async void OnListItemDisappearing(object sender, ItemVisibilityEventArgs e)
 {
     // Experimental - Hiding and showing the FAB correctly is dependent on the objects in the list being unique
     if (!(sender is Xamarin.Forms.ListView list))
     {
         return;
     }
     await Task.Run(() =>
     {
         if (list.ItemsSource is IList items)
         {
             var index = items.IndexOf(e.Item);
             if (index < appearingListItemIndex && index >= 0)
             {
                 appearingListItemIndex = index;
                 Device.BeginInvokeOnMainThread(async() =>
                 {
                     fab.Hide();
                     await Task.Delay(500);
                     fab.Show();
                 });
             }
             else
             {
                 appearingListItemIndex = index;
             }
         }
     });
 }
 public override void OnScrollDown()
 {
     fab.Show();
     if (ScrollDirectionListener != null)
     {
         ScrollDirectionListener.OnScrollDown();
     }
 }