Don't move dialog on tablets

This commit is contained in:
serso 2016-03-03 17:12:14 +01:00
parent ba69cc7096
commit 0993a30d5c

View File

@ -26,6 +26,7 @@ public class FloatingKeyboardWindow {
private PopupWindow window; private PopupWindow window;
@Nullable @Nullable
private Dialog dialog; private Dialog dialog;
private boolean tablet;
public FloatingKeyboardWindow(@javax.annotation.Nullable PopupWindow.OnDismissListener dismissListener) { public FloatingKeyboardWindow(@javax.annotation.Nullable PopupWindow.OnDismissListener dismissListener) {
this.dismissListener = dismissListener; this.dismissListener = dismissListener;
@ -41,7 +42,9 @@ public class FloatingKeyboardWindow {
} }
private void onDismissed() { private void onDismissed() {
moveDialog(Gravity.CENTER); if (!tablet) {
moveDialog(Gravity.CENTER);
}
window = null; window = null;
dialog = null; dialog = null;
} }
@ -53,9 +56,12 @@ public class FloatingKeyboardWindow {
return; return;
} }
this.dialog = dialog; this.dialog = dialog;
moveDialog(Gravity.TOP);
App.hideIme(editor);
final Context context = editor.getContext(); final Context context = editor.getContext();
this.tablet = App.isTablet(context);
if (!tablet) {
moveDialog(Gravity.TOP);
}
App.hideIme(editor);
final LinearLayout view = new LinearLayout(context); final LinearLayout view = new LinearLayout(context);
view.setOrientation(LinearLayout.VERTICAL); view.setOrientation(LinearLayout.VERTICAL);