Change Recently Used TVApps's sorting option to Newest
authorcskim <charles0.kim@samsung.com>
Wed, 19 Apr 2017 10:41:39 +0000 (19:41 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
Change-Id: I19600c88133fa0dfdbddd9f87b750272aa39719e
Signed-off-by: cskim <charles0.kim@samsung.com>
LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs
LibTVRefCommonPortable/Models/AppShortcutController.cs
TVApps/TVApps/ViewModels/AppsListSorter.cs
TVApps/TVApps/ViewModels/MainPageViewModel.cs
TVApps/TVApps/Views/FooterNormalStatus.xaml.cs

index b7dea143ee2bc9519a74a71b3203ea1c658e603d..56040fddeeb5d3ec9a41ce601752c507c9d40a24 100644 (file)
@@ -184,12 +184,6 @@ namespace LibTVRefCommonPortable.DataModels
         [XmlIgnore]
         public DateTime Installed { get; set; }
 
-        /// <summary>
-        /// A app's last used time.
-        /// </summary>
-        [XmlIgnore]
-        public DateTime LastUsed { get; set; }
-
         /// <summary>
         /// A pin command of the Option menu.
         /// </summary>
index 331c97543b8e163e816483bb700865c626d9e018..e3b71a03727545e5b48e8471acf61abc0caead0c 100755 (executable)
@@ -71,7 +71,6 @@ namespace LibTVRefCommonPortable.Models
                     IsRemovable = ApplicationManagerUtils.GetAppInfoRemovable(item.Key),
                     // TODO : Fill these correctly by using Tizen Device APIs
                     Installed = DateUtils.GetRandomDate(),
-                    LastUsed = DateUtils.GetRandomDate(),
                 };
 
                 appShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
index ddb9f169d97dae89ae915ab2dd6875dda78b8884..b65db7d9a1330ee97b72998dbd10a514ba6374bf 100644 (file)
@@ -73,22 +73,6 @@ namespace TVApps.ViewModels
             return left.Installed.CompareTo(right.Installed) * -1;
         }
 
-        /// <summary>
-        /// A method compares two last used dates of AppShortcutInfo
-        /// Sorts AppShortcutInfo by last used date in descending
-        /// </summary>
-        /// <param name="left">A AppShortcutInfo to be compared with right</param>
-        /// <param name="right">A AppShortcutInfo to be compared with left</param>
-        /// <returns>
-        /// If left precedes right, return greater than 0.
-        /// If left follows right, return lesser than 0.
-        /// </returns>
-        /// <see cref="System.DateTime.CompareTo(System.DateTime)"/>
-        private static int SortByRecentlyUsed(AppShortcutInfo left, AppShortcutInfo right)
-        {
-            return left.LastUsed.CompareTo(right.LastUsed) * -1;
-        }
-
         /// <summary>
         /// A method sorts list by parameter
         /// </summary>
@@ -99,12 +83,9 @@ namespace TVApps.ViewModels
             DebuggingUtils.Dbg("GetSortedAppsList, option = " + sortOption.ToString());
             switch (sortOption)
             {
-                case SortingOptions.RecentlyInstalled:
+                case SortingOptions.Newest:
                     list.Sort(SortByRecentlyInstalled);
                     break;
-                case SortingOptions.RecentlyUsed:
-                    list.Sort(SortByRecentlyUsed);
-                    break;
                 case SortingOptions.Descending:
                     list.Sort(SortByLabelDescending);
                     break;
index 21b6b4dbc2107c0ccc2265021ab13fd732c09b54..557df19f46e74ae14a3e72cee53482a90b300e07 100644 (file)
@@ -41,8 +41,7 @@ namespace TVApps.ViewModels
     /// </summary>
     public enum SortingOptions
     {
-        RecentlyInstalled = 0,
-        RecentlyUsed,
+        Newest = 0,
         Ascending,
         Descending,
     };
index 56cd6c125d8495ceb7a30bf4f37e3b92adec28b1..38b7e2f7dbc9fd1ef4a4a8c2b2463bb59a753426 100755 (executable)
@@ -94,7 +94,7 @@ namespace TVApps.Views
 
         private void CreateSortButton()
         {
-            List<string> SortList = new List<string> { "Recentely Installed", "Recently Used", "A - Z", "Z - A" };
+            List<string> SortList = new List<string> { "Newest", "A - Z", "Z - A" };
 
             SortButton = new DropdownList();
             SortButton.ItemsSource = SortList;