예제 #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
            var list = sender as Xamarin.Forms.ListView;

            if (list == null)
            {
                return;
            }
            await Task.Run(() =>
            {
                var items = list.ItemsSource as IList;
                if (items != null)
                {
                    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();
     }
 }