willowtreeapps / Hyperion-Android

App Debugging & Inspection Tool for Android
MIT License
1.95k stars 144 forks source link

Two drawer scrolling issues #128

Open tir38 opened 6 years ago

tir38 commented 6 years ago

1. hyperion version number isn't scrolling; other list items are scrolling underneath it [fixed in #130]

  1. scrolling extends under bottom home/back/recent nav bar

device-2018-06-23-141535

screen shot 2018-06-23 at 2 13 39 pm
Kritarie commented 6 years ago

I believe fixing this may also address #99. The issue here being that the drawer layout and friends don't respect window insets at the moment. Unfortunately, it's not as easy as adding android:fitsSystemWindows="true" to the layout, because most ViewGroups will consume the insets which we don't want (this may negatively affect the correctness of the host application). We'll probably need to leverage ViewCompat.setOnApplyWindowInsetsListener here, read the insets, set our own padding, and return them unconsumed.

tir38 commented 6 years ago

I dug into this a bit. Regarding problem 2: the bottom system inset is already consumed by the DecorView before we get access to it in HyperionPluginView:

ViewCompat.setOnApplyWindowInsetsListener(this, new android.support.v4.view.OnApplyWindowInsetsListener() {
    @Override
    public WindowInsetsCompat onApplyWindowInsets(View v, WindowInsetsCompat insets) {
        setPadding(
                insets.getSystemWindowInsetLeft(),
                insets.getSystemWindowInsetTop(),
                insets.getSystemWindowInsetRight(),
                // bottom is already zero
                insets.getSystemWindowInsetBottom());
        return insets;

I couldn't get to the root problem before I had to move on to other things.

I do have a fix for the first problem. I'll put up a PR.