summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlamefire <alex@grundis.de>2014-03-31 19:37:38 (GMT)
committerDanesh Mondegarian <daneshm90@gmail.com>2014-04-07 02:47:33 (GMT)
commitdc8637b7adb1db16ce32fbb147a71dae7db82374 (patch)
tree7c3ccb003e5f71697656bf47ec787efc29da9a8d
parentfef9b60ab83f7680e22dd10afb878308034557b5 (diff)
downloadandroid_packages_apps_Trebuchet-dc8637b7adb1db16ce32fbb147a71dae7db82374.zip
android_packages_apps_Trebuchet-dc8637b7adb1db16ce32fbb147a71dae7db82374.tar.gz
android_packages_apps_Trebuchet-dc8637b7adb1db16ce32fbb147a71dae7db82374.tar.bz2
Fix displaying of the sort order
A bug(?) makes an option of a radio list be checked, once you call setChecked, even with false. This results in the wrong option beeing checked. Fix this with a switch-case. Change-Id: If5e0fd9a3f534fa29b8216ace216dad4e456ad53
-rw-r--r--src/com/android/launcher3/Launcher.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c7dbaeb..6200714 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1011,10 +1011,17 @@ public class Launcher extends Activity
final PopupMenu popupMenu = new PopupMenu(this, v);
final Menu menu = popupMenu.getMenu();
popupMenu.inflate(R.menu.apps_customize_sort_mode);
- AppsCustomizePagedView.SortMode sortMode = mAppsCustomizeContent.getSortMode();
- menu.findItem(R.id.sort_mode_title).setChecked(sortMode == AppsCustomizePagedView.SortMode.Title);
- menu.findItem(R.id.sort_mode_launch_count).setChecked(sortMode == AppsCustomizePagedView.SortMode.LaunchCount);
- menu.findItem(R.id.sort_mode_install_time).setChecked(sortMode == AppsCustomizePagedView.SortMode.InstallTime);
+ switch(mAppsCustomizeContent.getSortMode()) {
+ case Title:
+ menu.findItem(R.id.sort_mode_title).setChecked(true);
+ break;
+ case LaunchCount:
+ menu.findItem(R.id.sort_mode_launch_count).setChecked(true);
+ break;
+ case InstallTime:
+ menu.findItem(R.id.sort_mode_install_time).setChecked(true);
+ break;
+ }
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {