Fixed
Status Update
Comments
al...@android.com <al...@android.com>
ch...@google.com <ch...@google.com>
al...@android.com <al...@android.com> #2
what Application are you trying to reproduce the issue. I tried rotating the device for couple of times, Issue not seen. Also provide Device you are using to reproduce the issue
Description
Version used: 23.4.0
Devices/Android versions reproduced on: Emulator with API 23 image
Setting setFitsSystemWindows in xml works:
XmlDeclaredActivity with following layout (of course not useful, but a quick sample):
```
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@android:color/holo_orange_dark"
android:fitsSystemWindows="true"
android:scaleType="center"
android:src="@android:drawable/sym_def_app_icon" />
</android.support.design.widget.CoordinatorLayout>
```
works as expected (see screenshot).
ProgrammaticallyActivity
```
public class ProgrammaticallyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_programmatically);
findViewById(R.id.coordinator_layout).setFitsSystemWindows(true);
}
}
```
layout activity_programmatically idential to the above, except for no
```
android:fitsSystemWindows="true"
```
at the CoordinatorLayout does not (see screenshot).
I understand the problem to be that window insets setup happens only in the constructor, in
```
if (INSETS_HELPER != null) {
INSETS_HELPER.setupForWindowInsets(this, new ApplyInsetsListener());
}
```
Calls to setFitsSystemWindows do not perform the setup, if needed.
I haven't found a good way to patch this.