The first picture is SOFT_INPUT_ADJUST_RESIZE.
The screen does not go up, but the edittext is not visible.
The second picture is for SOFT_INPUT_ADJUST_PAN. The editText is visible, but the screen is cut off and raised.
How do I make the screen not cut and the edittext visible?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_chat);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
layoutParams.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND;
layoutParams.dimAmount = 0.5f;
getWindow().setAttributes(layoutParams);
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int width = (int) (display.getWidth() * 0.85);
int height = (int) (display.getHeight() * 0.85);
getWindow().getAttributes().width = width;
getWindow().getAttributes().height = height;
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);//or resize