MainActivity: Dispatch insets to all fragments

Fixes tunnel list fragment rendering behind statusbar when other fragments are showing

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-03-09 10:32:48 +05:30
parent 0db2578ca0
commit e8c9c20570

View File

@ -79,7 +79,9 @@ public class MainActivity extends BaseActivity
final FragmentManager fragmentManager = getSupportFragmentManager(); final FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.addOnBackStackChangedListener(() -> { fragmentManager.addOnBackStackChangedListener(() -> {
final List<Fragment> fragments = fragmentManager.getFragments(); final List<Fragment> fragments = fragmentManager.getFragments();
fragments.get(fragments.size() - 1).requireView().dispatchApplyWindowInsets(insets); for (int i = 0; i < fragments.size(); i++) {
fragments.get(i).requireView().dispatchApplyWindowInsets(insets);
}
}); });
return insets; return insets;
}); });