TV Home - Add Status, Animation
authorHeonjae Jang <heonjae.jang@samsung.com>
Thu, 16 Mar 2017 11:46:05 +0000 (20:46 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:48 +0000 (18:34 +0900)
Change-Id: I82cdbaaa5de41943804a7d99eef607faaaff9bf6

28 files changed:
LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs
LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs
LibTVRefCommonPortable/Utils/AppShortcutStorage.cs
TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json
TVApps/TVApps/TVApps.cs
TVApps/TVApps/ViewModels/AppsHolder.cs
TVApps/TVApps/ViewModels/MainPageViewModel.cs
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk
TVHome/TVHome.TizenTV/res/home_icon_bg_01.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_02.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_03.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_04.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_05.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_06.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_07.png [new file with mode: 0644]
TVHome/TVHome.TizenTV/res/home_icon_bg_08.png [new file with mode: 0644]
TVHome/TVHome/Controls/MainPanelButton.xaml
TVHome/TVHome/Controls/MainPanelButton.xaml.cs
TVHome/TVHome/Controls/PanelButton.cs
TVHome/TVHome/TVHome.csproj
TVHome/TVHome/ViewModels/IHomeViewModel.cs [new file with mode: 0644]
TVHome/TVHome/ViewModels/MainPageViewModel.cs
TVHome/TVHome/Views/MainPage.xaml
TVHome/TVHome/Views/MainPage.xaml.cs
TVHome/TVHome/Views/MainPanel.xaml.cs
TVHome/TVHome/Views/Panel.cs
TVHome/TVHome/Views/SubPanel.xaml.cs

index 7248692e34902a4212d08232307dc0440481e155..7a0e2024ddfa996310d5cb2eaf374ddb867ef63c 100644 (file)
@@ -78,7 +78,7 @@ namespace LibTVRefCommonPortable.DataModels
             OnPropertyChanged("IsDim");
         }
 
-        public void  ShowOptions()
+        public void ShowOptions()
         {
             IsShowOptions = true;
             OnPropertyChanged("IsShowOptions");
index cd3ddb8a03db2f50bbe134b9dba814773eea5c0d..7d5b66ba7f5a541740f365e2231fd08ca9362f89 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+using LibTVRefCommonPortable.Utils;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -24,9 +25,18 @@ namespace LibTVRefCommonPortable.DataModels
 {
     public class HomeMenuAppShortcutInfo : ShortcutInfo
     {
+        public string Status { get; set; }
+
         public override void UpdateState()
         {
             SetCurrentState("default");
         }
+
+        public void ChangeStatus(string status)
+        {
+            Status = status;
+            OnPropertyChanged("Status");
+            SetCurrentState(status);
+        }
     }
 }
index 643c6cf780dece65349ebcf1a5004d5d054feddd..a5865eb5e4f18558391f5b77c5f69d167a07d514 100644 (file)
@@ -116,11 +116,12 @@ namespace LibTVRefCommonPortable.Utils
                 {
                     break;
                 }
-                if (i >= 4)
+                else if (i >= 4)
                 {
                     DebuggingUtils.Err("Can't open storage" + storagePath);
                     return new List<AppShortcutInfo>();
                 }
+
                 await Task.Delay(100);
                 DebuggingUtils.Dbg("[" + i + "/5] Waiting for Writting" + storagePath);
             }
index 7a358a24777554059277d7e852796a93d3893215..6cb79dd5a9e30787878a701c4dac83406f05787e 100644 (file)
@@ -1,27 +1,27 @@
 {
-  "buildOptions": {
-    "emitEntryPoint": true,
-    "debugType": "portable",
-    "platform": "AnyCPU",
-    "preserveCompilationContext": true
-  },
-  "dependencies": {
-    "ElmSharp": "1.1.0-beta-010",
-    "Microsoft.NETCore.App": "1.1.0",
-    "Tizen.Library": "1.0.0-pre2",
-    "Xamarin.Forms": "2.3.3.193",
-    "Xamarin.Forms.Platform.Tizen": "2.3.3.175-beta-007"
-  },
-  "runtimes": {
-    "win": {},
-    "linux": {}
-  },
-  "frameworks": {
-    "netcoreapp1.0": {
-      "imports": [
-        "portable-net45+wp80+win81+wpa81",
-        "netstandard1.6"
-      ]
+    "buildOptions": {
+        "emitEntryPoint": true,
+        "debugType": "portable",
+        "platform": "AnyCPU",
+        "preserveCompilationContext": true
+    },
+    "dependencies": {
+        "ElmSharp": "1.1.0-beta-013",
+        "Microsoft.NETCore.App": "1.1.0",
+        "Tizen.Library": "1.0.0-pre2",
+        "Xamarin.Forms": "2.3.3.193",
+        "Xamarin.Forms.Platform.Tizen": "2.3.3.175-beta-007"
+    },
+    "runtimes": {
+        "win": {},
+        "linux": {}
+    },
+    "frameworks": {
+        "netcoreapp1.0": {
+            "imports": [
+                "portable-net45+wp80+win81+wpa81",
+                "netstandard1.6"
+            ]
+        }
     }
-  }
 }
\ No newline at end of file
index e6f4aaae9025cd58fb91a2e0d13b09212db905cb..6425c4ece07f1c99388e17ff4d493f225fd3fd0d 100644 (file)
@@ -61,6 +61,7 @@ namespace TVApps
         {
             AppUninstalledListener += listener;
         }
+
         public static void SetPinAppRequestListener(EventHandler<TVAppsEventArgs> listener)
         {
             PinAppRequestListener += listener;
@@ -93,5 +94,9 @@ namespace TVApps
         public void OnAppPinnedNotificationReceived(string appID)
         {
         }
+
+        public void OnHomeKeyPressed()
+        {
+        }
     }
 }
index 0705e0938919050e537ac1bde4e2e3b6966b61af..cc06d74116cc148f41f9a2cdef4de64a2e7b3a6f 100644 (file)
@@ -279,7 +279,7 @@ namespace TVApps.ViewModels
         public void SetAppItemDim(string appId)
         {
             InstalledApps = new List<AppShortcutInfo>(InstalledApps);
-            foreach(AppShortcutInfo app in InstalledApps)
+            foreach (AppShortcutInfo app in InstalledApps)
             {
                 if (!app.AppID.Equals(appId))
                 {
@@ -291,7 +291,7 @@ namespace TVApps.ViewModels
         public void UnsetAppItemDim(string appId)
         {
             InstalledApps = new List<AppShortcutInfo>(InstalledApps);
-            foreach(AppShortcutInfo app in InstalledApps)
+            foreach (AppShortcutInfo app in InstalledApps)
             {
                 if (!app.AppID.Equals(appId))
                 {
@@ -310,7 +310,7 @@ namespace TVApps.ViewModels
             }
         }
 
-    public void HideLongPressOption(string appId)
+        public void HideLongPressOption(string appId)
         {
             InstalledApps = new List<AppShortcutInfo>(InstalledApps);
             AppShortcutInfo longPressedApp = InstalledApps.Find(app => app.AppID.Equals(appId));
index adf674816a1c0c992161eb81e1a52cac3c952f4d..6c1944d3af5028cd47cbeda832a7ebbcce94b432 100644 (file)
@@ -131,7 +131,7 @@ namespace TVApps.ViewModels
                 appsHolder.UpdatePinnedApps();
                 ChangeCurrentStatus(AppsStatus.Default);
 
-                if(IsPinAppRequested)
+                if (IsPinAppRequested)
                 {
                     // TODO : check pinneed apps and a number of pinned apps
                     AppControlUtils.SendAppAddedNotificationToHome("org.tizen.settings");
@@ -155,7 +155,7 @@ namespace TVApps.ViewModels
                 DebuggingUtils.Dbg(" === Set LongPress AppID : " + appId);
 
                 // 1. ItemCell will be dimmed
-                appsHolder.SetAppItemDim((string) appId);
+                appsHolder.SetAppItemDim((string)appId);
 
                 // 2. The selected icon on apps list will be moved
                 appsHolder.ShowLongPressOption((string)appId);
@@ -172,7 +172,7 @@ namespace TVApps.ViewModels
                 appsHolder.HideLongPressOption((string)appId);
 
                 // 3. ItemCell will be changed to normal
-                appsHolder.UnsetAppItemDim((string) appId);
+                appsHolder.UnsetAppItemDim((string)appId);
             });
 
 
index 3b24bf95d7bc40f6ddc121a9b93b6896e750f9d9..12e6364244d3bdcbe5b6beee643510e334822b1b 100644 (file)
@@ -102,8 +102,10 @@ namespace TVApps.Views
                 await this.Navigation.PopAsync();
                 return true;
             }
+
             return true;
         }
+
         /*
         protected override bool OnBackButtonPressed()
         {
index 2fe103df14e1e7474317906cf30d96651b48aa23..b4be42cbe05ab2016193da3481ad7dc39159497b 100644 (file)
Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_01.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_01.png
new file mode 100644 (file)
index 0000000..72dc248
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_01.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_02.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_02.png
new file mode 100644 (file)
index 0000000..72dc248
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_02.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_03.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_03.png
new file mode 100644 (file)
index 0000000..f75e5ce
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_03.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_04.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_04.png
new file mode 100644 (file)
index 0000000..dfb3498
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_04.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_05.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_05.png
new file mode 100644 (file)
index 0000000..fc5f703
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_05.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_06.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_06.png
new file mode 100644 (file)
index 0000000..442850d
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_06.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_07.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_07.png
new file mode 100644 (file)
index 0000000..a5243d0
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_07.png differ
diff --git a/TVHome/TVHome.TizenTV/res/home_icon_bg_08.png b/TVHome/TVHome.TizenTV/res/home_icon_bg_08.png
new file mode 100644 (file)
index 0000000..ec8db06
Binary files /dev/null and b/TVHome/TVHome.TizenTV/res/home_icon_bg_08.png differ
index fd0ae29116d00c6fde8e1a3b84fc83658fbbeb97..fa935c5f26fd075294ffeee8f816dbfc1960597a 100755 (executable)
@@ -4,26 +4,34 @@
                       xmlns:Controls="clr-namespace:TVHome.Controls"
                       x:Class="TVHome.Controls.MainPanelButton">
     <RelativeLayout Opacity="0.3">
-        <BoxView x:Name = "ButtonBox"
-              RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
-              RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1.03}"
-              RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
-              RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
-              Opacity="0"/>
+        <BoxView x:Name="ButtonBox"
+                 RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+                 RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1.03}"
+                 RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
+                 RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+                 Opacity="0" />
         <Image x:Name="ButtonBgImage"
-              RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
-              RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1.6857}"
-              RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
-              RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=-0.343}"
-              Source="img_tizen_home_menu_focused_bg.png"
-              Opacity="0"
-              Scale="0"/>
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1.6857}"
+               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
+               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=-0.343}"
+               Source="img_tizen_home_menu_focused_bg.png"
+               Opacity="0"
+               Scale="0" />
+        <Image x:Name="ButtonBlurImage"
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1.6857}"
+               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
+               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=-0.343}"
+               Source="home_icon_bg_01.png"
+               Scale="0.7"
+               Opacity="0" />
         <Image x:Name="ButtonImage"
-              RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.218}"
-              RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
-              RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.390}"
-              RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
-              Source="{Binding CurrentStateDescription.IconPath}" />
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.218}"
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.390}"
+               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+               Source="{Binding CurrentStateDescription.IconPath}" />
         <Label x:Name="ButtonTitle"
                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.8739}"
                RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
@@ -35,7 +43,7 @@
                LineBreakMode="TailTruncation"
                HorizontalTextAlignment="Center"
                Text="{Binding CurrentStateDescription.Label}" />
-        <Button x:Name = "ButtonFocusArea"
+        <Button x:Name="ButtonFocusArea"
                 RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
                 RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                 Focused="OnFocused"
index c3841a85143f79a8eb6c13f88763ab722427d82f..ca9bf4115cdec7bc39ece1f51eb713ff72f404cc 100755 (executable)
@@ -18,6 +18,7 @@ using System;
 using System.Windows.Input;
 using LibTVRefCommonPortable.Utils;
 using Xamarin.Forms;
+using System.Threading.Tasks;
 
 namespace TVHome.Controls
 {
@@ -26,70 +27,97 @@ namespace TVHome.Controls
     /// </summary>
     public partial class MainPanelButton : PanelButton
     {
+        public static readonly BindableProperty StatusProperty = BindableProperty.Create("Status", typeof(string), typeof(PanelButton), default(string));
+
+        public string Status
+        {
+            get { return (string)GetValue(StatusProperty); }
+            set { SetValue(StatusProperty, value); }
+        }
+
         public MainPanelButton()
         {
             InitializeComponent();
+            PropertyChanged += MainPanelButton_PropertyChanged;
         }
 
-        public override async void OnFocused(object sender, FocusEventArgs e)
+        private async void MainPanelButton_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         {
-            if (OnFocusedCommand != null)
+            if (e.PropertyName.CompareTo("Status") == 0)
             {
-                OnFocusedCommand.Execute("");
-            }
+#pragma warning disable CS4014
+                switch (Status)
+                {
+                    case "selected":
 
-            if (ButtonTitle.Text.Equals("Apps"))
-            {
-                ButtonImage.Source = "ic_tizen_home_menu_apps_focused.png";
-            }
-            else if (ButtonTitle.Text.Equals("Recent"))
-            {
-                ButtonImage.Source = "ic_tizen_home_menu_recent_focused.png";
-            }
-            else
-            {
-                ButtonImage.Source = "ic_tizen_home_menu_settings_focused.png";
-            }
+                        ButtonBlurImage.Source = "home_icon_bg_01.png";
+                        ButtonBgImage.FadeTo(0.875, 1);
+                        await ButtonBlurImage.FadeTo(0.99, 1);
 
-#pragma warning disable CS4014
-            ButtonTitle.FadeTo(0.8, 300);
-            ButtonBgImage.FadeTo(0.99, 300);
-            ButtonBgImage.ScaleTo(1.0, 300);
+                        ButtonBlurImage.Source = "home_icon_bg_02.png";
+                        ButtonBgImage.FadeTo(0.750, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 2), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_03.png";
+                        ButtonBgImage.FadeTo(0.625, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 3), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_04.png";
+                        ButtonBgImage.FadeTo(0.500, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 4), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_05.png";
+                        ButtonBgImage.FadeTo(0.375, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 5), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_06.png";
+                        ButtonBgImage.FadeTo(0.250, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 6), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_07.png";
+                        ButtonBgImage.FadeTo(0.125, 1);
+                        await ButtonBlurImage.FadeTo((1.0 - 0.01 * 7), 1);
+
+                        ButtonBlurImage.Source = "home_icon_bg_08.png";
+                        ButtonBgImage.FadeTo(0.0, 1);
+                        ButtonTitle.FadeTo(0.0, 1);
+                        await ButtonBlurImage.FadeTo(0.0, 1);
+                        break;
+                    case "focused":
+                        ButtonTitle.FadeTo(0.8, 100);
+                        ButtonBgImage.FadeTo(0.99, 100);
+                        ButtonBgImage.ScaleTo(1.0, 100);
+                        await View.FadeTo(0.6, 100);
+                        break;
+                    default:
+                        ButtonTitle.FadeTo(0, 100);
+                        ButtonBgImage.FadeTo(0, 100);
+                        ButtonBgImage.ScaleTo(0.01, 100);
+                        await View.FadeTo(0.3, 100);
+                        break;
+                }
 #pragma warning restore CS4014
-            await View.FadeTo(0.6, 300);
+            }
         }
 
-        public override async void OnUnfocused(object sender, FocusEventArgs e)
+        public override void OnFocused(object sender, FocusEventArgs e)
         {
-            if (ButtonTitle.Text.Equals("Apps"))
-            {
-                ButtonImage.Source = "ic_tizen_home_menu_apps_normal.png";
-            }
-            else if (ButtonTitle.Text.Equals("Recent"))
-            {
-                ButtonImage.Source = "ic_tizen_home_menu_recent_normal.png";
-            }
-            else
+            if (OnFocusedCommand != null)
             {
-                ButtonImage.Source = "ic_tizen_home_menu_settings_normal.png";
+                OnFocusedCommand.Execute("");
             }
+        }
 
-#pragma warning disable CS4014
-            ButtonTitle.FadeTo(0, 300);
-            ButtonBgImage.FadeTo(0, 300);
-            ButtonBgImage.ScaleTo(0.01, 300);
-#pragma warning restore CS4014
-            await View.FadeTo(0.3, 300);
+        public override void OnUnfocused(object sender, FocusEventArgs e)
+        {
         }
 
-        public override async void OnClicked(object sender, EventArgs e)
+        public override void OnClicked(object sender, EventArgs e)
         {
             if (OnClickedCommand != null)
             {
                 OnClickedCommand.Execute("");
             }
-
-            await View.FadeTo(0.9, 300);
         }
     }
 }
index 2472f77bacc7bfe55d98e061d145d70de249350d..78fe1fca4256ae3b116a0fc0048e4e637a90eff3 100644 (file)
@@ -22,21 +22,10 @@ namespace TVHome.Controls
 {
     public abstract class PanelButton : ViewCell
     {
-        public BindableProperty OnFocusedCommandProperty = BindableProperty.Create("OnFocusedCommand", typeof(ICommand), typeof(PanelButton));
 
-        public ICommand OnFocusedCommand
-        {
-            get { return (ICommand)GetValue(OnFocusedCommandProperty); }
-            set { SetValue(OnFocusedCommandProperty, value); }
-        }
+        public ICommand OnFocusedCommand { get; set; }
 
-        public BindableProperty OnClickedCommandProperty = BindableProperty.Create("OnClickedCommand", typeof(ICommand), typeof(PanelButton));
-
-        public ICommand OnClickedCommand
-        {
-            get { return (ICommand)GetValue(OnClickedCommandProperty); }
-            set { SetValue(OnClickedCommandProperty, value); }
-        }
+        public ICommand OnClickedCommand { get; set; }
 
         public abstract void OnFocused(object sender, FocusEventArgs e);
 
index c44dc6f2ceda8543f6c4e2930a5876b10610ed72..3666af1a7e9001f15cf347cf5affc66833f465a3 100755 (executable)
@@ -52,6 +52,7 @@
     </Compile>\r
     <Compile Include="TVHome.cs" />\r
     <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="ViewModels\IHomeViewModel.cs" />\r
     <Compile Include="ViewModels\MainPageViewModel.cs" />\r
     <Compile Include="Views\MainPage.xaml.cs">\r
       <DependentUpon>MainPage.xaml</DependentUpon>\r
        <Target Name="AfterBuild">\r
        </Target>\r
        -->\r
-</Project>\r
+</Project>
\ No newline at end of file
diff --git a/TVHome/TVHome/ViewModels/IHomeViewModel.cs b/TVHome/TVHome/ViewModels/IHomeViewModel.cs
new file mode 100644 (file)
index 0000000..31963b3
--- /dev/null
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TVHome.ViewModels
+{
+    interface IHomeViewModel
+    {
+        void OnPropertyChanged(string name);
+        void ChangeCurrentStatus(HomeStatus newStatus);
+    }
+}
index 6232ea53940ab98f610890e505a9c987e21297cd..9cc89336aec413afa50b062f71675efc9fb7671a 100755 (executable)
@@ -26,30 +26,112 @@ using Xamarin.Forms;
 
 namespace TVHome.ViewModels
 {
-    public class MainPageViewModel : INotifyPropertyChanged
+    public enum HomeStatus
+    {
+        Default = 0,
+        MainPanelFocused,
+        SubPanelFocused,
+        UnPin,
+        Move,
+    };
+    public enum HomeMenuItem
+    {
+        Recent = 0,
+        Apps,
+        Settings,
+        NotSelected,
+    };
+
+    public class MainPageViewModel : INotifyPropertyChanged, IHomeViewModel
     {
         public IEnumerable<ShortcutInfo> MainList { get; set; }
         public IEnumerable<ShortcutInfo> RecentList { get; set; }
         public IEnumerable<ShortcutInfo> AppList { get; set; }
         public IEnumerable<ShortcutInfo> SettingsList { get; set; }
 
+        public Command MainPanelFocusedCommand { get; set; }
+        public Command SubPanelFocusedCommand { get; set; }
+        public Command SetMoveStatusCommand { get; set; }
+        public Command SetUnpinStatusCommand { get; set; }
+
+        public HomeStatus CurrentStatus { get; private set; }
+        public HomeMenuItem SelectedMenuName { get; private set; }
+
         public event PropertyChangedEventHandler PropertyChanged;
-        protected void OnPropertyChanged(string name)
+
+        public MainPageViewModel()
         {
-            PropertyChangedEventHandler handler = PropertyChanged;
-            if (handler != null)
+            Init();
+            InitCommands();
+            MakeMainMenuItems();
+            MakeRecentButtons();
+
+            DebuggingUtils.Dbg("Reading Apps list");
+            TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetDefaultShortcuts();
+            OnPropertyChanged("AppList");
+            UpdateAppList(null, null);
+
+            //SettingsList = TVHomeImpl.GetInstance.AppShortcutControllerInstnace.ReadFromFile();
+            SettingsList = TVHomeImpl.GetInstance.SettingShortcutControllerInstance.GetList();
+            OnPropertyChanged("SettingsList");
+
+            TVHomeImpl.GetInstance.AppShortcutControllerInstance.AddFileSystemChangedListener(UpdateAppList);
+
+            App.SetAppPinnedNotificationListener((s, e) =>
             {
-                handler(this, new PropertyChangedEventArgs(name));
-            }
+                // TODO : Make this for Move a pinned app/Show pinned apps(scroll to last)
+                if (e.arg.Length > 0)
+                {
+                    DebuggingUtils.Dbg("Move, AppID : " + e.arg);
+                }
+                else
+                {
+                    DebuggingUtils.Dbg("Show, Pinned Apps");
+                }
+            });
         }
 
-        public MainPageViewModel()
+        private void Init()
+        {
+            CurrentStatus = HomeStatus.Default;
+            SelectedMenuName = HomeMenuItem.NotSelected;
+        }
+
+        private void InitCommands()
+        {
+            MainPanelFocusedCommand = new Command<HomeMenuItem>((key) =>
+            {
+                DebuggingUtils.Dbg(key.ToString());
+                ChangeCurrentStatus(HomeStatus.MainPanelFocused);
+                ChangeSelectedPanelName(key);
+            });
+
+            SubPanelFocusedCommand = new Command(() =>
+            {
+                ChangeCurrentStatus(HomeStatus.SubPanelFocused);
+            });
+
+            SetMoveStatusCommand = new Command(() =>
+            {
+                ChangeCurrentStatus(HomeStatus.Move);
+            });
+
+            SetUnpinStatusCommand = new Command(() =>
+            {
+                ChangeCurrentStatus(HomeStatus.UnPin);
+            });
+        }
+
+        private void MakeMainMenuItems()
         {
             string[] AppName = { "Recent", "Apps", "Settings" };
             // TODO : Revert this before release
             //string[] AppControlID = { "org.tizen.settings", "org.tizen.apps", "org.tizen.settings" };
             string[] AppControlID = { "org.tizen.settings", "org.tizen.example.TVApps.TizenTV", "org.tizen.settings" };
-            string[] AppIconPath = { "ic_tizen_home_menu_recent_normal.png", "ic_tizen_home_menu_apps_normal.png", "ic_tizen_home_menu_settings_normal.png" };
+            string[] AppDefaultIconPath = { "ic_tizen_home_menu_recent_normal.png", "ic_tizen_home_menu_apps_normal.png", "ic_tizen_home_menu_settings_normal.png" };
+            string[] AppFocusedIconPath = { "ic_tizen_home_menu_recent_focused.png", "ic_tizen_home_menu_apps_focused.png", "ic_tizen_home_menu_settings_focused.png" };
+            string[] AppSelectedIconPath = { "ic_tizen_home_menu_recent_selected.png", "ic_tizen_home_menu_apps_selected.png", "ic_tizen_home_menu_settings_selected.png" };
+            string[] AppUnselectIconPath = { "ic_tizen_home_menu_recent_unselect.png", "ic_tizen_home_menu_apps_unselect.png", "ic_tizen_home_menu_settings_unselect.png" };
 
             List<ShortcutInfo> TempList = new List<ShortcutInfo>();
             for (int i = 0; i < 3; i++)
@@ -63,14 +145,50 @@ namespace TVHome.ViewModels
                             new StateDescription
                             {
                                 Label = AppName[i],
-                                IconPath = AppIconPath[i],
+                                IconPath = AppDefaultIconPath[i],
                                 Action = new AppControlAction()
                                 {
                                     AppID = AppControlID[i]
                                 }
                             }
                         },
-                    }
+                        {
+                            "focused",
+                            new StateDescription
+                            {
+                                Label = AppName[i],
+                                IconPath = AppFocusedIconPath[i],
+                                Action = new AppControlAction()
+                                {
+                                    AppID = AppControlID[i]
+                                }
+                            }
+                        },
+                        {
+                            "selected",
+                            new StateDescription
+                            {
+                                Label = AppName[i],
+                                IconPath = AppSelectedIconPath[i],
+                                Action = new AppControlAction()
+                                {
+                                    AppID = AppControlID[i]
+                                }
+                            }
+                        },
+                        {
+                            "unselect",
+                            new StateDescription
+                            {
+                                Label = AppName[i],
+                                IconPath = AppUnselectIconPath[i],
+                                Action = new AppControlAction()
+                                {
+                                    AppID = AppControlID[i]
+                                }
+                            }
+                        },
+                    },
                 };
                 shortcutInfo.UpdateState();
                 TempList.Add(shortcutInfo);
@@ -78,35 +196,8 @@ namespace TVHome.ViewModels
 
             MainList = TempList;
             OnPropertyChanged("MainList");
-
-            MakeRecentButtons();
-
-            DebuggingUtils.Dbg("Reading Apps list");
-            AppList = TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetDefaultShortcuts();
-            OnPropertyChanged("AppList");
-            UpdateAppList(null, null);
-
-            //SettingsList = TVHomeImpl.GetInstance.AppShortcutControllerInstnace.ReadFromFile();
-            SettingsList = TVHomeImpl.GetInstance.SettingShortcutControllerInstance.GetList();
-            OnPropertyChanged("SettingsList");
-
-            TVHomeImpl.GetInstance.AppShortcutControllerInstance.AddFileSystemChangedListener(UpdateAppList);
-
-            App.SetAppPinnedNotificationListener((s, e) =>
-            {
-                // TODO : Make this for Move a pinned app/Show pinned apps(scroll to last)
-                if (e.arg.Length > 0)
-                {
-                    DebuggingUtils.Dbg("Move, AppID : " + e.arg);
-                }
-                else
-                {
-                    DebuggingUtils.Dbg("Show, Pinned Apps");
-                }
-            });
         }
 
-
         private async void UpdateAppList(object sender, EventArgs e)
         {
             AppList = await TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetPinnedAppsWithDefaultShortcuts();
@@ -122,5 +213,90 @@ namespace TVHome.ViewModels
             }
         }
 
+        public void OnPropertyChanged(string name)
+        {
+            PropertyChangedEventHandler handler = PropertyChanged;
+            if (handler != null)
+            {
+                handler(this, new PropertyChangedEventArgs(name));
+            }
+        }
+
+        public void ChangeCurrentStatus(HomeStatus newStatus)
+        {
+            if (CurrentStatus.CompareTo(newStatus) != 0)
+            {
+                CurrentStatus = newStatus;
+                if (CurrentStatus.CompareTo(HomeStatus.MainPanelFocused) == 0)
+                {
+                    HomeMenuItem index = HomeMenuItem.Recent;
+                    foreach (HomeMenuAppShortcutInfo item in MainList)
+                    {
+                        DebuggingUtils.Dbg(index.ToString());
+                        if (index == SelectedMenuName)
+                        {
+                            DebuggingUtils.Dbg("To Focused");
+                            item.ChangeStatus("focused");
+                        }
+                        else
+                        {
+                            DebuggingUtils.Dbg("To Default");
+                            item.ChangeStatus("default");
+                        }
+
+                        index++;
+                    }
+                }
+                else if (CurrentStatus.CompareTo(HomeStatus.SubPanelFocused) == 0)
+                {
+                    HomeMenuItem index = HomeMenuItem.Recent;
+                    foreach (HomeMenuAppShortcutInfo item in MainList)
+                    {
+                        DebuggingUtils.Dbg(index.ToString());
+                        if (index == SelectedMenuName)
+                        {
+                            DebuggingUtils.Dbg("To be selected");
+                            item.ChangeStatus("selected");
+                        }
+                        else
+                        {
+                            DebuggingUtils.Dbg("To be unselect");
+                            item.ChangeStatus("unselect");
+                        }
+
+                        index++;
+                    }
+                }
+
+                OnPropertyChanged("CurrentStatus");
+            }
+        }
+
+        public void ChangeSelectedPanelName(HomeMenuItem panelName)
+        {
+            if (SelectedMenuName.CompareTo(panelName) != 0)
+            {
+                SelectedMenuName = panelName;
+                HomeMenuItem index = HomeMenuItem.Recent;
+                foreach (HomeMenuAppShortcutInfo item in MainList)
+                {
+                    DebuggingUtils.Dbg(index.ToString());
+                    if (index == panelName)
+                    {
+                        DebuggingUtils.Dbg("To Focused");
+                        item.ChangeStatus("focused");
+                    }
+                    else
+                    {
+                        DebuggingUtils.Dbg("To Default");
+                        item.ChangeStatus("default");
+                    }
+
+                    index++;
+                }
+
+                OnPropertyChanged("SelectedMenuName");
+            }
+        }
     }
 }
index 3ee0147b356a3a5990634d768b7525a13ac358fd..56ea79370e0c2d6cda852d0a66d20b503135c1b6 100755 (executable)
@@ -5,7 +5,10 @@
              xmlns:Views="clr-namespace:TVHome.Views"
              xmlns:ViewModels="clr-namespace:TVHome.ViewModels"
              xmlns:Controls="clr-namespace:TVHome.Controls"
-             Appearing="OnAppearing">
+             Appearing="OnAppearing"
+             BackgroundImage="background.jpg"
+             CurrentStatus="{Binding CurrentStatus}"
+             SelectedMenuName="{Binding SelectedMenuName}">
     <ContentPage.BindingContext>
         <ViewModels:MainPageViewModel />
     </ContentPage.BindingContext>
                              RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.21875}"
                              RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6537}"
                              RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.390625}"
+                             OnFocusedCommand="{Binding MainPanelFocusedCommand}"
                              ItemsSource="{Binding MainList}"/>
 
             <Views:SubThumbnailPanel x:Name="RecentSubPanel"
                             RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.224}"
                             RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.89}"
+                            OnFocusedCommand="{Binding SubPanelFocusedCommand}"
                             ItemsSource="{Binding RecentList}" >
                 <Views:SubThumbnailPanel.ItemTemplate>
                     <DataTemplate>
@@ -42,6 +47,7 @@
                             RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
                             RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8981}"
+                            OnFocusedCommand="{Binding SubPanelFocusedCommand}"
                             ItemsSource="{Binding AppList}">
             </Views:SubPanel>
 
@@ -49,6 +55,7 @@
                             RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
                             RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8981}"
+                            OnFocusedCommand="{Binding SubPanelFocusedCommand}"
                             ItemsSource="{Binding SettingsList}">
                 <Views:SubPanel.ItemTemplate>
                     <DataTemplate>
index 47771e095037de83e8348a465d3b85d386e8ef6c..6ceac0966e7e89398a8340fc031b2ce181144daa 100755 (executable)
@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2017 Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
@@ -22,6 +22,8 @@ using LibTVRefCommonPortable.DataModels;
 using LibTVRefCommonPortable.Models;
 using LibTVRefCommonPortable.Utils;
 using Xamarin.Forms;
+using TVHome.ViewModels;
+using System.Linq;
 
 namespace TVHome.Views
 {
@@ -30,32 +32,45 @@ namespace TVHome.Views
     /// </summary>
     public partial class MainPage : ContentPage
     {
+        public static readonly BindableProperty CurrentStatusProperty = BindableProperty.Create("CurrentStatus", typeof(HomeStatus), typeof(MainPage), default(HomeStatus));
+        public HomeStatus CurrentStatus
+        {
+            get { return (HomeStatus)GetValue(CurrentStatusProperty); }
+            set { SetValue(CurrentStatusProperty, value); }
+        }
+
+        public static readonly BindableProperty SelectedMenuNameProperty = BindableProperty.Create("SelectedMenuName", typeof(HomeMenuItem), typeof(MainPage), default(HomeMenuItem));
+        public HomeMenuItem SelectedMenuName
+        {
+            get { return (HomeMenuItem)GetValue(SelectedMenuNameProperty); }
+            set { SetValue(SelectedMenuNameProperty, value); }
+        }
 
-        private Dictionary<string, Panel> SubPanelDictionary;
-        private Panel currentSubPanel;
-        public ICommand ChangeSubPanelCommand;
+        private Dictionary<HomeMenuItem, Panel> SubPanelDictionary;
 
         private async void PlayHideAnimation()
         {
-            currentSubPanel?.TranslateTo(0.0, 100, 150);
+            SubPanelDictionary[SelectedMenuName]?.TranslateTo(0.0, 100, 150);
             await PageMainPanel.ScaleTo(0.0, 150);
         }
 
         private async void PlayShowAnimation()
         {
-            currentSubPanel?.TranslateTo(0.0, 0.0, 150);
+            SubPanelDictionary[SelectedMenuName]?.TranslateTo(0.0, 0.0, 150);
             await PageMainPanel.ScaleTo(1.0, 150);
         }
 
         public MainPage()
         {
             InitializeComponent();
-            SubPanelDictionary = new Dictionary<string, Panel>();
-            SubPanelDictionary.Add("Recent", RecentSubPanel);
-            SubPanelDictionary.Add("Apps", AppsSubPanel);
-            SubPanelDictionary.Add("Settings", SettingsSubPanel);
+            SubPanelDictionary = new Dictionary<HomeMenuItem, Panel>();
+            SubPanelDictionary.Add(HomeMenuItem.Recent, RecentSubPanel);
+            SubPanelDictionary.Add(HomeMenuItem.Apps, AppsSubPanel);
+            SubPanelDictionary.Add(HomeMenuItem.Settings, SettingsSubPanel);
+            PropertyChanged += MainPage_PropertyChanged;
 
-            App.SetHomeKeyListener((e, arg) => {
+            App.SetHomeKeyListener((e, arg) =>
+            {
                 DebuggingUtils.Dbg("FIRED!!");
                 if (IsVisible)
                 {
@@ -70,40 +85,62 @@ namespace TVHome.Views
                 }
             });
 
-            PageMainPanel.OnFocusedCommand = new Command<string>((key) =>
+            AppsSubPanel.OnUnpinCommand = new Command<string>((appId) =>
             {
-                DebuggingUtils.Dbg("MainPage : " + key);
-                foreach (KeyValuePair<string, Panel> aPair in SubPanelDictionary)
-                {
-                    if (aPair.Key != key)
-                        aPair.Value.HidePanel();
-                    else
-                    {
-                        currentSubPanel = aPair.Value;
-                        currentSubPanel.ShowPanel();
-                    }
-                }
+                UnpinAppShortcutInfo(appId);
             });
+        }
 
-            RecentSubPanel.OnFocusedCommand = new Command(() =>
+        private void MainPage_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            DebuggingUtils.Dbg(e.PropertyName);
+            if (e.PropertyName.CompareTo("CurrentStatus") == 0)
             {
-                PageMainPanel.SelectPanel();
-            });
+                SetCurrentStatus(CurrentStatus);
+            }
+            else if (e.PropertyName.CompareTo("SelectedMenuName") == 0)
+            {
+                SelectMenu(SelectedMenuName);
+            }
+        }
 
-            AppsSubPanel.OnFocusedCommand = new Command(() =>
+        private void SetCurrentStatus(HomeStatus status)
+        {
+            switch (status)
             {
-                PageMainPanel.SelectPanel();
-            });
+                case HomeStatus.Default:
+                    break;
+                case HomeStatus.MainPanelFocused:
+                    PageMainPanel.ShowPanel();
+                    SelectMenu(SelectedMenuName);
+                    break;
+                case HomeStatus.SubPanelFocused:
+                    PageMainPanel.SelectPanel();
+                    break;
+                case HomeStatus.Move:
+                    break;
+                case HomeStatus.UnPin:
+                    break;
+            }
+        }
 
-            AppsSubPanel.OnUnpinCommand = new Command<string>((appId) =>
+        private void SelectMenu(HomeMenuItem panelName)
+        {
+            if (panelName == HomeMenuItem.NotSelected)
             {
-                UnpinAppShortcutInfo(appId);
-            });
+                return;
+            }
+
+            IEnumerable<Panel> panels = from pair in SubPanelDictionary
+                                        where pair.Key != panelName
+                                        select pair.Value;
 
-            SettingsSubPanel.OnFocusedCommand = new Command(() =>
+            foreach (Panel panel in panels)
             {
-                PageMainPanel.SelectPanel();
-            });
+                panel.HidePanel();
+            }
+
+            SubPanelDictionary[panelName].ShowPanel();
         }
 
         private void OnAppearing(object sender, EventArgs e)
@@ -140,4 +177,4 @@ namespace TVHome.Views
             }
         }
     }
-}
+}
\ No newline at end of file
index 217765185906830be612dfcf933f2f9f1404b8df..e453d3062d9d5d68fc5b8dd5902b94614936cf52 100644 (file)
@@ -23,6 +23,7 @@ using LibTVRefCommonPortable.DataModels;
 using LibTVRefCommonPortable.Utils;
 using TVHome.ViewModels;
 using Xamarin.Forms;
+using System.Threading.Tasks;
 
 namespace TVHome.Views
 {
@@ -44,22 +45,28 @@ namespace TVHome.Views
                 return;
             }
 
+            HomeMenuItem menuIndex = HomeMenuItem.Recent;
             var index = 0;
             PanelButtonGrid.Children.Clear();
             foreach (ShortcutInfo item in ItemsSource)
             {
                 var button = new MainPanelButton();
                 button.View.BindingContext = item;
+                button.SetBinding(MainPanelButton.StatusProperty, new Binding("BindingContext.Status", source: button.View));
+                HomeMenuItem ItemName = menuIndex;
                 button.OnFocusedCommand = new Command(() =>
                 {
                     FocusPanel();
-                    OnFocusedCommand.Execute(item.StateDescriptions["default"].Label);
+                    OnFocusedCommand.Execute(ItemName);
                 });
                 button.OnClickedCommand = new Command(() =>
                 {
                     item.DoAction();
                 });
-                PanelButtonGrid.Children.Add(button.View, index++, 0);
+                PanelButtonGrid.Children.Add(button.View, index, 0);
+
+                index++;
+                menuIndex++;
             }
         }
 
@@ -71,22 +78,23 @@ namespace TVHome.Views
 
         public override async void FocusPanel()
         {
-            await PanelButtonGrid.TranslateTo(0, 0);
+            await this.TranslateTo(0, 0, 300);
         }
 
         public override async void HidePanel()
         {
-            await PanelButtonGrid.ScaleTo(0, 0);
+            await this.ScaleTo(0, 0);
         }
 
         public async void SelectPanel()
         {
-            await PanelButtonGrid.TranslateTo(0, -78);
+            await Task.Delay(300);
+            await this.TranslateTo(0, -78, 300);
         }
 
         public override async void ShowPanel()
         {
-            await PanelButtonGrid.ScaleTo(1, 0);
+            await this.ScaleTo(1, 0);
         }
     }
 }
\ No newline at end of file
index 6d781ffb47e2ca6f67767883c1f0ac4d35cfe52b..4c14c904bbb255863a0fa480e6bd786796b386d8 100755 (executable)
@@ -40,6 +40,7 @@ namespace TVHome.Views
             get { return (ICommand)GetValue(OnUnpinCommandProperty); }
             set { SetValue(OnUnpinCommandProperty, value); }
         }
+
         public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable<ShortcutInfo>), typeof(MainPanel));
 
         public IEnumerable<ShortcutInfo> ItemsSource
index d5c15ac9d6ca79c9e6092cd31e504d091d36d7f6..5be4bde01117aef69038a5cadc71ac0fe0b981d8 100755 (executable)
@@ -23,6 +23,7 @@ using LibTVRefCommonPortable.DataModels;
 using TVHome.ViewModels;
 using Xamarin.Forms;
 using LibTVRefCommonPortable.Utils;
+using System.Threading.Tasks;
 
 namespace TVHome.Views
 {
@@ -60,9 +61,9 @@ namespace TVHome.Views
                     button = new SubPanelReservedButton();
                 }
                 else
-                               {
+                {
                     button = new SubPanelButton();
-                               }
+                }
 
                 button.View.BindingContext = item;
                 button.OnFocusedCommand = new Command(() =>
@@ -150,6 +151,7 @@ namespace TVHome.Views
                 item.FindByName<Image>("ButtonDimmedImage").Opacity = 0;
             }
 
+            await Task.Delay(300);
 #pragma warning disable CS4014
             this.TranslateTo(0, -146, 300);
 #pragma warning restore CS4014