From e8c9c2057048eeccb8e3d1c7f0bb3c6df76e9c21 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 9 Mar 2020 10:32:48 +0530 Subject: [PATCH] MainActivity: Dispatch insets to all fragments Fixes tunnel list fragment rendering behind statusbar when other fragments are showing Signed-off-by: Harsh Shandilya --- .../java/com/wireguard/android/activity/MainActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wireguard/android/activity/MainActivity.java b/app/src/main/java/com/wireguard/android/activity/MainActivity.java index 5c9084d0..4c33f000 100644 --- a/app/src/main/java/com/wireguard/android/activity/MainActivity.java +++ b/app/src/main/java/com/wireguard/android/activity/MainActivity.java @@ -79,7 +79,9 @@ public class MainActivity extends BaseActivity final FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.addOnBackStackChangedListener(() -> { final List 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; });