diff options
author | Scott Mertz <scott@cyngn.com> | 2016-06-14 15:04:54 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-23 14:30:44 -0700 |
commit | b1a7da27d96e6100ff40ec1d7b6b7072f95decb1 (patch) | |
tree | 084612581c438cea33e3e35f03ec89c0fcecc896 | |
parent | 6c15a6abf4cde0326e4f23c62339a173b8c7d33e (diff) | |
download | android_packages_apps_CMFileManager-b1a7da27d96e6100ff40ec1d7b6b7072f95decb1.tar.gz android_packages_apps_CMFileManager-b1a7da27d96e6100ff40ec1d7b6b7072f95decb1.tar.bz2 android_packages_apps_CMFileManager-b1a7da27d96e6100ff40ec1d7b6b7072f95decb1.zip |
Fix sort mode popup after rotation from portrait to landscape
ListPopupWindow doesn't appear to correctly recalculate its popup
size after rotation. Force the recalculation on rotation and allow
the window to fill the entire screen if necessary.
FEIJ-1192
Change-Id: I6345a56c4dde3dd73c3d902afd0a840307014178
(cherry picked from commit 5042221d8e57a3d4867136cbcaa582f3fea7fe82)
-rwxr-xr-x | src/com/cyanogenmod/filemanager/activities/NavigationActivity.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java index bfdf0937..cf590306 100755 --- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java @@ -206,6 +206,7 @@ public class NavigationActivity extends Activity private NavigationCustomTitleView mCustomTitleView; private InputMethodManager mImm; private FilesystemInfoDialog.OnConfigChangeListener mOnConfigChangeListener; + private ListPopupWindow mPopupWindow; private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() { @Override @@ -806,6 +807,9 @@ public class NavigationActivity extends Activity if (navView != null) { navView.refreshViewMode(); } + if (mPopupWindow != null) { + mPopupWindow.postShow(); + } } /** @@ -2194,14 +2198,15 @@ public class NavigationActivity extends Activity final MenuSettingsAdapter adapter = new MenuSettingsAdapter(this, settings); //Create a show the popup menu - final ListPopupWindow popup = DialogHelper.createListPopupWindow(this, adapter, anchor); - popup.setOnItemClickListener(new OnItemClickListener() { + mPopupWindow = DialogHelper.createListPopupWindow(this, adapter, anchor); + mPopupWindow.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { FileManagerSettings setting = ((MenuSettingsAdapter)parent.getAdapter()).getSetting(position); final int value = ((MenuSettingsAdapter)parent.getAdapter()).getId(position); - popup.dismiss(); + mPopupWindow.dismiss(); + mPopupWindow = null; try { if (setting.compareTo(FileManagerSettings.SETTINGS_LAYOUT_MODE) == 0) { //Need to change the layout @@ -2246,13 +2251,14 @@ public class NavigationActivity extends Activity } }); - popup.setOnDismissListener(new PopupWindow.OnDismissListener() { + mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { adapter.dispose(); } }); - popup.show(); + mPopupWindow.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED); + mPopupWindow.show(); } /** |