Modifies Move cancel action of AppsSubPanel
authorHyerim Kim <rimi.kim@samsung.com>
Fri, 5 May 2017 08:15:53 +0000 (17:15 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:54 +0000 (18:34 +0900)
Modifies Column spacing to -97 of MainPanel
Modifies Context popup cancel action of Apps items

Change-Id: Id449af2e95ee26a5c11cf630722b724d3ae1e232
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVApps/TVApps/Controls/AppItemCell.xaml.cs
TVApps/TVApps/Views/FooterNormalStatus.xaml.cs
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome/Controls/PanelButton.cs
TVHome/TVHome/Controls/SubPanelButton.xaml.cs
TVHome/TVHome/Views/MainPanel.xaml [changed mode: 0644->0755]
TVHome/TVHome/Views/SubPanel.xaml.cs

index 70a92ce5cd3cf3498e1b8b9b56e5557e6d1fccff..e6680f92d03c28127d50b0a174b6aaf64eeaf94f 100755 (executable)
@@ -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);
index 7bb5be1f27defea8a3989a58be71b3c80efb4cff..7170608205ca19bf3e33a1d4a48e1a3473feb0a0 100755 (executable)
@@ -61,6 +61,8 @@ namespace TVApps.Views
             set { SetValue(SortOptionIndexCommandProperty, value); }
         }
 
+        public ICommand ChangeBackKeyInfoCommand { get; set; }
+
         /// <summary>
         /// A constructor
         /// </summary>
@@ -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);
         }
     }
 }
index 3ebef9bcb265c468630d73d823ddf07919d92966..6f044fb2ec1152d2e688d82f30ffb19ce45eeba3 100755 (executable)
@@ -39,6 +39,7 @@ namespace TVApps.Views
         private DropdownList sortList;
         private Button doneButton;
         private Button cancelButton;
+        private bool isShowOptions = false;
 
         /// <summary>
         /// 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<bool>((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
             {
index b2591c0b2cbf1592d524fdb77a856021ec809e6c..398c7dae86d7bf11f5b89d85ddae1b1b686c5cb7 100755 (executable)
@@ -68,6 +68,8 @@ namespace TVHome.Controls
 
         public ICommand OnDefaultModeCommand { get; set; }
 
+        public ICommand OnShowOptionsCommand { get; set; }
+
         /// <summary>
         /// Handles Button Focused event
         /// </summary>
index 666c89fca4a9aca1caec96b529106dd0b3c2f2d0..b3e929a2c003071ec367351e25ae716c22aef21c 100755 (executable)
@@ -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);
         }
 
         /// <summary>
@@ -209,7 +218,7 @@ namespace TVHome.Controls
         public override async void OnFocused(object sender, FocusEventArgs e)
         {
             isFocused = true;
-            if (isMoveMode)
+            if (isMoveMode || isShowOptions)
             {
                 return;
             }
old mode 100644 (file)
new mode 100755 (executable)
index 25c4cb7..5ab1ad3
@@ -3,7 +3,6 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:Views="clr-namespace:TVHome.Views"
              x:Class="TVHome.Views.MainPanel">
-    <!-- TODO : Grid.ColumnSpacing should be -94 after taking Focus managemant -->
     <Grid x:Name="PanelButtonGrid">
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*" />
@@ -12,6 +11,6 @@
             <ColumnDefinition Width="{Binding MainPanelIconWidth}" />
             <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
-        <Grid.ColumnSpacing>0</Grid.ColumnSpacing>
+        <Grid.ColumnSpacing>-94</Grid.ColumnSpacing>
     </Grid>
 </Views:Panel>
\ No newline at end of file
index 2504bde7cc631f9a605c16dd6fc7a3822b2664b7..2d7696f1cfd670ff4370b2770c9721aadcb544cf 100755 (executable)
@@ -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<bool>((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);
             }
         }