Android custom keyboard popup keyboard on long press Android custom keyboard popup keyboard on long press android android

Android custom keyboard popup keyboard on long press


You can use PopupWindow class and populate it with custom layout.

View custom = LayoutInflater.from(context)    .inflate(R.layout.your_layout, new FrameLayout(context));PopupWindow popup = new PopupWindow(context);popup.setContentView(custom);

and on long press

//Get x,y based on the touch position//Get width, height based on your layoutif(popup.isShowing()){    popup.update(x, y, width, height);} else {    popup.setWidth(width);    popup.setHeight(height);    popup.showAtLocation(yourKeyboardView, Gravity.NO_GRAVITY, x, y);}

On click in the popup you can dismiss it

popup.dismiss();