4

Is there a way not to close keyboard, but just show dialog insted of keyboard(over it). After dialog is closed I need to continiue typing without opening keyboard again?

enter image description here

This dialog is simple child of BottomDialogSheet:

public class BottomPage extends BottomSheetDialog {
    public BottomPage(@NonNull Context context) {
        super(context);

        View v = View.inflate(context, R.layout.layout_bottom_sheet, null);
        setContentView(v);
    }
}

I've already got implementation with Popup window that covers the keyboard with other layout, but there is same problem when I first opent popup and after that press the edit text to show keyboard - popup hides, keyboard shows. How can I prevent it, and let keyboard show without popup hiding? enter image description here

shagi
  • 629
  • 8
  • 25

2 Answers2

0

Use the below code to keep the keyboard on the screen.

 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

Play with the arguments of setSoftInputMode() to get some other effects.

-1

You can't do it that simple. You have to get window and keybord height to do that.

Look at this library and make your own: https://github.com/ankushsachdeva/emojicon

Bhuvanesh BS
  • 13,474
  • 12
  • 40
  • 66
  • I've got keyboard height and my implementation works same as in that library. Actually in library same problem with keyboard hiding. I don't know how can I make keyboard don't hide itself and show dialog with keyboard on screen, but covered with dialog or popup – shagi Sep 10 '17 at 13:06
  • get a window object and add your view there it won't affect keyborad – Bhuvanesh BS Sep 10 '17 at 13:17
  • I can't find way to do that without asking user's permission... Is there simplier way to do that? – shagi Sep 10 '17 at 16:13