| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class UserPage : PageLayout |
| | | public partial class UserPage : FrameLayout |
| | | { |
| | | |
| | | #region 控件列表 |
| | | /// <summary> |
| | | /// 当前区域 |
| | | /// </summary> |
| | | static PageLayout bodyView; |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 内容区域 |
| | | /// </summary> |
| | |
| | | #endregion |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 当前动画效果 |
| | | /// 0:收藏 |
| | | /// 1:分类 |
| | | /// 2:智能 |
| | | /// 3:个人 |
| | | /// </summary> |
| | | int CurAnimationEffect = 0; |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView = this; |
| | | ContextView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(618), |
| | | Height = Application.GetRealHeight(618+25), |
| | | BackgroundColor = CSS.CSS_Color.BackgroundColor |
| | | }; |
| | | bodyView.AddChidren(ContextView); |
| | |
| | | /// 初始化底部区域 |
| | | /// </summary> |
| | | void InitBottomView() |
| | | { |
| | | { |
| | | navigationSelectionView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(0 - 94 * 3), |
| | | Y = Application.GetRealHeight(4), |
| | | Width = Application.GetRealWidth(94 * 7), |
| | | Height = Application.GetRealHeight(38), |
| | | 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); |
| | | |
| | | |
| | | NavigationSubView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(11), |
| | | Height = Application.GetRealHeight(49), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | //BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | navigationView.AddChidren(NavigationSubView); |
| | | |
| | | |
| | | #region 收藏区域 |
| | | collectionView = new FrameLayout() { |
| | |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/CollectionIcon.png", |
| | | SelectedImagePath = "0Common/transparent.png", |
| | | IsSelected = true, |
| | | }; |
| | | collectionView.AddChidren(btnCollectionIcon); |
| | | btnCollectionText = new Button() |
| | |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/ClassificationIcon.png", |
| | | SelectedImagePath = "0Common/transparent.png", |
| | | }; |
| | | classificationView.AddChidren(btnClassificationIcon); |
| | | btnClassificationText = new Button() |
| | |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/IntellectualizationIcon.png", |
| | | SelectedImagePath = "0Common/transparent.png", |
| | | }; |
| | | intellectualizationView.AddChidren(btnIntellectualizationIcon); |
| | | btnIntellectualizationText = new Button() |
| | |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/PersonalCenterIcon.png", |
| | | SelectedImagePath = "Navigation/PersonalCenterIconOn.png", |
| | | SelectedImagePath = "0Common/transparent.png", |
| | | }; |
| | | personalCenterView.AddChidren(btnPersonalCenterIcon); |
| | | |
| | |
| | | #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(); |
| | | } |
| | | |
| | | |
| | |
| | | /// </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.GetRealWidth(94*3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 200) |
| | |
| | | new System.Threading.Thread(() => { |
| | | int index = 0; |
| | | while (index < total+1) { |
| | | if (CurAnimationEffect != 0) |
| | | { |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移动 |
| | |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = collectionView.X; |
| | | navigationSelectionView.X = collectionView.X - Application.GetRealWidth(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)) |
| | | { |
| | |
| | | } |
| | | }) { 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.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 100 || distance < -100) |
| | |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | | if (CurAnimationEffect != 1) |
| | | { |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移动 |
| | |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = classificationView.X; |
| | | navigationSelectionView.X = classificationView.X - Application.GetRealWidth(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 )) |
| | | { |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | #endregion |
| | | |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new UI.ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | | classificaitionView.LoadPage(); |
| | | |
| | | |
| | | } |
| | |
| | | /// </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.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance > 100 || distance < -100) |
| | |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | | if(CurAnimationEffect!=2) |
| | | { |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移动 |
| | |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = intellectualizationView.X; |
| | | navigationSelectionView.X = intellectualizationView.X - Application.GetRealWidth(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 )) |
| | | { |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </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.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | | if (distance < -200) |
| | |
| | | int index = 0; |
| | | while (index < total+1) |
| | | { |
| | | if (CurAnimationEffect != 3) |
| | | { |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移动 |
| | |
| | | } |
| | | else |
| | | { |
| | | navigationSelectionView.X = personalCenterView.X; |
| | | navigationSelectionView.X = personalCenterView.X - Application.GetRealWidth(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 )) |
| | | { |
| | |
| | | #endregion |
| | | |
| | | |
| | | var personalCenterPage = new UI2.PersonalCenterPage(); |
| | | ContextView.RemoveAll(); |
| | | var personalCenterPage = new UI.PersonalCenterPage(); |
| | | ContextView.AddChidren(personalCenterPage); |
| | | personalCenterPage.LoadView(); |
| | | } |