From 78cfa32a83332be7c4b6c3f6805306bb32b0b144 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sat, 15 May 2021 06:51:33 +0900 Subject: [PATCH] Fix navigating away from post view causing app resize --- .../awais/instagrabber/fragments/PostViewV2Fragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index 65315e35..f3dd3cc8 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -18,6 +18,7 @@ import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.Window; import android.widget.Toast; import androidx.annotation.NonNull; @@ -29,6 +30,7 @@ import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.Toolbar; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.PermissionChecker; +import androidx.core.view.WindowCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.LiveData; @@ -1427,8 +1429,10 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme if (toolbar != null) { toolbar.setVisibility(View.VISIBLE); } - final View decorView = activity.getWindow().getDecorView(); + final Window window = activity.getWindow(); + final View decorView = window.getDecorView(); decorView.setSystemUiVisibility(originalSystemUi); + WindowCompat.setDecorFitsSystemWindows(window, false); isInFullScreenMode = false; }