This repo is only intended to showcase a potential bug regarding the combination of CoordinatorLayout, AppBarLayout, and a custom App ToolBar on Nougat devices (and above)
When disabling the standard ActionBar in the app theme via <item name="windowActionBar">false</item>
, the system will not honor the IME settings for
an Activity marked as android:windowSoftInputMode="adjustResize|stateHidden"
when recalling and app from the background (e.g. after home button press)
- After starting the app, bring the EditText to focus on the bottom of the screen and expose the keyboard
- With the keyboard visible, press the Home Button
- Relaunch the app
- See the inset made by the System where the keyboard should be
- Un-comment the lines in styles.xml to hide the windowActionBar and not show a windowTitle
- Optional: uncomment out the Toolbar in activity_main.xml to show the "custom" toolbar
There are 2 files of note in this repo styles.xml and activity_main.xml
The layout for MainActivity is meant to replicate a "container based layout where an app would add its Views to a <FrameLayout>
in order to make it the content of a <DrawerLayout>
This is represented by MainActivity
. This repo has a simple CoordinatorLayout to mimic a UI that should be resized when the keyboard is on-screen
Here we find the toggle for windowActionBar
and windowNoTitle
. We set these to false
and true
, respectively, to turn off the standard ActionBar to replace it with our custom
ToolBar. You can find a representation of that ToolBar in the activity layout as a standard Support ToolBar (which is what we extend).
If the window ActionBar is used, then the bug shows. If the custom one is used (and the window ActionBar turned off), we see the expected behavior.