| | |
| | | { |
| | | try |
| | | { |
| | | bodyView = this; |
| | | bodyView = this;//1 |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | ContextView = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | Y = Application.GetRealHeight(607), |
| | | Height = Application.GetMinRealAverage(60), |
| | | //BackgroundColor = CSS_Color.BackgroundColor |
| | | }; |
| | | bodyView.AddChidren(navigationView); |
| | | if (MainPage.Increase) |
| | | { |
| | | //ContextView.Height = Application.GetRealHeight(618 + 20); |
| | | navigationView.Y = Application.GetRealHeight(597 + 5); |
| | | navigationView.Height = Application.GetRealHeight(70 - 5); |
| | | } |
| | |
| | | |
| | | LoadEventList(); |
| | | |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | | homePage.LoadPage(); |
| | | //var homePage = new HomePage(); |
| | | //ContextView.AddChidren(homePage); |
| | | //homePage.LoadPage(); |
| | | |
| | | if (!MainPage.NoLoginMode) |
| | | { |
| | | //注册推送ID |
| | | RegisteredPush(); |
| | | //2020-12-07 增加版本检测更新方法 |
| | | HDLCommon.Current.CheckIfNeedForceUpdate(); |
| | | } |
| | | //2020-12-07 增加版本检测更新方法 |
| | | HDLCommon.Current.CheckIfNeedForceUpdate(); |
| | | |
| | | #if __Android__ |
| | | //开启定位服务 |
| | | try |
| | | { |
| | | Shared.Application.StartGPSLocationService(); |
| | | if (DB_ResidenceData.Instance.CheckGPS_IsFirst) |
| | | { |
| | | DB_ResidenceData.Instance.CheckGPS_IsFirst = false; |
| | | Shared.Application.StartGPSLocationService(); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log("开启定位服务异常:" + ex.Message); |
| | |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 0; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | |
| | | //移动距离 |
| | | var distance = navigationSelectionView.X - collectionView.X + Application.GetRealWidth(94*3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 200) |
| | | { |
| | | sleepTime = 400; |
| | | total = 30; |
| | | } |
| | | else if (distance > 100) |
| | |
| | | distance /= total; |
| | | new System.Threading.Thread(() => { |
| | | int index = 0; |
| | | MainPage.CurPageIndex = 0; |
| | | while (index < total+1) |
| | | { |
| | | if (MainPage.CurPageIndex != 0) |
| | |
| | | { |
| | | navigationSelectionView.X -= distance; |
| | | } |
| | | else if (index == (total / 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = collectionView.X - Application.GetRealWidth(94 * 3); |
| | | btnCollectionText.IsSelected = true; |
| | | btnCollectionIcon.IsSelected = true; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | |
| | | btnPersonalCenterText.IsSelected = false; |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; |
| | | } |
| | | if (index == (total/2)) |
| | | if (index < (total - 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; |
| | | btnCollectionIcon.IsSelected = true; |
| | | } |
| | | //旋转 |
| | | btnNavigationSelectionIcon.SetRotation(-36f * index); |
| | | }); |
| | | System.Threading.Thread.Sleep(sleepTime / total); |
| | | System.Threading.Thread.Sleep(5); |
| | | index++; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | ContextView.RemoveAll(); |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | | homePage.LoadPage(); |
| | | }); |
| | | }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Highest}.Start(); |
| | | }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Lowest}.Start(); |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | | homePage.LoadPage(); |
| | | } |
| | | /// <summary> |
| | | /// 切换到分类界面 |
| | |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 1; |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - classificationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 100 || distance < -100) |
| | | { |
| | | total = 20; |
| | |
| | | distance /= total; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (MainPage.CurPageIndex == 1) |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 1; |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | |
| | | { |
| | | navigationSelectionView.X -= distance; |
| | | } |
| | | else if (index == (total / 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png"; |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = classificationView.X - Application.GetRealWidth(94 * 3); |
| | | btnClassificationText.IsSelected = true; |
| | | btnClassificationIcon.IsSelected = true; |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | |
| | | btnPersonalCenterText.IsSelected = false; |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png"; |
| | | } |
| | | if (index == (total / 2 )) |
| | | if (index < (total - 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png"; |
| | | btnClassificationIcon.IsSelected = true; |
| | | } |
| | | //旋转 |
| | | if (distance < 0) |
| | |
| | | btnNavigationSelectionIcon.SetRotation(-36f * index); |
| | | } |
| | | }); |
| | | System.Threading.Thread.Sleep(sleepTime / total); |
| | | System.Threading.Thread.Sleep(5); |
| | | index++; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | | classificaitionView.LoadPage(); |
| | | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | | classificaitionView.LoadPage(); |
| | | |
| | | |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 2; |
| | | btnCollectionText.IsSelected = false; |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - intellectualizationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 100 || distance < -100) |
| | | { |
| | | total = 20; |
| | | } |
| | | distance /= total; |
| | | new System.Threading.Thread(() => { |
| | | if (MainPage.CurPageIndex == 2) |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 2; |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | |
| | | { |
| | | navigationSelectionView.X -= distance; |
| | | } |
| | | else if (index == (total / 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png"; |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = intellectualizationView.X - Application.GetRealWidth(94 * 3); |
| | | btnIntellectualizationText.IsSelected = true; |
| | | btnIntellectualizationIcon.IsSelected = true; |
| | | btnCollectionText.IsSelected = false; |
| | | btnClassificationText.IsSelected = false; |
| | | btnPersonalCenterText.IsSelected = false; |
| | |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png"; |
| | | } |
| | | if (index == (total / 2 )) |
| | | if (index < (total - 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png"; |
| | | btnIntellectualizationIcon.IsSelected = true; |
| | | } |
| | | //旋转 |
| | | if (distance < 0) |
| | |
| | | btnNavigationSelectionIcon.SetRotation(-36f * index); |
| | | } |
| | | }); |
| | | System.Threading.Thread.Sleep(sleepTime / total); |
| | | System.Threading.Thread.Sleep(5); |
| | | index++; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | ContextView.RemoveAll(); |
| | | var intelligenceView = new IntelligencePage(); |
| | | ContextView.AddChidren(intelligenceView); |
| | | intelligenceView.LoadPage(); |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var intelligenceView = new IntelligencePage(); |
| | | ContextView.AddChidren(intelligenceView); |
| | | intelligenceView.LoadPage(); |
| | | |
| | | |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | MainPage.CurPageIndex = 3; |
| | | btnCollectionText.IsSelected = false; |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - personalCenterView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance < -200) |
| | | { |
| | | sleepTime = 400; |
| | | total = 30; |
| | | } |
| | | else if (distance < -100) |
| | |
| | | } |
| | | distance /= total; |
| | | new System.Threading.Thread(() => { |
| | | MainPage.CurPageIndex = 3; |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | |
| | | { |
| | | navigationSelectionView.X -= distance; |
| | | } |
| | | else if (index == (total / 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png"; |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = personalCenterView.X - Application.GetRealWidth(94 * 3); |
| | | btnPersonalCenterText.IsSelected = true; |
| | | btnPersonalCenterIcon.IsSelected = true; |
| | | btnCollectionText.IsSelected = false; |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png"; |
| | | } |
| | | if (index == (total / 2 )) |
| | | if (index < (total - 2)) |
| | | { |
| | | btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png"; |
| | | btnPersonalCenterIcon.IsSelected = true; |
| | | } |
| | | //旋转 |
| | | btnNavigationSelectionIcon.SetRotation(36f * index); |
| | | }); |
| | | System.Threading.Thread.Sleep(sleepTime / total); |
| | | System.Threading.Thread.Sleep(5); |
| | | index++; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | ContextView.RemoveAll(); |
| | | var personalCenterPage = new UI.PersonalCenterPage(); |
| | | ContextView.AddChidren(personalCenterPage); |
| | | personalCenterPage.LoadView(); |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |
| | | #endregion |
| | | |
| | | ContextView.RemoveAll(); |
| | | var personalCenterPage = new UI.PersonalCenterPage(); |
| | | ContextView.AddChidren(personalCenterPage); |
| | | personalCenterPage.LoadView(); |
| | | } |
| | | |
| | | /// <summary> |