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);