Exemple #1
0
        private void PackagesScrolled(object sender, ItemsViewScrolledEventArgs e)
        {
            var top = e.VerticalOffset < 1;

            var transY = Convert.ToInt32(SearchBarView.TranslationY);

            if (transY == 0 &&
                e.VerticalDelta > 15 &&
                !top)
            {
                var trans      = SearchBarView.Height + SearchBarView.Margin.Top;
                var safeInsets = On <Xamarin.Forms.PlatformConfiguration.iOS>().SafeAreaInsets();

                Task.WhenAll(
                    SearchBarView.TranslateTo(0, -(trans + safeInsets.Top), 250, Easing.CubicIn),
                    SearchBarView.FadeTo(0.25, 200));
            }
            else if (transY != 0 &&
                     (e.VerticalDelta < 0 && (Math.Abs(e.VerticalDelta) > 10) || top))
            {
                Task.WhenAll(
                    SearchBarView.TranslateTo(0, 0, 250, Easing.CubicOut),
                    SearchBarView.FadeTo(1, 200));
            }
        }
Exemple #2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            Task.WhenAll(
                SearchBarView.TranslateTo(0, 0, 250, Easing.CubicOut),
                SearchBarView.FadeTo(1, 200));
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();

            // Show SearchBar if it was previously hidden when navigating back to this page
            Task.WhenAll(
                SearchBarView.TranslateTo(0, 0, 250, Easing.CubicOut),
                SearchBarView.FadeTo(1, 200));
        }