aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-06-14 15:04:54 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-06-17 08:15:30 -0700
commit5042221d8e57a3d4867136cbcaa582f3fea7fe82 (patch)
treefa1fbf0a3540ea86ee6c02ae32880608a33dcd00
parent83abccb05877572eff881d75e10ca01258c16e9e (diff)
downloadandroid_packages_apps_CMFileManager-5042221d8e57a3d4867136cbcaa582f3fea7fe82.tar.gz
android_packages_apps_CMFileManager-5042221d8e57a3d4867136cbcaa582f3fea7fe82.tar.bz2
android_packages_apps_CMFileManager-5042221d8e57a3d4867136cbcaa582f3fea7fe82.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
-rwxr-xr-xsrc/com/cyanogenmod/filemanager/activities/NavigationActivity.java16
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();
}
/**