From ea0b1a76651b862acb119bd7d4a4f2c3baaa5d8c Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 21 Jan 2024 20:34:47 +0900 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=9B=9E=E8=B5=B7=E5=8B=95=E3=81=AE?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AB=E5=88=9D=E6=9C=9F=E5=8C=96=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=81=A8=E3=81=97=E3=81=A6=E3=83=87=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AB=E3=83=88=E5=80=A4=E3=82=92=E6=9B=B8=E3=81=8D=E8=BE=BC?= =?UTF-8?q?=E3=82=80=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/one/nem/lacerta/MainActivity.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index 349e87c1..9511079a 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -40,6 +40,10 @@ public class MainActivity extends AppCompatActivity { BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); + if (sharedPrefUtils.getIsFirstLaunch()) { + initializeApp(); + } + // Init navigation try { FragmentManager supportFragmentManager = getSupportFragmentManager(); @@ -67,6 +71,15 @@ public class MainActivity extends AppCompatActivity { getWindow().setStatusBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurface)); } + private void initializeApp() { + // Set feature switch override to default value + sharedPrefUtils.setFeatureSwitchOverride(FeatureSwitchOverride.ENABLE_SEARCH, FeatureSwitch.FeatureMaster.enableSearch); + sharedPrefUtils.setFeatureSwitchOverride(FeatureSwitchOverride.ENABLE_DEBUG_MENU, FeatureSwitch.FeatureMaster.enableDebugMenu); + + // Set isFirstLaunch to false + sharedPrefUtils.setIsFirstLaunch(false); + } + private void applyFeatureSwitch(BottomNavigationView bottomNavigationView, FeatureSwitchOverride featureSwitchOverride, boolean defaultValue, int menuId) { boolean isEnabled = FeatureSwitch.Meta.canOverrideSwitch ? sharedPrefUtils.getFeatureSwitchOverride(featureSwitchOverride) : defaultValue; if (!isEnabled) bottomNavigationView.getMenu().removeItem(menuId);