| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class UserPage : FrameLayout |
| | | public partial class UserPage : PageLayout |
| | | { |
| | | |
| | | #region 控件列表 |
| | | /// <summary> |
| | | /// 当前区域 |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | static PageLayout bodyView; |
| | | /// <summary> |
| | | /// 内容区域 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 导航栏区域 |
| | | /// </summary> |
| | | FrameLayout NavigationView; |
| | | FrameLayout navigationView; |
| | | /// <summary> |
| | | /// 导航栏点击区域 |
| | | /// </summary> |
| | |
| | | /// <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() { |
| | |
| | | classificationView.AddChidren(btnClassificationText); |
| | | #endregion |
| | | |
| | | #region 分类区域 |
| | | #region 智能区域 |
| | | intellectualizationView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | 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); |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |