From 9aa32bd5ed75d54b2141b6c91f163d43216a3643 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 06 十二月 2019 13:14:02 +0800
Subject: [PATCH] 20191206

---
 HDL_ON/UI/UI2/UserPage.cs |  283 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 258 insertions(+), 25 deletions(-)

diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs
index 21695fc..c15a939 100644
--- a/HDL_ON/UI/UI2/UserPage.cs
+++ b/HDL_ON/UI/UI2/UserPage.cs
@@ -3,14 +3,14 @@
 
 namespace HDL_ON.UI
 {
-    public class UserPage : FrameLayout
+    public partial class UserPage : PageLayout
     {
 
         #region 鎺т欢鍒楄〃
         /// <summary>
         /// 褰撳墠鍖哄煙
         /// </summary>
-        FrameLayout bodyView;
+        static PageLayout bodyView;
         /// <summary>
         /// 鍐呭鍖哄煙
         /// </summary>
@@ -18,7 +18,7 @@
         /// <summary>
         /// 瀵艰埅鏍忓尯鍩�
         /// </summary>
-        FrameLayout NavigationView;
+        FrameLayout navigationView;
         /// <summary>
         /// 瀵艰埅鏍忕偣鍑诲尯鍩�
         /// </summary>
@@ -75,40 +75,48 @@
         /// <summary>
         /// 閫変腑鍖哄煙
         /// </summary>
-        FrameLayout NavigationSelectionView;
+        FrameLayout navigationSelectionView;
+        /// <summary>
+        /// 閫変腑鍖哄煙鍥炬爣
+        /// </summary>
+        Button btnNavigationSelectionIcon;
         #endregion
         #endregion
 
-        public UserPage()
+        public void LoadPage()
         {
             bodyView = this;
             ContextView = new FrameLayout()
             {
                 Height = Application.GetRealHeight(618),
+                BackgroundColor = CSS.CSS_Color.BackgroundColor
             };
             bodyView.AddChidren(ContextView);
 
-            NavigationView = new FrameLayout()
+            navigationView = new FrameLayout()
             {
                 Y = Application.GetRealHeight(607),
                 Height = Application.GetRealHeight(60),
             };
-            bodyView.AddChidren(NavigationView);
+            bodyView.AddChidren(navigationView);
 
+            InitBottomView();
+
+            LoadEventList();
         }
 
         /// <summary>
-        /// 閫変腑涓汉涓績
+        /// 鍒濆鍖栧簳閮ㄥ尯鍩�
         /// </summary>
-        public void ChoosePersonalCenter()
-        {
+        void InitBottomView()
+        { 
             NavigationSubView = new FrameLayout()
             {
                 Y = Application.GetRealHeight(11),
                 Height = Application.GetRealHeight(49),
                 BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
             };
-            NavigationView.AddChidren(NavigationSubView);
+            navigationView.AddChidren(NavigationSubView);
 
             #region 鏀惰棌鍖哄煙
             collectionView = new FrameLayout() {
@@ -167,7 +175,7 @@
             classificationView.AddChidren(btnClassificationText);
             #endregion
 
-            #region 鍒嗙被鍖哄煙
+            #region 鏅鸿兘鍖哄煙
             intellectualizationView = new FrameLayout()
             {
                 Width = Application.GetRealWidth(94),
@@ -191,7 +199,7 @@
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                 SelectedTextColor = CSS.CSS_Color.MainColor,
                 TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
-                TextID = InternationalizationString.Classification,
+                TextID = InternationalizationString.Intellectualization,
                 TextAlignment = TextAlignment.Center,
             };
             intellectualizationView.AddChidren(btnIntellectualizationText);
@@ -224,37 +232,262 @@
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                 SelectedTextColor = CSS.CSS_Color.MainColor,
                 TextSize = CSS.CSS_FontSize.PromptFontSize_SecondaryLevel,
-                TextID = InternationalizationString.Classification,
+                TextID = InternationalizationString.Personal,
                 TextAlignment = TextAlignment.Center,
             };
             personalCenterView.AddChidren(btnPersonalCenterText);
             #endregion
 
 
-            btnPersonalCenterIcon.RemoveFromParent();
-            btnPersonalCenterText.IsSelected = true;
-
-
-            NavigationSelectionView = new FrameLayout()
+            navigationSelectionView = new FrameLayout()
             {
-                X = personalCenterView.X,
+                X = Application.GetRealWidth(0),
                 Width = Application.GetRealWidth(94),
                 Height = Application.GetRealHeight(40),
                 BackgroundImagePath = "Navigation/UserPageNavbg.png",
             };
-            NavigationView.AddChidren(NavigationSelectionView);
-            btnPersonalCenterIcon.IsSelected = true;
-            btnPersonalCenterIcon.Y = Application.GetRealHeight(6);
+            navigationView.AddChidren(navigationSelectionView);
 
-            NavigationSelectionView.AddChidren(btnPersonalCenterIcon);
+            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);
+        }
 
+
+        /// <summary>
+        /// 鍒囨崲鍒版敹钘忕晫闈�
+        /// </summary>
+        void ChooseCollection()
+        {
+            btnCollectionText.IsSelected = false;
+            btnClassificationText.IsSelected = false;
+            btnIntellectualizationText.IsSelected = false;
+            btnPersonalCenterText.IsSelected = false;
+            #region 绉诲姩鍔ㄧ敾
+            var distance = navigationSelectionView.X - collectionView.X;
+            int total = 10;
+            int sleepTime = 300;
+            if (distance > 200)
+            {
+                sleepTime = 600;
+                total = 30;
+            }
+            else if (distance > 100)
+            {
+                sleepTime = 450;
+                total = 20;
+            }
+            distance /= total;
+            new System.Threading.Thread(() => {
+                int index = 0;
+                while (index < total+1) {
+                    Application.RunOnMainThread(() =>
+                    {
+                        //绉诲姩
+                        if (index < total)
+                        {
+                            navigationSelectionView.X -= distance;
+                        }
+                        else
+                        {
+                            navigationSelectionView.X = collectionView.X;
+                            btnCollectionText.IsSelected = true;
+                        }
+                        if (index == (total/2))
+                        {
+                            btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/CollectionIconOn.png";
+                        }
+                        //鏃嬭浆
+                        btnNavigationSelectionIcon.SetRotation(-36f * index);
+                    });
+                    System.Threading.Thread.Sleep(sleepTime / total);
+                    index++;
+                }
+            }) { IsBackground = true }.Start();
+            #endregion
+        }
+        /// <summary>
+        /// 鍒囨崲鍒板垎绫荤晫闈�
+        /// </summary>
+        void ChooseClassification()
+        {
+            btnCollectionText.IsSelected = false;
+            btnClassificationText.IsSelected = false;
+            btnIntellectualizationText.IsSelected = false;
+            btnPersonalCenterText.IsSelected = false;
+            #region 绉诲姩鍔ㄧ敾
+            var distance = navigationSelectionView.X - classificationView.X;
+            int total = 10;
+            int sleepTime = 300;
+            if (distance > 100 || distance < -100)
+            {
+                sleepTime = 450;
+                total = 20;
+            }
+            distance /= total;
+            new System.Threading.Thread(() =>
+            {
+                int index = 0;
+                while (index < total+1)
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        //绉诲姩
+                        if (index < total)
+                        {
+                            navigationSelectionView.X -= distance;
+                        }
+                        else
+                        {
+                            navigationSelectionView.X = classificationView.X;
+                            btnClassificationText.IsSelected = true;
+                        }
+                        if (index == (total / 2 ))
+                        {
+                            btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png";
+                        }
+                        //鏃嬭浆
+                        if (distance < 0)
+                        {
+                            btnNavigationSelectionIcon.SetRotation(36f * index);
+                        }
+                        else
+                        {
+                            btnNavigationSelectionIcon.SetRotation(-36f * index);
+                        }
+                    });
+                    System.Threading.Thread.Sleep(sleepTime / total);
+                    index++;
+                }
+            })
+            { IsBackground = true }.Start();
+            #endregion
+
+
+
+        }
+        /// <summary>
+        /// 鍒囨崲鍒版櫤鑳界晫闈�
+        /// </summary>
+        void ChooseIntellectualization()
+        {
+            btnCollectionText.IsSelected = false;
+            btnClassificationText.IsSelected = false;
+            btnIntellectualizationText.IsSelected = false;
+            btnPersonalCenterText.IsSelected = false;
+            #region 绉诲姩鍔ㄧ敾
+            var distance = navigationSelectionView.X - intellectualizationView.X;
+            int total = 10;
+            int sleepTime = 300;
+            if (distance > 100 || distance < -100)
+            {
+                sleepTime = 450;
+                total = 20;
+            }
+            distance /= total;
+            new System.Threading.Thread(() => {
+                int index = 0;
+                while (index < total+1)
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        //绉诲姩
+                        if (index < total)
+                        {
+                            navigationSelectionView.X -= distance;
+                        }
+                        else
+                        {
+                            navigationSelectionView.X = intellectualizationView.X;
+                            btnIntellectualizationText.IsSelected = true;
+                        }
+                        if (index == (total / 2 ))
+                        {
+                            btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png";
+                        }
+                        //鏃嬭浆
+                        if (distance < 0)
+                        {
+                            btnNavigationSelectionIcon.SetRotation(36f * index);
+                        }
+                        else
+                        {
+                            btnNavigationSelectionIcon.SetRotation(-36f * index);
+                        }
+                    });
+                    System.Threading.Thread.Sleep(sleepTime / total);
+                    index++;
+                }
+            })
+            { IsBackground = true }.Start();
+            #endregion
+        }
+
+        /// <summary>
+        /// 鍒囨崲鍒颁釜浜轰腑蹇冪晫闈�
+        /// </summary>
+        void ChoosePersonalCenter()
+        {
+            btnCollectionText.IsSelected = false;
+            btnClassificationText.IsSelected = false;
+            btnIntellectualizationText.IsSelected = false;
+            btnPersonalCenterText.IsSelected = false;
+            #region 绉诲姩鍔ㄧ敾
+            var distance = navigationSelectionView.X - personalCenterView.X;
+            int total = 10;
+            int sleepTime = 300;
+            if (distance < -200)
+            {
+                sleepTime = 600;
+                total = 30;
+            }
+            else if (distance < -100)
+            {
+                sleepTime = 450;
+                total = 20;
+            }
+            distance /= total;
+            new System.Threading.Thread(() => {
+                int index = 0;
+                while (index < total+1)
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        //绉诲姩
+                        if (index < total)
+                        {
+                            navigationSelectionView.X -= distance;
+                        }
+                        else
+                        {
+                            navigationSelectionView.X = personalCenterView.X;
+                            btnPersonalCenterText.IsSelected = true;
+                        }
+                        if (index == (total / 2 ))
+                        {
+                            btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png";
+                        }
+                        //鏃嬭浆
+                        btnNavigationSelectionIcon.SetRotation(36f * index);
+                    });
+                    System.Threading.Thread.Sleep(sleepTime / total);
+                    index++;
+                }
+            })
+            { IsBackground = true }.Start();
+            #endregion
 
 
             var personalCenterPage = new UI2.PersonalCenterPage();
             ContextView.AddChidren(personalCenterPage);
             personalCenterPage.LoadView();
         }
-
 
     }
 }

--
Gitblit v1.8.0