Skip to content

Commit

Permalink
Fix displaying of the sort order
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Flamefire authored and Danesh committed Apr 7, 2014
1 parent fef9b60 commit dc8637b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/com/android/launcher3/Launcher.java
Expand Up @@ -1011,10 +1011,17 @@ public void onClickSortModeButton(View v) {
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()) {
Expand Down

0 comments on commit dc8637b

Please sign in to comment.