コード例 #1
0
        async void SetRecs(bool isFromSizeChange = false, int?height = null, int?width = null)
        {
            if (isFromSizeChange)
            {
                BookHolder.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;
                //Bookmarks.WidthRequest = Application.Current.MainPage.Width < Application.Current.MainPage.Height ? Application.Current.MainPage.Width : Application.Current.MainPage.Height;
                if (isFromSizeChange)
                {
                    await Task.Delay(100);
                    _ = BookHolder.FadeTo(1, 75);
                }
            });
        }
コード例 #2
0
        public async void ChangeSizeOfTabs()
        {
            UpdateNoBookmarks();
            for (int i = 0; i < selectTabItems.Length; i++)
            {
                bool sel = selectedTabItem == i;
                _ = selectTabLabels[i].ScaleTo(sel ? 1.1 : 0.9, 150, Easing.SinOut);
                selectTabLabels[i].FontAttributes = sel ? FontAttributes.Bold : FontAttributes.None;
                selectTabLabels[i].TextColor      = sel ? Color.FromHex("#FFF") : Color.FromHex("#c9c9c9");
            }
            bool bookmarkVis = selectedTabItem == 0;

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

            BookHolder.IsVisible  = bookmarkVis;
            Top100Stack.IsVisible = !bookmarkVis;
            _ = Top100Stack.FadeTo(bookmarkVis ? 0 : 1);
            if (selectedTabItem > 0)
            {
                var _movieIndex = selectedTabItem - 1;
                if (MovieIndex != _movieIndex)
                {
                    MovieIndex = _movieIndex;
                    IndexChanged();
                }
            }
            await BookHolder.FadeTo(bookmarkVis? 1 : 0);
        }
コード例 #3
0
        async void SetRecs(bool isFromSizeChange = false, int?height = null, int?width = null)
        {
            if (isFromSizeChange)
            {
                BookHolder.Opacity = 0;
            }

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

                // int row = (int)Math.Floor((Bookmarks.Children.Count - 1) / (double)perCol);
                // Recommendations.HeightRequest = (RecPosterHeight + Recommendations.RowSpacing) * (total / perCol);
                var lay = new GridItemsLayout(perCol, ItemsLayoutOrientation.Vertical);
                lay.VerticalItemSpacing   = 5;
                lay.HorizontalItemSpacing = 5;
                BookmarkView.ItemsLayout  = lay;

                BookmarkView.HeightRequest = Math.Ceiling(bookmarkPosters.Count / (float)perCol) * 200 + 20;                 //(bookmarkLabelTransY + RecPosterHeight + Bookmarks.RowSpacing) * (((Bookmarks.Children.Count - 1) / perCol) + 1) - 7 + Bookmarks.RowSpacing;
                //Bookmarks.WidthRequest = Application.Current.MainPage.Width < Application.Current.MainPage.Height ? Application.Current.MainPage.Width : Application.Current.MainPage.Height;
                if (isFromSizeChange)
                {
                    await Task.Delay(100);
                    _ = BookHolder.FadeTo(1, 75);
                }
            });
        }
コード例 #4
0
    void Start()
    {
        BookHolder asset = Resources.Load <BookHolder>(assetName);

        foreach (Menu gd in asset.menus)
        {
            Debug.Log(gd.m_Id);
            Debug.Log(gd.m_level);
            Debug.Log(gd.m_parentId);
            Debug.Log(gd.m_name);
        }
    }
コード例 #5
0
ファイル: BuildAssert.cs プロジェクト: rabbit99/Unity-Scripts
    public static void ExcuteBuild()
    {
        BookHolder holder = ScriptableObject.CreateInstance <BookHolder>();

        //查询excel表中数据,赋值给asset文件
        holder.menus = ExcelAccess.SelectMenuTable();

        string path = "Assets/Resources/booknames.asset";

        AssetDatabase.CreateAsset(holder, path);
        AssetDatabase.Refresh();

        Debug.Log("BuildAsset Success!");
    }