Don't move dialog on tablets
This commit is contained in:
parent
ba69cc7096
commit
0993a30d5c
@ -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() {
|
||||||
|
if (!tablet) {
|
||||||
moveDialog(Gravity.CENTER);
|
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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user