Ejemplo n.º 1
0
        public async void ChangeSizeOfTabs()
        {
            UpdateNoBookmarks();
            for (int i = 0; i < selectTabItems.Length; i++)
            {
                selectTabLabels[i].ScaleTo(selectedTabItem == i ? 1.2 : 0.9, 150, Easing.SinOut);
                selectTabLabels[i].FontAttributes = selectedTabItem == i ? FontAttributes.Bold : FontAttributes.None;
            }
            bool bookmarkVis = selectedTabItem == 0;

            SetHeight();
            Bookmarks.IsEnabled   = bookmarkVis;
            Top100Stack.IsEnabled = !bookmarkVis;

            Bookmarks.IsVisible   = bookmarkVis;
            Top100Stack.IsVisible = !bookmarkVis;
            Top100Stack.FadeTo(bookmarkVis ? 0 : 1);
            if (selectedTabItem > 0)
            {
                var _movieIndex = selectedTabItem - 1;
                if (MovieIndex != _movieIndex)
                {
                    MovieIndex = _movieIndex;
                    IndexChanged();
                }
            }
            await Bookmarks.FadeTo(bookmarkVis? 1 : 0);
        }
Ejemplo n.º 2
0
        async void SetRecs(bool isFromSizeChange = false, int?height = null, int?width = null)
        {
            if (isFromSizeChange)
            {
                Bookmarks.Opacity = 0;
            }

            await Device.InvokeOnMainThreadAsync(async() => {
                int perCol = ((width ?? Application.Current.MainPage.Width) < (height ?? Application.Current.MainPage.Height)) ? 3 : 6;

                for (int i = 0; i < Bookmarks.Children.Count; i++)                   // GRID
                {
                    Grid.SetColumn(Bookmarks.Children[i], i % perCol);
                    Grid.SetRow(Bookmarks.Children[i], i / perCol);
                }
                // int row = (int)Math.Floor((Bookmarks.Children.Count - 1) / (double)perCol);
                // Recommendations.HeightRequest = (RecPosterHeight + Recommendations.RowSpacing) * (total / perCol);
                Bookmarks.HeightRequest = (bookmarkLabelTransY + RecPosterHeight + Bookmarks.RowSpacing) * (((Bookmarks.Children.Count - 1) / perCol) + 1) - 7 + Bookmarks.RowSpacing;
                if (isFromSizeChange)
                {
                    await Task.Delay(100);
                    Bookmarks.FadeTo(1, 75);
                }
            });
        }