Implement Home, Apps according to UI/GUI guideline
authorHyerim Kim <rimi.kim@samsung.com>
Mon, 24 Apr 2017 00:35:34 +0000 (09:35 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
 - Changes move resources
 - Focusing the Main panel when add pin flow is ended
 - Implements Thumbnail no content info window with Ninepatch bg image
 - Scrolling the apps subpanel correctly
 - Changing the apps subpanel to default mode when home is iconified

Change-Id: I324f82a2f4243f0240ba147e8a907df20816f95f
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
14 files changed:
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj
TVHome/TVHome.TizenTV/res/btn_home_list_move_left.png [new file with mode: 0755]
TVHome/TVHome.TizenTV/res/btn_home_list_move_right.png [new file with mode: 0755]
TVHome/TVHome.TizenTV/res/btn_option_menu_nocontent_bg.9.png [new file with mode: 0755]
TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_focused.png [deleted file]
TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_normal.png [deleted file]
TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_focused.png [deleted file]
TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_normal.png [deleted file]
TVHome/TVHome/Controls/SubPanelButton.xaml
TVHome/TVHome/ViewModels/MainPageViewModel.cs
TVHome/TVHome/Views/MainPage.xaml.cs
TVHome/TVHome/Views/SubPanel.xaml.cs
TVHome/TVHome/Views/SubThumbnailPanel.xaml

index 087eb5b3f9dae956511f28537359f04eb3afba42..6f042421f4ac6307bcbc455a0888da0fb0e814cd 100755 (executable)
@@ -168,6 +168,7 @@ namespace TVApps.Views
             AppList.OnChangeFocusChainingCommand = new Command(() =>
             {
                 MakeFocusChaining();
+                AppList.InitializeFocus();
             });
         }
 
@@ -359,24 +360,18 @@ namespace TVApps.Views
                     FooterNormal.IsVisible = false;
                     FooterPin.IsVisible = true;
                     FooterDelete.IsVisible = false;
-                    AddtionalInfo.IsVisible = true;
-                    TitleLabel.IsVisible = false;
                     BackKeyInfo.Text = "Front";
                     break;
                 case AppsStatus.Delete:
                     FooterNormal.IsVisible = false;
                     FooterPin.IsVisible = false;
                     FooterDelete.IsVisible = true;
-                    AddtionalInfo.IsVisible = true;
-                    TitleLabel.IsVisible = false;
                     BackKeyInfo.Text = "Front";
                     break;
                 case AppsStatus.LongPress:
                     FooterNormal.IsVisible = true;
                     FooterPin.IsVisible = false;
                     FooterDelete.IsVisible = false;
-                    AddtionalInfo.IsVisible = false;
-                    TitleLabel.IsVisible = true;
                     BackKeyInfo.Text = "Front";
                     break;
             }
@@ -406,6 +401,10 @@ namespace TVApps.Views
                     ret.Add("answer", answer ? "yes" : "no");
                     DeletePopupCommand?.Execute(ret);
                 }
+                else
+                {
+                    AppList.InitializeFocus();
+                }
             }
             else if (e.PropertyName.Equals("SumOfCheckedApp"))
             {
index da00fe4f26a3452da945e40fd7be2e7063f1f924..9185efaedfce81668cf84c4bccfb0436a268216a 100755 (executable)
     <Content Include="res\AppIcon.png" />
     <Content Include="res\background.jpg" />
     <Content Include="res\bg_dimmed.png" />
+    <Content Include="res\btn_home_list_move_left.png" />
+    <Content Include="res\btn_home_list_move_right.png" />
+    <Content Include="res\btn_option_menu_nocontent_bg.9.png" />
     <Content Include="res\btn_tizen_dropdown_line_dimmed.9.png" />
     <Content Include="res\btn_tizen_dropdown_line_normal.9.png" />
-    <Content Include="res\btn_tizen_home_list_move_left_focused.png" />
-    <Content Include="res\btn_tizen_home_list_move_left_normal.png" />
-    <Content Include="res\btn_tizen_home_list_move_right_focused.png" />
-    <Content Include="res\btn_tizen_home_list_move_right_normal.png" />
     <Content Include="res\btn_tizen_option_box_dimmed.9.png" />
     <Content Include="res\btn_tizen_option_box_normal.9.png" />
     <Content Include="res\btn_tizen_option_menu_bg_focused.9.png" />
diff --git a/TVHome/TVHome.TizenTV/res/btn_home_list_move_left.png b/TVHome/TVHome.TizenTV/res/btn_home_list_move_left.png
new file mode 100755 (executable)
index 0000000..8342f23
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/btn_home_list_move_left.png differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_home_list_move_right.png b/TVHome/TVHome.TizenTV/res/btn_home_list_move_right.png
new file mode 100755 (executable)
index 0000000..9b73e2a
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/btn_home_list_move_right.png differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_option_menu_nocontent_bg.9.png b/TVHome/TVHome.TizenTV/res/btn_option_menu_nocontent_bg.9.png
new file mode 100755 (executable)
index 0000000..a71e7f1
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/btn_option_menu_nocontent_bg.9.png differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_focused.png b/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_focused.png
deleted file mode 100755 (executable)
index b1b3872..0000000
Binary files a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_focused.png and /dev/null differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_normal.png b/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_normal.png
deleted file mode 100755 (executable)
index 8342f23..0000000
Binary files a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_left_normal.png and /dev/null differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_focused.png b/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_focused.png
deleted file mode 100755 (executable)
index 1689664..0000000
Binary files a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_focused.png and /dev/null differ
diff --git a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_normal.png b/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_normal.png
deleted file mode 100755 (executable)
index 9b73e2a..0000000
Binary files a/TVHome/TVHome.TizenTV/res/btn_tizen_home_list_move_right_normal.png and /dev/null differ
index cbd9f3c6f384a46ed7ebc7ba7101fe944bf43ae7..ca75f41598d9c28fac5155443bc46a85edfbebf4 100755 (executable)
            RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.326923}"
            RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.156521}"
            RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.06044}"
-           Source="btn_tizen_home_list_move_left_focused.png"
+           Source="btn_home_list_move_left.png"
            Opacity="0"/>
     <Image x:Name="RightBtnImg"
            RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.93956}"
            RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.326923}"
            RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.156521}"
            RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.06044}"
-            Source="btn_tizen_home_list_move_right_focused.png"
+            Source="btn_home_list_move_right.png"
            Opacity="0"/>
   </RelativeLayout>
 </Controls:PanelButton>
\ No newline at end of file
index 2964edd5bcdfb2a23a55484058a8d3e60a098ecc..f4d4480fabf64e7ee077f87487891e5429766eec 100755 (executable)
@@ -188,7 +188,6 @@ namespace TVHome.ViewModels
             App.SetAppPinnedNotificationListener((s, e) =>
             {
                 // TODO : Make this for Move a pinned app/Show pinned apps(scroll to last)
-                ChangeCurrentStatus(HomeStatus.SubPanelFocused);
                 ChangeSelectedPanelName(HomeMenuItem.Apps);
                 if (e.arg.Length > 0)
                 {
index 0d0df0595f9ec7a0f9da61603d2a120d3c4cbba2..0932dceb6079e5dcc4af784e4db3e59f0c7a9750 100755 (executable)
@@ -126,6 +126,11 @@ namespace TVHome.Views
 
             App.SetHomeKeyListener((e, arg) =>
             {
+                if (AppsSubPanel.isMoveMode)
+                {
+                    AppsSubPanel.ChangeToDefaultMode();
+                }
+
                 ToggleIconified();
             });
 
index cf9f6a3393dee67d41898f2df5acda13a4212099..db634d5ec22800e23b0e5816f80512d90e60e274 100755 (executable)
@@ -164,6 +164,15 @@ namespace TVHome.Views
                 button.OnFocusedCommand = new Command(() =>
                 {
                     FocusPanel();
+
+                    if (SizeUtils.GetWidthSize((int)button.View.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0)
+                    {
+                        ScrollToLeft();
+                    }
+                    else if (SizeUtils.GetWidthSize((int)button.View.X) + SizeUtils.GetWidthSize(216) > SizeUtils.GetWidthSize(1920))
+                    {
+                        ScrollToRight();
+                    }
                 });
                 button.OnClickedCommand = new Command(() =>
                 {
@@ -192,6 +201,20 @@ namespace TVHome.Views
             }
         }
 
+        private async void ScrollToRight()
+        {
+            double distance = SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) + SizeUtils.GetWidthSize(216);
+            await Task.Delay(1);
+            await PanelScrollView.ScrollToAsync(distance, 0, true);
+        }
+
+        private async void ScrollToLeft()
+        {
+            double distance = SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) - SizeUtils.GetWidthSize(216);
+            await Task.Delay(1);
+            await PanelScrollView.ScrollToAsync(distance, 0, true);
+        }
+
         /// <summary>
         /// A method is called when apps subpanel is changed to move mode and change item's IsEnabled property.
         /// </summary>
index 32f2fb49115af61a22b6eb169d8ffb71bed2c784..50699cf6553364e8ea5f2c4e46842b62c042cfce 100755 (executable)
@@ -2,6 +2,7 @@
 <Views:Panel xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:Views="clr-namespace:TVHome.Views"
+             xmlns:Controls="clr-namespace:TVHome.Controls"
              x:Class="TVHome.Views.SubThumbnailPanel">
     <RelativeLayout x:Name="ThumbnailParent">
         <ScrollView x:Name="PanelScrollView"
             </StackLayout>
         </ScrollView>
         <RelativeLayout x:Name="NoContentInfo"
-                        HorizontalOptions="Center"
                         IsVisible="false"
                         RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
                         RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
-            <BoxView x:Name="BackgroundBox"
-                    RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Height, Factor=1}"
-                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Width, Factor=1}" />
+          <Controls:NinePatchImage
+                    RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Height, Factor=0.3}"
+                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Width, Factor=0.354167}"
+                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Height, Factor=0.1}"
+                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Width, Factor=0.33177}"
+                    Source="btn_option_menu_nocontent_bg.9.png"
+                    Aspect="Fill"
+                    BorderTop="2"
+                    BorderBottom="2"
+                    BorderLeft="2"
+                    BorderRight="2"/>
             <Label x:Name="Text"
-                  RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=BackgroundBox ,Property=Height, Factor=0.444444}"
-                  RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=BackgroundBox ,Property=Width, Factor=0.42284}"
-                  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=BackgroundBox ,Property=Height, Factor=0.3056}"
-                  RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=BackgroundBox ,Property=Width, Factor=0.28858}"
-                  Text="No Content to display"
+                  RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Height, Factor=0.3}"
+                  RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Width, Factor=0.354167}"
+                  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Height, Factor=0.181818}"
+                  RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=NoContentInfo ,Property=Width, Factor=0.33177}"
                   HorizontalTextAlignment="Center"
+                  VerticalTextAlignment="Center"
+                  Text="No Content to display"
                   FontSize="{Binding NoContentInformationFontSize}"
                   TextColor="White" />
         </RelativeLayout>