From 73c6cc4a5ac65d4271239b6209fe970eb85f8647 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Thu, 24 Jun 2021 11:27:36 -0400 Subject: [PATCH] close #1457 --- .../awais/instagrabber/fragments/PostViewV2Fragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index a4f100fd..8948b831 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -187,9 +187,6 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme public void onCreate(@Nullable final Bundle savedInstanceState) { super.onCreate(savedInstanceState); viewModel = new ViewModelProvider(this).get(PostViewV2ViewModel.class); - final MainActivity activity = (MainActivity) getActivity(); - if (activity == null) return; - controller = new WindowInsetsControllerCompat(activity.getWindow(), activity.getRootView()); } @Nullable @@ -199,6 +196,9 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme @Nullable final Bundle savedInstanceState) { binding = DialogPostViewBinding.inflate(inflater, container, false); bottom = LayoutPostViewBottomBinding.bind(binding.getRoot()); + final MainActivity activity = (MainActivity) getActivity(); + if (activity == null) return null; + controller = new WindowInsetsControllerCompat(activity.getWindow(), activity.getRootView()); return binding.getRoot(); }