Add Label Animation & StyleCop check
authorHeonjae Jang <heonjae.jang@samsung.com>
Fri, 24 Feb 2017 03:55:19 +0000 (12:55 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:44 +0000 (18:34 +0900)
1. Add PanelButton Label Animation on Focused, Unfocused
2. Add PanelButton Label line break mode.
3. Add Image in SubPanelButton
4. StyleCop check

Change-Id: If221c8451f17e8b4fc1a5fe29af06cf696af0360

25 files changed:
TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs
TVHome/TVHome.TizenTV/Ports/DBPort.cs
TVHome/TVHome.TizenTV/Ports/DebuggingPort.cs
TVHome/TVHome.TizenTV/Ports/FileSystemWatcherPort.cs
TVHome/TVHome.TizenTV/Ports/PackageManagerPort.cs
TVHome/TVHome.TizenTV/TVHome.TizenTV.cs
TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj
TVHome/TVHome/Controls/MainPanelButton.xaml
TVHome/TVHome/Controls/MainPanelButton.xaml.cs
TVHome/TVHome/Controls/SubPanelButton.xaml
TVHome/TVHome/Controls/SubPanelButton.xaml.cs
TVHome/TVHome/DataModels/AppShortcutInfo.cs
TVHome/TVHome/DataModels/DBItem.cs
TVHome/TVHome/DataModels/FileSystemEventCustomArgs.cs
TVHome/TVHome/DataModels/RecentShortcutInfo.cs
TVHome/TVHome/Models/RecentShortcutController.cs
TVHome/TVHome/Utils/AppShortcutStorage.cs
TVHome/TVHome/Utils/IApplicationManagerAPIs.cs
TVHome/TVHome/Utils/IFileSystemWatcherAPIs.cs
TVHome/TVHome/Utils/RecentShortcutStorage.cs
TVHome/TVHome/ViewModels/MainPageViewModel.cs
TVHome/TVHome/Views/MainPage.xaml.cs
TVHome/TVHome/Views/MainPanel.xaml.cs
TVHome/TVHome/Views/SubPanel.xaml
TVHome/TVHome/Views/SubPanel.xaml.cs

index 66615f40034350a4ea2bb8ea7ecc315086c612b9..600f43e852ce8fadc9578ed96d2eb7c56e79de66 100644 (file)
@@ -24,40 +24,40 @@ using TVHome.Utils;
 \r
 namespace TVHome.TizenTV.Ports\r
 {\r
-       class ApplicationManagerPort : IApplicationManagerAPIs\r
-       {\r
-               public ApplicationManagerPort()\r
-               {\r
-                       ApplicationManager.ApplicationLaunched += new EventHandler<ApplicationLaunchedEventArgs>(OnApplicationLaunched);\r
-               }\r
-\r
-               void OnApplicationLaunched(object sender, EventArgs args)\r
-               {\r
-                       ApplicationLaunchedEventArgs launchedEventArgs = args as ApplicationLaunchedEventArgs;\r
-\r
-                       DebuggingUtils.Dbg(launchedEventArgs.ApplicationInfo.Label.ToString() + " launched");\r
-               }\r
-\r
-               public async Task<Dictionary<string, string[]>> GetRecentApplications()\r
-               {\r
-                       // RUA가 지원되지 않으므로 일단 설치된 app들을 가져와 본다\r
-                       // TODO: RUA로 대체한다\r
-                       Dictionary<string, string[]> resultList = new Dictionary<string, string[]>();\r
-                       var applicationList = await ApplicationManager.GetInstalledApplicationsAsync();\r
-                       string[] result;\r
-\r
-                       foreach (ApplicationInfo appInfo in applicationList)\r
-                       {\r
-                               result = new string[3];\r
-\r
-                               result[0] = appInfo.Label != null ? appInfo.Label : null;\r
-                               result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null;\r
-                               result[2] = appInfo.IconPath != null ? appInfo.IconPath : null;\r
-\r
-                               resultList.Add(appInfo.ApplicationId, result);\r
-                       }\r
-\r
-                       return resultList;\r
-               }\r
-       }\r
+    class ApplicationManagerPort : IApplicationManagerAPIs\r
+    {\r
+        public ApplicationManagerPort()\r
+        {\r
+            ApplicationManager.ApplicationLaunched += new EventHandler<ApplicationLaunchedEventArgs>(OnApplicationLaunched);\r
+        }\r
+\r
+        void OnApplicationLaunched(object sender, EventArgs args)\r
+        {\r
+            ApplicationLaunchedEventArgs launchedEventArgs = args as ApplicationLaunchedEventArgs;\r
+\r
+            DebuggingUtils.Dbg(launchedEventArgs.ApplicationInfo.Label.ToString() + " launched");\r
+        }\r
+\r
+        public async Task<Dictionary<string, string[]>> GetRecentApplications()\r
+        {\r
+            // RUA가 지원되지 않으므로 일단 설치된 app들을 가져와 본다\r
+            // TODO: RUA로 대체한다\r
+            Dictionary<string, string[]> resultList = new Dictionary<string, string[]>();\r
+            var applicationList = await ApplicationManager.GetInstalledApplicationsAsync();\r
+            string[] result;\r
+\r
+            foreach (ApplicationInfo appInfo in applicationList)\r
+            {\r
+                result = new string[3];\r
+\r
+                result[0] = appInfo.Label != null ? appInfo.Label : null;\r
+                result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null;\r
+                result[2] = appInfo.IconPath != null ? appInfo.IconPath : null;\r
+\r
+                resultList.Add(appInfo.ApplicationId, result);\r
+            }\r
+\r
+            return resultList;\r
+        }\r
+    }\r
 }
\ No newline at end of file
index 554328d03bbd32ce5a7818cf2e03c30cc6b4dc20..81420b308a657c59a59c3c9eaf361b66a460b73d 100644 (file)
@@ -82,45 +82,46 @@ namespace TVHome.TizenTV.Ports
         public DBPort()\r
         {\r
             // TODO : make a unit test for this!!!\r
-            DebuggingPort.d("DBPort-------------------------------------");\r
-            DebuggingPort.d("version " + ExecSQL("csk", "SELECT SQLITE_VERSION()"));\r
-            DebuggingPort.d("create " + ExecSQL("csk", "CREATE TABLE friends(Id INTEGER PRIMARY KEY, Name TEXT);"));\r
+            DebuggingPort.D("DBPort-------------------------------------");\r
+            DebuggingPort.D("version " + ExecSQL("csk", "SELECT SQLITE_VERSION()"));\r
+            DebuggingPort.D("create " + ExecSQL("csk", "CREATE TABLE friends(Id INTEGER PRIMARY KEY, Name TEXT);"));\r
 \r
-            DebuggingPort.d("insert 1 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Tom');"));\r
-            DebuggingPort.d("insert 2 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Rebecca');"));\r
-            DebuggingPort.d("insert 3 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Jim');"));\r
-            DebuggingPort.d("insert 4 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Roger');"));\r
-            DebuggingPort.d("insert 5 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Robert');"));\r
+            DebuggingPort.D("insert 1 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Tom');"));\r
+            DebuggingPort.D("insert 2 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Rebecca');"));\r
+            DebuggingPort.D("insert 3 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Jim');"));\r
+            DebuggingPort.D("insert 4 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Roger');"));\r
+            DebuggingPort.D("insert 5 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Robert');"));\r
 \r
             IEnumerable<DBItem> dbItems = new List<DBItem>();\r
-            DebuggingPort.d("select " + ExecSQL("csk", "SELECT * FROM friends;", out dbItems));\r
+            DebuggingPort.D("select " + ExecSQL("csk", "SELECT * FROM friends;", out dbItems));\r
             foreach (var item in dbItems)\r
             {\r
                 foreach (var value in item.ItemProperties)\r
                 {\r
-                    DebuggingPort.d("column[" + value.Key + "] = " + value.Value);\r
+                    DebuggingPort.D("column[" + value.Key + "] = " + value.Value);\r
                 }\r
             }\r
 \r
-            DebuggingPort.d("insert 5 " + ExecSQL("csk", "DROP TABLE friends;"));\r
+            DebuggingPort.D("insert 5 " + ExecSQL("csk", "DROP TABLE friends;"));\r
         }\r
 \r
         private static bool CheckResult(int res, string desc)\r
         {\r
             if (res != SQLITE_OK)\r
             {\r
-                DebuggingPort.d(String.Format("DB Error [{0}], {1}", desc, res));\r
+                DebuggingPort.D(String.Format("DB Error [{0}], {1}", desc, res));\r
                 return false;\r
             }\r
+\r
             return true;\r
         }\r
 \r
         private static bool Open(string dbName, out IntPtr handle)\r
         {\r
-            DebuggingPort.d("[DB Open]");\r
+            DebuggingPort.D("[DB Open]");\r
             if (dbName == null)\r
             {\r
-                DebuggingPort.e("DB Name is NULL!!!");\r
+                DebuggingPort.E("DB Name is NULL!!!");\r
                 handle = IntPtr.Zero;\r
                 return false;\r
             }\r
@@ -133,7 +134,7 @@ namespace TVHome.TizenTV.Ports
 \r
         private static void Close(IntPtr handle)\r
         {\r
-            DebuggingPort.d("[DB Close]");\r
+            DebuggingPort.D("[DB Close]");\r
             if (handle == null)\r
             {\r
                 return;\r
@@ -168,14 +169,14 @@ namespace TVHome.TizenTV.Ports
         {\r
             if (dbName == null || sql == null)\r
             {\r
-                DebuggingPort.e("Invalid argument!!!");\r
+                DebuggingPort.E("Invalid argument!!!");\r
                 return false;\r
             }\r
 \r
             DBHandleRAII db = new DBHandleRAII(dbName);\r
             if (db.handle == IntPtr.Zero)\r
             {\r
-                DebuggingPort.e("DB open failed!!!");\r
+                DebuggingPort.E("DB open failed!!!");\r
                 return false;\r
             }\r
 \r
@@ -187,15 +188,16 @@ namespace TVHome.TizenTV.Ports
 \r
         private int ExecCallback(IntPtr notUsed, int numberOfColumn, IntPtr value, IntPtr column)\r
         {\r
-            DebuggingPort.d("ExecCallback");\r
+            DebuggingPort.D("ExecCallback");\r
             for (int i = 1; i < numberOfColumn; i++)\r
             {\r
                 string _value = Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(value, i * PtrSize));\r
-                DebuggingPort.e("" + i + " - " + _value + " / ");\r
+                DebuggingPort.E("" + i + " - " + _value + " / ");\r
                 DBItem item = new DBItem();\r
                 item.Add(i, _value);\r
                 givenItems.Add(item);\r
             }\r
+\r
             return 0;\r
         }\r
 \r
@@ -204,17 +206,17 @@ namespace TVHome.TizenTV.Ports
             givenItems.Clear();\r
             items = givenItems;\r
 \r
-            DebuggingPort.d("ExecSQL");\r
+            DebuggingPort.D("ExecSQL");\r
             if (dbName == null || sql == null)\r
             {\r
-                DebuggingPort.e("Invalid argument!!!");\r
+                DebuggingPort.E("Invalid argument!!!");\r
                 return false;\r
             }\r
 \r
             DBHandleRAII db = new DBHandleRAII(dbName);\r
             if (db.handle == IntPtr.Zero)\r
             {\r
-                DebuggingPort.e("DB open failed!!!");\r
+                DebuggingPort.E("DB open failed!!!");\r
                 return false;\r
             }\r
 \r
index e360a33d57b144b8b877def65a1812cf714abae0..934d2b8c23526cd960405cde465808af819d82fc 100644 (file)
@@ -79,12 +79,12 @@ namespace TVHome.TizenTV.Ports
             toast.Show();\r
         }\r
 \r
-        public static void d(string message)\r
+        public static void D(string message)\r
         {\r
             Log.Debug(TAG, message);\r
         }\r
 \r
-        public static void e(string message)\r
+        public static void E(string message)\r
         {\r
             Log.Error(TAG, message);\r
         }\r
index 7c7cc1732606693259512fecbe26ae4a65f53999..601bd5613828624f2456ac5d91f1920125730ca6 100644 (file)
@@ -28,7 +28,7 @@ namespace TVHome.TizenTV.Ports
         public event EventHandler<EventArgs> CustomChanged;
         private FileSystemEventCustomArgs args;
 
-        public void run()
+        public void Run()
         {
             watcher = new FileSystemWatcher();
             watcher.Path = "/opt/usr/home/owner/share/";
@@ -49,7 +49,8 @@ namespace TVHome.TizenTV.Ports
             {
                 CustomChanged(this, args);
             }
-            DebuggingPort.d(e.ChangeType + ", " + e.Name);
+
+            DebuggingPort.D(e.ChangeType + ", " + e.Name);
         }
     }
 }
index a213fb8044499a6b03ef27b4bdfbfbcd9e8064d7..a27a58879d4235abe7c972c9c1e9a46a2367e57f 100644 (file)
@@ -38,13 +38,17 @@ namespace TVHome.TizenTV.Ports
         private void PackageManager_UninstallProgressChanged(object sender, PackageManagerEventArgs e)\r
         {\r
             if (e.State == PackageEventState.Completed)\r
+            {\r
                 DebuggingUtils.Dbg("uninstall completed");\r
+            }\r
         }\r
 \r
         private void PackageManager_InstallProgressChanged(object sender, PackageManagerEventArgs e)\r
         {\r
             if (e.State == PackageEventState.Completed)\r
+            {\r
                 DebuggingUtils.Dbg("install completed");\r
+            }\r
         }\r
 \r
         public Dictionary<string, string[]> GetPackageList()\r
@@ -67,7 +71,7 @@ namespace TVHome.TizenTV.Ports
                     result[0] = null;\r
                 }\r
 \r
-                if ( item.Id != null)\r
+                if (item.Id != null)\r
                 {\r
                     result[1] = item.Id;\r
                 }\r
@@ -76,7 +80,7 @@ namespace TVHome.TizenTV.Ports
                     result[1] = null;\r
                 }\r
 \r
-                if ( item.IconPath != null)\r
+                if (item.IconPath != null)\r
                 {\r
                     result[2] = item.IconPath;\r
                 }\r
@@ -96,9 +100,13 @@ namespace TVHome.TizenTV.Ports
             Package tempItem = PackageManager.GetPackage(PkgID);\r
 \r
             if (tempItem != null)\r
+            {\r
                 return tempItem.Label;\r
+            }\r
             else\r
+            {\r
                 return null;\r
+            }\r
         }\r
     }\r
 }
\ No newline at end of file
index da476667d8704a7d451ad53196a46a52038746c1..1b7fba577eef634b302f9ca9993f0ec9edc9c6cb 100644 (file)
@@ -25,9 +25,9 @@ namespace TVHome.TizenTV
             AppResourcePath = DirectoryInfo.Resource;\r
             AppDataPath = DirectoryInfo.Data;\r
 \r
-                       // TODO : remove this.\r
-                       // var dbPort = new DBPort();\r
-                       DebuggingPort.d("I'm here");\r
+            // TODO : remove this.\r
+            // var dbPort = new DBPort();\r
+            DebuggingPort.D("I'm here");\r
             LoadApplication(new App());\r
         }\r
 \r
@@ -42,7 +42,7 @@ namespace TVHome.TizenTV
             global::Xamarin.Forms.DependencyService.Register<BTModulePort>();\r
             global::Xamarin.Forms.DependencyService.Register<FileSystemWatcherPort>();\r
             global::Xamarin.Forms.DependencyService.Register<ApplicationManagerPort>();\r
-                       global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);\r
+            global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);\r
             app.Run(args);\r
         }\r
     }\r
index b5372e15d5a5abfae5d83c13dab34adb0623b155..69739e4754f4c72ca35cc85a028e4c475f9e5fd4 100644 (file)
@@ -51,6 +51,7 @@
     <Compile Include="Ports\AppControlPort.cs" />\r
     <Compile Include="Ports\ApplicationManagerPort.cs" />\r
     <Compile Include="Ports\BTModulePort.cs" />\r
+    <Compile Include="Ports\FileSystemWatcherPort.cs" />\r
     <Compile Include="Ports\PackageManagerPort.cs" />\r
     <Compile Include="Ports\WifiModulePort.cs" />\r
     <Compile Include="Ports\DebuggingPort.cs" />\r
@@ -61,9 +62,6 @@
     <Folder Include="lib\" />\r
     <Folder Include="res\" />\r
   </ItemGroup>\r
-  <ItemGroup>\r
-    <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
-  </ItemGroup>\r
   <ItemGroup>\r
     <ProjectReference Include="..\TVHome\TVHome.csproj">\r
       <Project>{54dd6673-7e64-48e6-a008-4d455e19e017}</Project>\r
index 41f4f9717ae76fbb349a6aa12865fffd255abb25..afd10c7fd45058dfb14a51de2855e4b6ffec49eb 100644 (file)
@@ -2,21 +2,28 @@
 <ViewCell xmlns="http://xamarin.com/schemas/2014/forms"\r
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"\r
           x:Class="TVHome.Controls.MainPanelButton">\r
-  <RelativeLayout Opacity="0.3">\r
-    <BoxView x:Name = "ButtonBox"\r
-             RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
-             RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
-             Color="Red" />\r
-    <Image x:Name="ButtonImage"\r
-           RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
-           RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}" \r
-           Source="{Binding CurrentStateDescription.IconPath}"/>\r
-    <Button x:Name = "ButtonFocusArea"\r
-            RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
-            RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
-            Focused="OnFocused"\r
-            Unfocused="OnUnfocused"\r
-            Clicked="OnClicked"\r
-            Opacity="0" />\r
-  </RelativeLayout>\r
+    <RelativeLayout Opacity="0.3">\r
+        <BoxView x:Name = "ButtonBox"\r
+                 RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+                 RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+                 Color="Red" />\r
+        <Image x:Name="ButtonImage"\r
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+               Source="{Binding CurrentStateDescription.IconPath}" />\r
+        <Label x:Name="ButtonTitle"\r
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2}"\r
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8}"\r
+               Opacity="0"\r
+               LineBreakMode="TailTruncation"\r
+               Text="{Binding CurrentStateDescription.Label}" />\r
+        <Button x:Name = "ButtonFocusArea"\r
+                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+                Focused="OnFocused"\r
+                Unfocused="OnUnfocused"\r
+                Clicked="OnClicked"\r
+                Opacity="0" />\r
+    </RelativeLayout>\r
 </ViewCell>
\ No newline at end of file
index 5e10bf10bcffc0d339755663b8cca22e5082b440..4687364453841672932d6a1e8ba4616abeb61d18 100644 (file)
@@ -54,11 +54,13 @@ namespace TVHome.Controls
                 OnFocusedCommand.Execute("");\r
             }\r
 \r
+            ButtonTitle.FadeTo(0.99, 300);\r
             await View.FadeTo(0.6, 300);\r
         }\r
 \r
         private async void OnUnfocused(object sender, FocusEventArgs e)\r
         {\r
+            ButtonTitle.FadeTo(0, 300);\r
             await View.FadeTo(0.3, 300);\r
         }\r
 \r
index 63af0ad065c4d0cd1cefc5a5e039254dd3fd4767..fe16187bba2db0319f4e84a4f9a87526b42ecad1 100644 (file)
@@ -7,11 +7,17 @@
                  RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
                  RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"\r
                  Color="Blue" />\r
-        <Label x:Name ="ButtonTitle"\r
-               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
+        <Image x:Name="ButtonImage"\r
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"\r
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"\r
-               Text="{Binding CurrentStateDescription.Label}"\r
-               LineBreakMode="TailTruncation" />\r
+               Source="{Binding CurrentStateDescription.IconPath}" />\r
+        <Label x:Name="ButtonTitle"\r
+               RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2}"\r
+               RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"\r
+               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8}"\r
+               Opacity="0"\r
+               LineBreakMode="TailTruncation"\r
+               Text="{Binding CurrentStateDescription.Label}" />\r
         <Button x:Name = "ButtonFocusArea"\r
                 RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"\r
                 RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"\r
index 6ba4adcbe3a200ae8427a1bee9e4ed8d50aa02f5..54a2b0d64a1d2109ff2d02a1d81fd0ac65b43def 100644 (file)
@@ -54,11 +54,13 @@ namespace TVHome.Controls
                 OnFocusedCommand.Execute("");\r
             }\r
 \r
+            ButtonTitle.FadeTo(0.99, 300);\r
             await View.FadeTo(0.6, 300);\r
         }\r
 \r
         private async void OnUnfocused(object sender, FocusEventArgs e)\r
         {\r
+            ButtonTitle.FadeTo(0, 300);\r
             await View.FadeTo(0.3, 300);\r
         }\r
 \r
index 8953d5c9ab4bad2c67c9db02c88de7b475d32fcf..0d8314e584529fd1e157588001bb522a95df4dd5 100644 (file)
@@ -26,16 +26,19 @@ namespace TVHome.DataModels
             get;\r
             set;\r
         }\r
+\r
         public string PackageID\r
         {\r
             get;\r
             set;\r
         }\r
+\r
         public string AppID\r
         {\r
             get;\r
             set;\r
         }\r
+\r
         public string AppName\r
         {\r
             get;\r
@@ -50,7 +53,7 @@ namespace TVHome.DataModels
         public void SetDBItem(IDBItem item)\r
         {\r
             int idx = 0;\r
-            foreach(var column in item.GetColumnValues())\r
+            foreach (var column in item.GetColumnValues())\r
             {\r
                 SetColumnValue(idx++, column);\r
             }\r
@@ -65,6 +68,7 @@ namespace TVHome.DataModels
                 case 2: return AppID;\r
                 case 3: return AppName;\r
             }\r
+\r
             return "";\r
         }\r
 \r
index 493e3ce2ed00b52440e72995a2d16c41a49c58eb..d5d9b95f0c12fabb82ebe219407701d86dd11219 100644 (file)
@@ -75,6 +75,7 @@ namespace TVHome.DataModels
             {\r
                 return value;\r
             }\r
+\r
             return "";\r
         }\r
 \r
index d5345f2c9a8ccf29c48b103d92463fb9e51580ed..ec626f2915d85ed5f24c8d38f9a76fd65c819678 100644 (file)
@@ -64,5 +64,4 @@ namespace TVHome.DataModels
         //     The name of the affected file or directory.
         public string Name { set; get; }
     }
-}
-
+}
\ No newline at end of file
index 8f49569fea0a791cb2770fc2c5d8212779b403f9..8dd6592b4c00fd6ea234729c98427ec0043e7bab 100644 (file)
@@ -20,14 +20,15 @@ namespace TVHome.DataModels
 {\r
     public class RecentShortcutInfo : ShortcutInfo\r
     {\r
-               public DateTime Date\r
-               {\r
-                       get;\r
-                       set;\r
-               }\r
-               public override void UpdateState()\r
+        public DateTime Date\r
         {\r
-                       SetCurrentState("default");\r
-               }\r
+            get;\r
+            set;\r
+        }\r
+\r
+        public override void UpdateState()\r
+        {\r
+            SetCurrentState("default");\r
+        }\r
     }\r
 }\r
index b7316370d3ce13ebdf07406fd2c6994b722f8b7e..a0d305f04d565ec47c66ca1b6655ca87ea09f78c 100644 (file)
@@ -49,30 +49,30 @@ namespace TVHome.Models
 \r
         public async Task<IEnumerable<RecentShortcutInfo>> GetList()\r
         {\r
-                       IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();\r
-                       List<RecentShortcutInfo> recentShortcutInfoList = new List<RecentShortcutInfo>();\r
+            IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();\r
+            List<RecentShortcutInfo> recentShortcutInfoList = new List<RecentShortcutInfo>();\r
 \r
-                       var applicationList = await applicationManagerPort.GetRecentApplications();\r
-                       foreach (KeyValuePair<string, string[]> item in applicationList)\r
-                       {\r
-                               var defaultStateDescription = new StateDescription()\r
-                               {\r
-                                       // TODO : Label에는 ApplicationInfo의 Label을 넣자\r
-                                       Label = item.Value[0],\r
-                                       IconPath = item.Value[2],\r
-                                       Action = new AppControlAction()\r
-                                       {\r
-                                               PkgID = item.Key\r
-                                       }\r
-                               };\r
-                               var recentShortcutInfo = new RecentShortcutInfo();\r
-                               recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);\r
-                               recentShortcutInfo.CurrentStateDescription = defaultStateDescription;\r
-                               recentShortcutInfoList.Add(recentShortcutInfo);\r
-                       }\r
+            var applicationList = await applicationManagerPort.GetRecentApplications();\r
+            foreach (KeyValuePair<string, string[]> item in applicationList)\r
+            {\r
+                var defaultStateDescription = new StateDescription()\r
+                {\r
+                    // TODO : Label에는 ApplicationInfo의 Label을 넣자\r
+                    Label = item.Value[0],\r
+                    IconPath = item.Value[2],\r
+                    Action = new AppControlAction()\r
+                    {\r
+                        PkgID = item.Key\r
+                    }\r
+                };\r
+                var recentShortcutInfo = new RecentShortcutInfo();\r
+                recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);\r
+                recentShortcutInfo.CurrentStateDescription = defaultStateDescription;\r
+                recentShortcutInfoList.Add(recentShortcutInfo);\r
+            }\r
 \r
-                       return recentShortcutInfoList;\r
+            return recentShortcutInfoList;\r
 \r
-               }\r
+        }\r
     }\r
 }\r
index 19a031e92795dde2d298c780c64ff715cc28c29c..bff1eebf79938e20d54a81bb832d573c7e27dd02 100644 (file)
@@ -35,8 +35,8 @@ namespace TVHome.Utils
 \r
         private string DBName = "tvhome.apps";\r
         //private string CreateTableStatement = "CREATE TABLE IF NOT EXISTS app_shortcut(" +\r
-        private string CreateTableStatement = "CREATE TABLE app_shortcut(" +\r
-            "id TEXT PRIMARY KEY, package_id TEXT, app_id TEXT, app_name TEXT);";\r
+        //private string CreateTableStatement = "CREATE TABLE app_shortcut(" +\r
+        //    "id TEXT PRIMARY KEY, package_id TEXT, app_id TEXT, app_name TEXT);";\r
 \r
         public static AppShortcutStorage Instance\r
         {\r
@@ -45,8 +45,9 @@ namespace TVHome.Utils
 \r
         private AppShortcutStorage()\r
         {\r
-            fileSystemWatcher.run();\r
+            fileSystemWatcher.Run();\r
         }\r
+\r
         public bool Create(AppShortcutInfo app)\r
         {\r
             string query = "INSERT INTO app_shortcut VALUES(";\r
@@ -57,6 +58,7 @@ namespace TVHome.Utils
                 query += value;\r
                 query += "', ";\r
             }\r
+\r
             query = query.Remove(query.Length - 2);\r
             query += ");";\r
 \r
@@ -66,6 +68,7 @@ namespace TVHome.Utils
             {\r
                 DebuggingUtils.Err("DB inserting Failed!!! " + query);\r
             }\r
+\r
             return false;\r
         }\r
 \r
@@ -136,7 +139,7 @@ namespace TVHome.Utils
                             new StateDescription\r
                             {\r
                                 Label = result[0],\r
-                                IconPath = "wifion.png",    // result[2]\r
+                                IconPath = "user_1.png",    // result[2]\r
                                 Action = new AppControlAction()\r
                                 {\r
                                     PkgID = "org.tizen.settings"    // result[1]\r
index a836cb778db5badf4ef5639364b41da500424678..afd41d40646108b48e8a434493866052026d0962 100644 (file)
@@ -22,8 +22,8 @@ using System.Threading.Tasks;
 \r
 namespace TVHome.Utils\r
 {\r
-       public interface IApplicationManagerAPIs\r
-       {\r
-               Task<Dictionary<string, string[]>> GetRecentApplications();\r
-       }\r
+    public interface IApplicationManagerAPIs\r
+    {\r
+        Task<Dictionary<string, string[]>> GetRecentApplications();\r
+    }\r
 }\r
index 9c6bd3f1a9e5f5baa3a5089ac329db4d4ad784b1..e07f29866c0791ed22e6fea8d7af751ed90cf160 100644 (file)
@@ -6,6 +6,6 @@ namespace TVHome.Utils
     public interface IFileSystemWatcherAPIs
     {
         event EventHandler<EventArgs> CustomChanged;
-        void run();
+        void Run();
     }
 }
index 20c49c4bfefef767f9d0d62665c9d88c61d542c8..ed9261229baccb158f220ff7fc559c7a4f01c09d 100644 (file)
@@ -33,7 +33,7 @@ namespace TVHome.Utils
 \r
         public static RecentShortcutInfo Read(string key)\r
         {\r
-                       RecentShortcutInfo recentShortcutInfo = new RecentShortcutInfo();\r
+            RecentShortcutInfo recentShortcutInfo = new RecentShortcutInfo();\r
             return recentShortcutInfo;\r
         }\r
 \r
index 9e40221f28d5a02be9aa6bd0cfeb7a98fc7e6efc..2d4482dbdb94b8c67ceed2b451f993b66e2b5ae8 100644 (file)
@@ -42,6 +42,7 @@ namespace TVHome.ViewModels
                 handler(this, new PropertyChangedEventArgs(name));\r
             }\r
         }\r
+\r
         public MainPageViewModel()\r
         {\r
             string[] AppName = { "Recent", "Apps", "Settings" };\r
@@ -72,6 +73,7 @@ namespace TVHome.ViewModels
                 shortcutInfo.UpdateState();\r
                 TempList.Add(shortcutInfo);\r
             }\r
+\r
             MainList = TempList;\r
             OnPropertyChanged("MainList");\r
 \r
index 53b7682f167a8c3528151a75420a6a8c55e89ea7..45ff941f9bb18e0ccf2e6dbd4d30d91f0f98ff41 100644 (file)
@@ -49,13 +49,15 @@ namespace TVHome.Views
                 {\r
                     currentSubPanel.HidePanel();\r
                 }\r
+\r
                 currentSubPanel = SubPanelDictionary[key];\r
                 currentSubPanel.ShowPanel();\r
             });\r
         }\r
+\r
         private void OnAppearing(object sender, EventArgs e)\r
         {\r
-            PageMainPanel.initialFocusing();\r
+            PageMainPanel.InitialFocusing();\r
         }\r
     }\r
 }
\ No newline at end of file
index 1553e06e46f150510d425d6928b201e03d37e269..e4ff6adc9aa8cf452686d0031f006c4a29dbc180 100644 (file)
@@ -55,7 +55,11 @@ namespace TVHome.Views
 \r
         private void OnItemsSourcePropertyChanged(object sender, PropertyChangedEventArgs e)\r
         {\r
-            if (e.PropertyName != "ItemsSource") return;\r
+            if (e.PropertyName != "ItemsSource")\r
+            {\r
+                return;\r
+            }\r
+\r
             var index = 0;\r
             PanelButtonGrid.Children.Clear();\r
             foreach (ShortcutInfo item in ItemsSource)\r
@@ -74,10 +78,10 @@ namespace TVHome.Views
             }\r
         }\r
 \r
-        public void initialFocusing()\r
+        public void InitialFocusing()\r
         {\r
             var button = PanelButtonGrid.Children[1] as RelativeLayout;\r
-            button.Children[2].Focus();\r
+            button.FindByName<Button>("ButtonFocusArea").Focus();\r
         }\r
     }\r
 }
\ No newline at end of file
index a78d3c824f7da2f4938044e9d13889d71af3b257..52ff09c46bdbb35bc9e0a6c1b931e0f7c10c0fde 100644 (file)
@@ -3,7 +3,8 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"\r
              x:Class="TVHome.Views.SubPanel">\r
     <ContentView.Content>\r
-        <ScrollView Orientation="Horizontal"\r
+        <ScrollView x:Name="PanelScrollView"\r
+                    Orientation="Horizontal"\r
                     HorizontalOptions="Center">\r
             <StackLayout x:Name="PanelButtonStack"\r
                          Orientation="Horizontal">\r
index 398e87ec7b88990e4feab616a803dea1855cfb41..715e77db2531356c746b23b9ab398dacb0752c22 100644 (file)
@@ -45,17 +45,20 @@ namespace TVHome.Views
             InitializeComponent();\r
             isFocused = false;\r
             PropertyChanged += OnItemsSourcePropertyChanged;\r
-            HidePanel();\r
         }\r
 \r
         private void OnItemsSourcePropertyChanged(object sender, PropertyChangedEventArgs e)\r
         {\r
-            if (e.PropertyName != "ItemsSource") return;\r
+            if (e.PropertyName != "ItemsSource")\r
+            {\r
+                return;\r
+            }\r
+\r
             PanelButtonStack.Children.Clear();\r
             foreach (ShortcutInfo item in ItemsSource)\r
             {\r
                 var button = new SubPanelButton();\r
-                               button.View.BindingContext = item;\r
+                button.View.BindingContext = item;\r
                 button.OnFocusedCommand = new Command(() =>\r
                 {\r
                     FocusPanel();\r
@@ -66,6 +69,8 @@ namespace TVHome.Views
                 });\r
                 PanelButtonStack.Children.Add(button.View);\r
             }\r
+\r
+            HidePanel();\r
         }\r
 \r
         public async void HidePanel()\r
@@ -75,6 +80,8 @@ namespace TVHome.Views
             {\r
                 item.IsEnabled = false;\r
             }\r
+\r
+            PanelScrollView.ScrollToAsync(0, 0, true);\r
             this.TranslateTo(0, 1, 0);\r
             await this.FadeTo(0, 0);\r
         }\r
@@ -86,18 +93,23 @@ namespace TVHome.Views
             {\r
                 item.IsEnabled = true;\r
             }\r
+\r
             this.TranslateTo(0, 0, 0);\r
             await this.FadeTo(0.3, 0);\r
         }\r
 \r
         public async void FocusPanel()\r
         {\r
-            if (isFocused) return;\r
+            if (isFocused)\r
+            {\r
+                return;\r
+            }\r
+\r
             isFocused = true;\r
             var button = PanelButtonStack.Children[1] as RelativeLayout;\r
-            button.Children[2].Focus();\r
+            button.FindByName<Button>("ButtonFocusArea").Focus();\r
 \r
-            this.TranslateTo(0, -120, 300);\r
+            this.TranslateTo(0, -140, 300);\r
             await this.FadeTo(0.99, 300);\r
         }\r
     }\r