From f76015d714f71bfc270dc6de74cb53767265678d Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Thu, 18 Apr 2019 16:00:54 +0200 Subject: [PATCH] Fixed options menus appearing on screens that they shouldn't --- .../java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt | 8 +------- .../topjohnwu/magisk/ui/settings/SettingsFragment.java | 1 + .../topjohnwu/magisk/ui/superuser/SuperuserFragment.kt | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt index 01c203296..11a4d8554 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.kt @@ -1,7 +1,5 @@ package com.topjohnwu.magisk.ui.home -import android.os.Bundle -import android.view.View import com.skoumal.teanity.viewevents.ViewEvent import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.Config @@ -41,13 +39,9 @@ class MagiskFragment : NewMagiskFragment() } } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - setHasOptionsMenu(true) - } - override fun onStart() { super.onStart() + setHasOptionsMenu(true) requireActivity().setTitle(R.string.magisk) } diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java index bfadd491e..47e6ddc7f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java @@ -43,6 +43,7 @@ public class SettingsFragment extends BasePreferenceFragment { @Override public void onStart() { super.onStart(); + setHasOptionsMenu(true); requireActivity().setTitle(R.string.settings); } diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt index 7c197115c..1547fec3e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt @@ -13,6 +13,7 @@ class SuperuserFragment : override fun onStart() { super.onStart() + setHasOptionsMenu(true) requireActivity().setTitle(R.string.superuser) }