wxr
2020-02-27 37c33341f75841dc39c535eb62a3603f596516a1
HDL_ON/UI/UI2/UserPage.cs
@@ -3,14 +3,14 @@
namespace HDL_ON.UI
{
    public partial class UserPage : PageLayout
    public partial class UserPage : FrameLayout
    {
        #region 控件列表
        /// <summary>
        /// 当前区域
        /// </summary>
        static PageLayout bodyView;
        FrameLayout bodyView;
        /// <summary>
        /// 内容区域
        /// </summary>
@@ -83,20 +83,30 @@
        #endregion
        #endregion
        /// <summary>
        /// 当前动画效果
        /// 0:收藏
        /// 1:分类
        /// 2:智能
        /// 3:个人
        /// </summary>
        int CurAnimationEffect = 0;
        public void LoadPage()
        {
            bodyView = this;
            bodyView.BackgroundColor = CSS.CSS_Color.MainBackgroundColor;
            ContextView = new FrameLayout()
            {
                Height = Application.GetRealHeight(618),
                BackgroundColor = CSS.CSS_Color.BackgroundColor
                Height = Application.GetRealHeight(618+30),
                BackgroundColor = CSS.CSS_Color.BackgroundColor,
            };
            bodyView.AddChidren(ContextView);
            navigationView = new FrameLayout()
            {
                Y = Application.GetRealHeight(607),
                Height = Application.GetRealHeight(60),
                Height = Application.GetMinRealAverage(60),
            };
            bodyView.AddChidren(navigationView);
@@ -109,12 +119,32 @@
        /// 初始化底部区域
        /// </summary>
        void InitBottomView()
        {
        {
            navigationSelectionView = new FrameLayout()
            {
                X = Application.GetMinRealAverage(0 - 94 * 3),
                Y = Application.GetMinRealAverage(4),
                Width = Application.GetMinRealAverage(94 * 7),
                Height = Application.GetMinRealAverage(38),
                BackgroundImagePath = "Navigation/UserPageNavbg.png",
            };
            navigationView.AddChidren(navigationSelectionView);
            btnNavigationSelectionIcon = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetMinRealAverage(6),
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/CollectionIconOn.png",
            };
            navigationSelectionView.AddChidren(btnNavigationSelectionIcon);
            NavigationSubView = new FrameLayout()
            {
                Y = Application.GetRealHeight(11),
                Y = Application.GetMinRealAverage(11),
                Height = Application.GetRealHeight(49),
                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
                //BackgroundColor=0xFF00F0F0
            };
            navigationView.AddChidren(NavigationSubView);
@@ -129,6 +159,8 @@
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/CollectionIcon.png",
                SelectedImagePath = "0Common/transparent.png",
                IsSelected = true,
            };
            collectionView.AddChidren(btnCollectionIcon);
            btnCollectionText = new Button()
@@ -139,7 +171,7 @@
                SelectedTextColor = CSS.CSS_Color.MainColor,
                TextColor =CSS.CSS_Color.FirstLevelTitleColor,
                TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextID = InternationalizationString.Collection,
                TextID = StringId.Collection,
                TextAlignment = TextAlignment.Center,
            };
            collectionView.AddChidren(btnCollectionText);
@@ -159,6 +191,7 @@
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/ClassificationIcon.png",
                SelectedImagePath = "0Common/transparent.png",
            };
            classificationView.AddChidren(btnClassificationIcon);
            btnClassificationText = new Button()
@@ -169,7 +202,7 @@
                SelectedTextColor = CSS.CSS_Color.MainColor,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextID = InternationalizationString.Classification,
                TextID = StringId.Classification,
                TextAlignment = TextAlignment.Center,
            };
            classificationView.AddChidren(btnClassificationText);
@@ -189,6 +222,7 @@
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/IntellectualizationIcon.png",
                SelectedImagePath = "0Common/transparent.png",
            };
            intellectualizationView.AddChidren(btnIntellectualizationIcon);
            btnIntellectualizationText = new Button()
@@ -199,7 +233,7 @@
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                SelectedTextColor = CSS.CSS_Color.MainColor,
                TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextID = InternationalizationString.Intellectualization,
                TextID = StringId.Intellectualization,
                TextAlignment = TextAlignment.Center,
            };
            intellectualizationView.AddChidren(btnIntellectualizationText);
@@ -220,7 +254,7 @@
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/PersonalCenterIcon.png",
                SelectedImagePath = "Navigation/PersonalCenterIconOn.png",
                SelectedImagePath = "0Common/transparent.png",
            };
            personalCenterView.AddChidren(btnPersonalCenterIcon);
@@ -232,31 +266,17 @@
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                SelectedTextColor = CSS.CSS_Color.MainColor,
                TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextID = InternationalizationString.Personal,
                TextID = StringId.Personal,
                TextAlignment = TextAlignment.Center,
            };
            personalCenterView.AddChidren(btnPersonalCenterText);
            #endregion
            navigationSelectionView = new FrameLayout()
            {
                X = Application.GetRealWidth(0),
                Width = Application.GetRealWidth(94),
                Height = Application.GetRealHeight(40),
                BackgroundImagePath = "Navigation/UserPageNavbg.png",
            };
            navigationView.AddChidren(navigationSelectionView);
            btnNavigationSelectionIcon = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(6),
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/CollectionIconOn.png",
            };
            navigationSelectionView.AddChidren(btnNavigationSelectionIcon);
            var homePage = new HomePage();
            ContextView.AddChidren(homePage);
            homePage.LoadPage();
        }
@@ -265,12 +285,16 @@
        /// </summary>
        void ChooseCollection()
        {
            CurAnimationEffect = 0;
            btnClassificationIcon.IsSelected = false;
            btnIntellectualizationIcon.IsSelected = false;
            btnPersonalCenterIcon.IsSelected = false;
            btnCollectionText.IsSelected = false;
            btnClassificationText.IsSelected = false;
            btnIntellectualizationText.IsSelected = false;
            btnPersonalCenterText.IsSelected = false;
            #region 移动动画
            var distance = navigationSelectionView.X - collectionView.X;
            var distance = navigationSelectionView.X - collectionView.X + Application.GetMinRealAverage(94*3);
            int total = 10;
            int sleepTime = 300;
            if (distance > 200)
@@ -287,6 +311,10 @@
            new System.Threading.Thread(() => {
                int index = 0;
                while (index < total+1) {
                    if (CurAnimationEffect != 0)
                    {
                        break;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        //移动
@@ -296,8 +324,15 @@
                        }
                        else
                        {
                            navigationSelectionView.X = collectionView.X;
                            navigationSelectionView.X = collectionView.X - Application.GetMinRealAverage(94 * 3);
                            btnCollectionText.IsSelected = true;
                            btnCollectionIcon.IsSelected = true;
                            btnClassificationIcon.IsSelected = false;
                            btnIntellectualizationIcon.IsSelected = false;
                            btnPersonalCenterIcon.IsSelected = false;
                            btnClassificationText.IsSelected = false;
                            btnIntellectualizationText.IsSelected = false;
                            btnPersonalCenterText.IsSelected = false;
                        }
                        if (index == (total/2))
                        {
@@ -311,18 +346,26 @@
                }
            }) { IsBackground = true }.Start();
            #endregion
            ContextView.RemoveAll();
            var homePage = new HomePage();
            ContextView.AddChidren(homePage);
            homePage.LoadPage();
        }
        /// <summary>
        /// 切换到分类界面
        /// </summary>
        void ChooseClassification()
        {
            CurAnimationEffect = 1;
            btnCollectionIcon.IsSelected = false;
            btnIntellectualizationIcon.IsSelected = false;
            btnPersonalCenterIcon.IsSelected = false;
            btnCollectionText.IsSelected = false;
            btnClassificationText.IsSelected = false;
            btnIntellectualizationText.IsSelected = false;
            btnPersonalCenterText.IsSelected = false;
            #region 移动动画
            var distance = navigationSelectionView.X - classificationView.X;
            var distance = navigationSelectionView.X - classificationView.X + Application.GetMinRealAverage(94 * 3);
            int total = 10;
            int sleepTime = 300;
            if (distance > 100 || distance < -100)
@@ -336,6 +379,10 @@
                int index = 0;
                while (index < total+1)
                {
                    if (CurAnimationEffect != 1)
                    {
                        break;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        //移动
@@ -345,8 +392,15 @@
                        }
                        else
                        {
                            navigationSelectionView.X = classificationView.X;
                            navigationSelectionView.X = classificationView.X - Application.GetMinRealAverage(94 * 3);
                            btnClassificationText.IsSelected = true;
                            btnClassificationIcon.IsSelected = true;
                            btnCollectionIcon.IsSelected = false;
                            btnIntellectualizationIcon.IsSelected = false;
                            btnPersonalCenterIcon.IsSelected = false;
                            btnCollectionText.IsSelected = false;
                            btnIntellectualizationText.IsSelected = false;
                            btnPersonalCenterText.IsSelected = false;
                        }
                        if (index == (total / 2 ))
                        {
@@ -368,7 +422,10 @@
            })
            { IsBackground = true }.Start();
            #endregion
            ContextView.RemoveAll();
            var classificaitionView = new UI.ClassificationPage();
            ContextView.AddChidren(classificaitionView);
            classificaitionView.LoadPage();
        }
@@ -377,12 +434,16 @@
        /// </summary>
        void ChooseIntellectualization()
        {
            CurAnimationEffect = 2;
            btnCollectionText.IsSelected = false;
            btnClassificationText.IsSelected = false;
            btnIntellectualizationText.IsSelected = false;
            btnPersonalCenterText.IsSelected = false;
            btnCollectionIcon.IsSelected = false;
            btnClassificationIcon.IsSelected = false;
            btnPersonalCenterIcon.IsSelected = false;
            #region 移动动画
            var distance = navigationSelectionView.X - intellectualizationView.X;
            var distance = navigationSelectionView.X - intellectualizationView.X + Application.GetMinRealAverage(94 * 3);
            int total = 10;
            int sleepTime = 300;
            if (distance > 100 || distance < -100)
@@ -395,6 +456,10 @@
                int index = 0;
                while (index < total+1)
                {
                    if(CurAnimationEffect!=2)
                    {
                        break;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        //移动
@@ -404,8 +469,15 @@
                        }
                        else
                        {
                            navigationSelectionView.X = intellectualizationView.X;
                            navigationSelectionView.X = intellectualizationView.X - Application.GetMinRealAverage(94 * 3);
                            btnIntellectualizationText.IsSelected = true;
                            btnIntellectualizationIcon.IsSelected = true;
                            btnCollectionText.IsSelected = false;
                            btnClassificationText.IsSelected = false;
                            btnPersonalCenterText.IsSelected = false;
                            btnCollectionIcon.IsSelected = false;
                            btnClassificationIcon.IsSelected = false;
                            btnPersonalCenterIcon.IsSelected = false;
                        }
                        if (index == (total / 2 ))
                        {
@@ -427,6 +499,7 @@
            })
            { IsBackground = true }.Start();
            #endregion
            ContextView.RemoveAll();
        }
        /// <summary>
@@ -434,12 +507,16 @@
        /// </summary>
        void ChoosePersonalCenter()
        {
            CurAnimationEffect = 3;
            btnCollectionText.IsSelected = false;
            btnClassificationText.IsSelected = false;
            btnIntellectualizationText.IsSelected = false;
            btnPersonalCenterText.IsSelected = false;
            btnCollectionIcon.IsSelected = false;
            btnClassificationIcon.IsSelected = false;
            btnIntellectualizationIcon.IsSelected = false;
            #region 移动动画
            var distance = navigationSelectionView.X - personalCenterView.X;
            var distance = navigationSelectionView.X - personalCenterView.X + Application.GetMinRealAverage(94 * 3);
            int total = 10;
            int sleepTime = 300;
            if (distance < -200)
@@ -457,6 +534,10 @@
                int index = 0;
                while (index < total+1)
                {
                    if (CurAnimationEffect != 3)
                    {
                        break;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        //移动
@@ -466,8 +547,15 @@
                        }
                        else
                        {
                            navigationSelectionView.X = personalCenterView.X;
                            navigationSelectionView.X = personalCenterView.X - Application.GetMinRealAverage(94 * 3);
                            btnPersonalCenterText.IsSelected = true;
                            btnPersonalCenterIcon.IsSelected = true;
                            btnCollectionText.IsSelected = false;
                            btnClassificationText.IsSelected = false;
                            btnIntellectualizationText.IsSelected = false;
                            btnCollectionIcon.IsSelected = false;
                            btnClassificationIcon.IsSelected = false;
                            btnIntellectualizationIcon.IsSelected = false;
                        }
                        if (index == (total / 2 ))
                        {
@@ -484,7 +572,8 @@
            #endregion
            var personalCenterPage = new UI2.PersonalCenterPage();
            ContextView.RemoveAll();
            var personalCenterPage = new UI.PersonalCenterPage();
            ContextView.AddChidren(personalCenterPage);
            personalCenterPage.LoadView();
        }