Add app installed time for app shortcut.
authorcskim <charles0.kim@samsung.com>
Sat, 29 Apr 2017 07:38:45 +0000 (16:38 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
Fix code formatting and compilcation warnings

Change-Id: I8656a2e5e48b2f1891825b1ae309dfcb272ee1a7

LibTVRefCommonPortable/Models/AppShortcutController.cs
LibTVRefCommonPortable/Utils/IPlatformNotification.cs
LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs
TVApps/TVApps/Views/FooterPinStatus.xaml.cs
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.TizenTV/Sniper.cs
TVHome/TVHome/Views/MainPage.xaml.cs
TVHome/TVHome/Views/MainPanel.xaml.cs
TVHome/TVHome/Views/SubPanel.xaml.cs

index e3b71a03727545e5b48e8471acf61abc0caead0c..953f0bbc58e6de7db8308e2aab51f3790c98b7db 100755 (executable)
@@ -66,11 +66,16 @@ namespace LibTVRefCommonPortable.Models
                     }
                 };
 
+                long longDate;
+                if (long.TryParse(item.Value[3], out longDate) == false)
+                {
+                    longDate = long.MinValue;
+                }
+
                 var appShortcutInfo = new AppShortcutInfo()
                 {
                     IsRemovable = ApplicationManagerUtils.GetAppInfoRemovable(item.Key),
-                    // TODO : Fill these correctly by using Tizen Device APIs
-                    Installed = DateUtils.GetRandomDate(),
+                    Installed = new DateTime(longDate),
                 };
 
                 appShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
index 2198c3fd591de1d0488f9ccdb774516c143e8add..648ef7c84b2abd947a257d1ce37f5edc99e56676 100755 (executable)
@@ -58,7 +58,7 @@ namespace LibTVRefCommonPortable.Utils
         /// <summary>
         /// A method will be called when the Nativation remote control key is pressed.
         /// </summary>
-        /// <param name="apkeyNamepID">A pressed remote control key name</param>
+        /// <param name="keyName">A pressed remote control key name</param>
         void OnNavigationKeyPressed(string keyName);
     }
 }
index 9d99edf4f1c98c7357940165e3bea8dde545d265..98a4cd073db4d6f773bb247ceea2cc838fe5da40 100755 (executable)
@@ -191,11 +191,12 @@ namespace LibTVRefCommonTizen.Ports
                         continue;
                     }
 
-                    result = new string[3];
+                    result = new string[4];
 
                     result[0] = appInfo.Label;
                     result[1] = appInfo.ApplicationId;
                     result[2] = (System.IO.File.Exists(appInfo.IconPath)) ? appInfo.IconPath : DefaultAppIcon;
+                    result[3] = "" + pkgInfo.InstalledTime;
                     resultList.Add(appInfo.ApplicationId, result);
                 }
 
index 893fcc82100e5f3e87df7e34806e8465f56ebf2e..42e456cc11939b59932393b7d6a98a5f2a036da5 100755 (executable)
@@ -54,6 +54,7 @@ namespace TVApps.Views
             CreateDoneButton();
             //CreateFooterAdditionalText();
         }
+
         /*
         private void CreateFooterAdditionalText()
         {
@@ -98,6 +99,7 @@ namespace TVApps.Views
         {
             return DoneButton;
         }
+
         /*
         private void FooterPinStatusPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         {
index a3e8e74cca0cdf41ded55f0d81bd792408d5637b..9aa3110eae6b348271cb9c610632247634fbf0f7 100755 (executable)
@@ -249,9 +249,9 @@ namespace TVApps.Views
             Button button;
             Button nextButton;
 
-            for (int i = 1; i < upperCount-1; i++)
+            for (int i = 1; i < upperCount - 1; i++)
             {
-                prevButton = upperList[i-1].FindByName<Button>("ButtonFocusArea");
+                prevButton = upperList[i - 1].FindByName<Button>("ButtonFocusArea");
                 button = upperList[i].FindByName<Button>("ButtonFocusArea");
                 nextButton = upperList[i + 1].FindByName<Button>("ButtonFocusArea");
 
@@ -267,7 +267,7 @@ namespace TVApps.Views
                 button?.On<Tizen>()?.SetNextFocusDownView(
                     lowerList[i].FindByName<Button>("ButtonFocusArea"));
 
-                if (i == upperCount-2)
+                if (i == upperCount - 2)
                 {
                     button?.On<Tizen>()?.SetNextFocusDownView(lowerList[i].FindByName<Button>("ButtonFocusArea"));
 
@@ -295,13 +295,13 @@ namespace TVApps.Views
                 button?.On<Tizen>()?.SetNextFocusUpView(
                     upperList[i].FindByName<Button>("ButtonFocusArea"));
 
-                if (i == lowerCount-2)
+                if (i == lowerCount - 2)
                 {
-                    nextButton?.On<Tizen>()?.SetNextFocusUpView(upperList[i+1].FindByName<Button>("ButtonFocusArea"));
+                    nextButton?.On<Tizen>()?.SetNextFocusUpView(upperList[i + 1].FindByName<Button>("ButtonFocusArea"));
 
                     if (upperCount > lowerCount)
                     {
-                        nextButton?.On<Tizen>()?.SetNextFocusRightView(upperList[upperCount-1].FindByName<Button>("ButtonFocusArea"));
+                        nextButton?.On<Tizen>()?.SetNextFocusRightView(upperList[upperCount - 1].FindByName<Button>("ButtonFocusArea"));
                     }
                     else
                     {
@@ -361,7 +361,7 @@ namespace TVApps.Views
                 button?.On<Tizen>()?.SetNextFocusDownView(doneButton);
             }
 
-            if (lowerList.Count > 0 )
+            if (lowerList.Count > 0)
             {
                 doneButton?.On<Tizen>()?.SetNextFocusUpView(lowerList[lowerList.Count - 1].FindByName<Button>("ButtonFocusArea"));
             }
index d75e0ded5c3188b4e8fedc0500608476de8de7af..d2477e4758883d48a3ba2230cebb9f26268e7b0b 100644 (file)
@@ -1,6 +1,8 @@
 using System;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
+using Tizen;
 
 namespace CoreApp
 {
@@ -23,8 +25,9 @@ namespace CoreApp
             public string Info;
         }
 
-        private void WriteLog(string message)
+        private void WriteLog(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
         {
+            Log.Debug("sniper", message);
         }
 
         private void AddedCallback(string appId, string instanceId)
@@ -184,7 +187,7 @@ namespace CoreApp
             }
             catch (DllNotFoundException e)
             {
-                WriteLog("Loadable library is not found\n");
+                WriteLog("Loadable library is not found " + e.StackTrace);
             }
 
             WriteLog("Sniper starts monitoring : " + storagePath + "ImageSize : " + imageWidth + "x" + imageHeight);
@@ -198,7 +201,7 @@ namespace CoreApp
             }
             catch (DllNotFoundException e)
             {
-                WriteLog("Loadable library is not found\n");
+                WriteLog("Loadable library is not found " + e.StackTrace);
             }
 
             WriteLog("Sniper stops monitoring : " + storagePath + "ImageSize : " + imageWidth + "x" + imageHeight);
@@ -212,7 +215,7 @@ namespace CoreApp
             }
             catch (DllNotFoundException e)
             {
-                WriteLog("Loadable library is not found\n");
+                WriteLog("Loadable library is not found " + e.StackTrace);
             }
 
             WriteLog("Sniper requests update (" + instanceId + ") : " + storagePath + "ImageSize : " + imageWidth + "x" + imageHeight);
index 868894eff6a6715d8762ae4a23d0a392065aa38b..27d999ad379adb8d498b937bc21de913b6ecdc1b 100755 (executable)
@@ -167,7 +167,8 @@ namespace TVHome.Views
                         break;
                 }
             });
-            PageMainPanel.OnItemSelectedHandler += (id) => {
+            PageMainPanel.OnItemSelectedHandler += (id) =>
+            {
                 DebuggingUtils.Dbg("Selected Item " + id);
                 switch (id)
                 {
@@ -194,7 +195,7 @@ namespace TVHome.Views
         {
             base.OnAppearing();
 
-            AppsSubPanel.ItemSourceChanged += (s, e)=>
+            AppsSubPanel.ItemSourceChanged += (s, e) =>
             {
                 InitializeAppsSubPanelButtonFocusChain();
             };
index 62205097fc70e04268beb66a63c9dbe9d05c2358..254187ee277ca1d5c55700d3323d59ec5458d8ea 100755 (executable)
@@ -132,6 +132,7 @@ namespace TVHome.Views
         {
             await this.ScaleTo(1, 0);
         }
+
         public void SetButtonFocus(int idx)
         {
             var button = PanelButtonGrid.Children[idx];
index 5b993a5109769e59eecd0dbfe2a892d081b925c4..36b891fb369939e337c3c183d767bfa09d12df84 100755 (executable)
@@ -144,6 +144,7 @@ namespace TVHome.Views
                                 {
                                     viewItem.TranslateTo(SizeUtils.GetWidthSize((int)viewItem.TranslationX), 0, 0);
                                 }
+
                                 OnMoveVMCommand.Execute(ButtonViewList);
                             }
                         });
@@ -261,6 +262,7 @@ namespace TVHome.Views
         /// </summary>
         public override async void ShowPanel()
         {
+#pragma warning disable CS4014
             isFocused = false;
             foreach (var item in PanelButtonStack.Children)
             {
@@ -269,7 +271,6 @@ namespace TVHome.Views
                 item.FindByName<Image>("ButtonDimmedImage").ScaleTo(1.0, 300);
             }
 
-#pragma warning disable CS4014
             this.TranslateTo(0, 0, 300);
 #pragma warning restore CS4014
             await this.FadeTo(0.3, 300);
@@ -387,7 +388,7 @@ namespace TVHome.Views
 
             animation.Commit(this, "MoveRightAnimation", 334);
 
-            if (SizeUtils.GetWidthSize((int)(originItemView.X + translateX+ 216)) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) > SizeUtils.GetWidthSize(1920))
+            if (SizeUtils.GetWidthSize((int)(originItemView.X + translateX + 216)) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) > SizeUtils.GetWidthSize(1920))
             {
                 ScrollToRight();
             }