Skip to main content

Guide to handling window resize caused by IME behavior

When IME is shown, Android Framework resizes the view by the IME (Input Method Editor) insets area as a default behavior.
This is not a Pleos Connect platform policy. It is default AOSP behavior.
This document presents criteria and configuration methods by app type to decide whether window resize should be allowed or excluded.

Pleos Connect Specification

Screen behavior specification for Pleos Connect when IME is shown.

CategorySpecification
Window that includes EditText or TextFieldWhen IME is shown, it is expected behavior that the view is pushed upward by IME.
Window without EditText or TextFieldWhen IME is shown, the view should not be anchored by IME. Refer to the guide below and update each app as needed.

Guide to Excluding IME Insets Effects

When showing a dialog, if you limit fit insets types to statusBars and navigationBars, the dialog is not affected by IME insets.

System Dialog

val params = WindowManager.LayoutParams(...)
val typesToFit = WindowInsets.Type.statusBars() or WindowInsets.Type.navigationBars()
params.setFitInsetsTypes(typesToFit)
windowManager.addView(overlay, params)

App Dialog

val dialog = Dialog(this)
val window = dialog.window
window?.let { win ->
val params = win.attributes
val typesToFit = WindowInsets.Type.statusBars() or WindowInsets.Type.navigationBars()
params.setFitInsetsTypes(typesToFit)
window.attributes = params
}
dialog.setContentView(R.layout...)
dialog.show()

Applying WindowInsetsListener

If view updates are required for insets other than IME (SystemBars), handle them individually in WindowInsetsListener.

Activity Type Handling

For Activity type windows, review handling separately according to the Google guide below.
Handle input method visibility