From e8df87f35143575086d56c20a01cac7d593bbb08 Mon Sep 17 00:00:00 2001 From: Hyerim Kim Date: Fri, 5 May 2017 17:15:53 +0900 Subject: [PATCH] Modifies Move cancel action of AppsSubPanel Modifies Column spacing to -97 of MainPanel Modifies Context popup cancel action of Apps items Change-Id: Id449af2e95ee26a5c11cf630722b724d3ae1e232 Signed-off-by: Hyerim Kim --- TVApps/TVApps/Controls/AppItemCell.xaml.cs | 1 + .../TVApps/Views/FooterNormalStatus.xaml.cs | 6 ++++- TVApps/TVApps/Views/MainPage.xaml.cs | 26 ++++++++++++++++--- TVHome/TVHome/Controls/PanelButton.cs | 2 ++ TVHome/TVHome/Controls/SubPanelButton.xaml.cs | 15 ++++++++--- TVHome/TVHome/Views/MainPanel.xaml | 3 +-- TVHome/TVHome/Views/SubPanel.xaml.cs | 12 ++++----- 7 files changed, 48 insertions(+), 17 deletions(-) mode change 100644 => 100755 TVHome/TVHome/Views/MainPanel.xaml diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml.cs b/TVApps/TVApps/Controls/AppItemCell.xaml.cs index 70a92ce..e6680f9 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml.cs +++ b/TVApps/TVApps/Controls/AppItemCell.xaml.cs @@ -335,6 +335,7 @@ namespace TVApps.Controls isPopupShowing = false; ShowOptionMenu(false); + View.Focus(); }; popup.Show(this.View, this.View.Width / 2, this.View.Height - height144); diff --git a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs index 7bb5be1..7170608 100755 --- a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs +++ b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs @@ -61,6 +61,8 @@ namespace TVApps.Views set { SetValue(SortOptionIndexCommandProperty, value); } } + public ICommand ChangeBackKeyInfoCommand { get; set; } + /// /// A constructor /// @@ -131,7 +133,7 @@ namespace TVApps.Views }; popup.Items.Add(new ContextPopupItem("PIN")); - popup.Items.Add(new ContextPopupItem(" DELETE ")); + popup.Items.Add(new ContextPopupItem(" DELETE ")); //TODO: need to change the event callback popup.SelectedIndexChanged += (s, args) => @@ -159,12 +161,14 @@ namespace TVApps.Views popup.Dismissed += (s, args) => { isPopupShowing = false; + ChangeBackKeyInfoCommand?.Execute(isPopupShowing); }; View anchor = sender as View; popup.Show(anchor, anchor.Width/2, 0); isPopupShowing = true; + ChangeBackKeyInfoCommand?.Execute(isPopupShowing); } } } diff --git a/TVApps/TVApps/Views/MainPage.xaml.cs b/TVApps/TVApps/Views/MainPage.xaml.cs index 3ebef9b..6f044fb 100755 --- a/TVApps/TVApps/Views/MainPage.xaml.cs +++ b/TVApps/TVApps/Views/MainPage.xaml.cs @@ -39,6 +39,7 @@ namespace TVApps.Views private DropdownList sortList; private Button doneButton; private Button cancelButton; + private bool isShowOptions = false; /// /// SubPanel icon's transition height value when it focused. @@ -132,7 +133,7 @@ namespace TVApps.Views animation.Add(0.2, 0.8, appListAnimation); animation.Add(0.2, 1, mainAnimation); - animation.Commit(this, "QuitAnimation", 16, 834); + animation.Commit(this, "QuitAnimation", 16, 834, null, (v, s) => AppControlUtils.SelfTerminate()); } @@ -170,6 +171,18 @@ namespace TVApps.Views MakeFocusChaining(); AppList.InitializeFocus(); }); + + FooterNormal.ChangeBackKeyInfoCommand = new Command((isShowingPopup) => + { + if (isShowingPopup) + { + BackKeyInfo.Text = "Front"; + } + else + { + BackKeyInfo.Text = "Quit"; + } + }); } protected override async void OnAppearing() @@ -353,7 +366,14 @@ namespace TVApps.Views FooterPin.additionalInfo.IsVisible = false; FooterDelete.IsVisible = false; BackKeyInfo.Text = "Quit"; - AppList.InitializeFocus(); + if (isShowOptions) + { + isShowOptions = false; + } + else + { + AppList.InitializeFocus(); + } break; case AppsStatus.Pin: FooterNormal.IsVisible = false; @@ -429,8 +449,6 @@ namespace TVApps.Views if (answer) { PlayHideAnimation(); - await Task.Delay(800); - AppControlUtils.SelfTerminate(); } else { diff --git a/TVHome/TVHome/Controls/PanelButton.cs b/TVHome/TVHome/Controls/PanelButton.cs index b2591c0..398c7da 100755 --- a/TVHome/TVHome/Controls/PanelButton.cs +++ b/TVHome/TVHome/Controls/PanelButton.cs @@ -68,6 +68,8 @@ namespace TVHome.Controls public ICommand OnDefaultModeCommand { get; set; } + public ICommand OnShowOptionsCommand { get; set; } + /// /// Handles Button Focused event /// diff --git a/TVHome/TVHome/Controls/SubPanelButton.xaml.cs b/TVHome/TVHome/Controls/SubPanelButton.xaml.cs index 666c89f..b3e929a 100755 --- a/TVHome/TVHome/Controls/SubPanelButton.xaml.cs +++ b/TVHome/TVHome/Controls/SubPanelButton.xaml.cs @@ -119,6 +119,10 @@ namespace TVHome.Controls { OnDefaultModeCommand.Execute(""); } + else if (ctxPopup.SelectedIndex == 1) + { + OnShowOptionsCommand?.Execute(isShowOptions); + } }; popup.Show(View, View.Width / 2, View.Height - (moveTransitionHeight + selectTransitionHeight)); @@ -175,16 +179,18 @@ namespace TVHome.Controls { if (!isDefault) { - View.TranslateTo(SizeUtils.GetWidthSize((int)View.TranslationX), 0, 300); + await View.TranslateTo(SizeUtils.GetWidthSize((int)View.TranslationX), 0, 300); } else { await View.TranslateTo(0, SizeUtils.GetHeightSize((int)View.TranslationY), 0); - View.TranslateTo(0, 0, 300); + await View.TranslateTo(0, 0, 300); } OnFocused(null, null); } + + OnShowOptionsCommand?.Execute(moveMode); #pragma warning restore CS4014 } @@ -198,7 +204,10 @@ namespace TVHome.Controls else { await View.TranslateTo(0, 0, 300); + OnFocused(null, null); } + + OnShowOptionsCommand?.Execute(showOptions); } /// @@ -209,7 +218,7 @@ namespace TVHome.Controls public override async void OnFocused(object sender, FocusEventArgs e) { isFocused = true; - if (isMoveMode) + if (isMoveMode || isShowOptions) { return; } diff --git a/TVHome/TVHome/Views/MainPanel.xaml b/TVHome/TVHome/Views/MainPanel.xaml old mode 100644 new mode 100755 index 25c4cb7..5ab1ad3 --- a/TVHome/TVHome/Views/MainPanel.xaml +++ b/TVHome/TVHome/Views/MainPanel.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:Views="clr-namespace:TVHome.Views" x:Class="TVHome.Views.MainPanel"> - @@ -12,6 +11,6 @@ - 0 + -94 \ No newline at end of file diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index 2504bde..2d7696f 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -155,8 +155,6 @@ namespace TVHome.Views { OnMoveVMCommand.Execute(ButtonViewList); } - - OnShowOptionsCommand.Execute(isMoveMode); }); } @@ -188,12 +186,16 @@ namespace TVHome.Views button.OnUnpinCommand = new Command(() => { AppShortcutInfo shortcut = (AppShortcutInfo)button.View.BindingContext; - OnUnpinVMCommand.Execute(shortcut.AppID); + OnUnpinVMCommand?.Execute(shortcut.AppID); }); button.OnDefaultModeCommand = new Command(() => { ChangeToDefaultMode(); }); + button.OnShowOptionsCommand = new Command((param) => + { + OnShowOptionsCommand?.Execute(param); + }); PanelButtonStack.Children.Add(button.View); ButtonViewList.Add(button.View); @@ -349,8 +351,6 @@ namespace TVHome.Views { ButtonViewList.Add(stackItem); } - - OnShowOptionsCommand.Execute(isMoveMode); } else if (isShowOptions) { @@ -364,8 +364,6 @@ namespace TVHome.Views ChangeIsEnabledProperty(item.View, true); } } - - OnShowOptionsCommand?.Execute(isShowOptions); } } -- 2.34.1