From: cskim Date: Wed, 19 Apr 2017 10:41:39 +0000 (+0900) Subject: Change Recently Used TVApps's sorting option to Newest X-Git-Tag: submit/tizen/20170808.015446~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=576ed0722a8a37765d35087755e38cc298e6058f;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Change Recently Used TVApps's sorting option to Newest Change-Id: I19600c88133fa0dfdbddd9f87b750272aa39719e Signed-off-by: cskim --- diff --git a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs index b7dea14..56040fd 100644 --- a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs @@ -184,12 +184,6 @@ namespace LibTVRefCommonPortable.DataModels [XmlIgnore] public DateTime Installed { get; set; } - /// - /// A app's last used time. - /// - [XmlIgnore] - public DateTime LastUsed { get; set; } - /// /// A pin command of the Option menu. /// diff --git a/LibTVRefCommonPortable/Models/AppShortcutController.cs b/LibTVRefCommonPortable/Models/AppShortcutController.cs index 331c975..e3b71a0 100755 --- a/LibTVRefCommonPortable/Models/AppShortcutController.cs +++ b/LibTVRefCommonPortable/Models/AppShortcutController.cs @@ -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); diff --git a/TVApps/TVApps/ViewModels/AppsListSorter.cs b/TVApps/TVApps/ViewModels/AppsListSorter.cs index ddb9f16..b65db7d 100644 --- a/TVApps/TVApps/ViewModels/AppsListSorter.cs +++ b/TVApps/TVApps/ViewModels/AppsListSorter.cs @@ -73,22 +73,6 @@ namespace TVApps.ViewModels return left.Installed.CompareTo(right.Installed) * -1; } - /// - /// A method compares two last used dates of AppShortcutInfo - /// Sorts AppShortcutInfo by last used date in descending - /// - /// A AppShortcutInfo to be compared with right - /// A AppShortcutInfo to be compared with left - /// - /// If left precedes right, return greater than 0. - /// If left follows right, return lesser than 0. - /// - /// - private static int SortByRecentlyUsed(AppShortcutInfo left, AppShortcutInfo right) - { - return left.LastUsed.CompareTo(right.LastUsed) * -1; - } - /// /// A method sorts list by parameter /// @@ -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; diff --git a/TVApps/TVApps/ViewModels/MainPageViewModel.cs b/TVApps/TVApps/ViewModels/MainPageViewModel.cs index 21b6b4d..557df19 100644 --- a/TVApps/TVApps/ViewModels/MainPageViewModel.cs +++ b/TVApps/TVApps/ViewModels/MainPageViewModel.cs @@ -41,8 +41,7 @@ namespace TVApps.ViewModels /// public enum SortingOptions { - RecentlyInstalled = 0, - RecentlyUsed, + Newest = 0, Ascending, Descending, }; diff --git a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs index 56cd6c1..38b7e2f 100755 --- a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs +++ b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs @@ -94,7 +94,7 @@ namespace TVApps.Views private void CreateSortButton() { - List SortList = new List { "Recentely Installed", "Recently Used", "A - Z", "Z - A" }; + List SortList = new List { "Newest", "A - Z", "Z - A" }; SortButton = new DropdownList(); SortButton.ItemsSource = SortList;