summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppsCustomizePagedView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/AppsCustomizePagedView.java')
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 0390f106a..6015de624 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -171,9 +171,29 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
* The different sort modes than can be used to order items.
*/
public enum SortMode {
- Title,
- LaunchCount,
- InstallTime
+ Title(0),
+ LaunchCount(1),
+ InstallTime(2);
+
+ private final int mValue;
+ private SortMode(int value) {
+ mValue = value;
+ }
+
+ public int getValue() {
+ return mValue;
+ }
+
+ public static SortMode getModeForValue(int value) {
+ switch (value) {
+ case 1:
+ return LaunchCount;
+ case 2:
+ return InstallTime;
+ default :
+ return Title;
+ }
+ }
}
private SortMode mSortMode = SortMode.Title;
@@ -1937,6 +1957,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
public void setup(Launcher launcher, DragController dragController) {
mLauncher = launcher;
mDragController = dragController;
+ int sortMode = SettingsProvider.getIntCustomDefault(mLauncher, SettingsProvider.SETTINGS_UI_DRAWER_SORT_MODE, -1);
+ if (sortMode != -1) {
+ setSortMode(SortMode.getModeForValue(sortMode));
+ }
}
/**