diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt
index 1d61562..0456c9f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt
@@ -177,7 +177,7 @@ class MainActivity : SimpleActivity(), FlingListener {
override fun onTopResumedActivityChanged(isTopResumedActivity: Boolean) {
super.onTopResumedActivityChanged(isTopResumedActivity)
- if (!isTopResumedActivity) {
+ if (!isTopResumedActivity && config.alwaysNavigateToHomeScreen) {
Handler(mainLooper).postDelayed({
hideFragment(all_apps_fragment)
hideFragment(widgets_fragment)
diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/SettingsActivity.kt
index b42fe3b..4f6649a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/SettingsActivity.kt
@@ -35,6 +35,7 @@ class SettingsActivity : SimpleActivity() {
setupPurchaseThankYou()
setupCustomizeColors()
setupUseEnglish()
+ setupAlwaysNavigateToHomeScreen()
setupDrawerColumnCount()
setupDrawerSearchBar()
setupLanguage()
@@ -87,6 +88,14 @@ class SettingsActivity : SimpleActivity() {
}
}
+ private fun setupAlwaysNavigateToHomeScreen() {
+ settings_navigate_to_home_grid_on_home.isChecked = config.alwaysNavigateToHomeScreen
+ settings_navigate_to_home_grid_on_home_holder.setOnClickListener {
+ settings_navigate_to_home_grid_on_home.toggle()
+ config.alwaysNavigateToHomeScreen = settings_navigate_to_home_grid_on_home.isChecked
+ }
+ }
+
private fun setupDrawerColumnCount() {
val currentColumnCount = config.drawerColumnCount
settings_drawer_column_count.text = currentColumnCount.toString()
diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Config.kt
index 637394a..bc55404 100644
--- a/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Config.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Config.kt
@@ -20,4 +20,8 @@ class Config(context: Context) : BaseConfig(context) {
var showSearchBar: Boolean
get() = prefs.getBoolean(SHOW_SEARCH_BAR, true)
set(showSearchBar) = prefs.edit().putBoolean(SHOW_SEARCH_BAR, showSearchBar).apply()
+
+ var alwaysNavigateToHomeScreen: Boolean
+ get() = prefs.getBoolean(ALWAYS_NAVIGATE_TO_HOME_SCREEN, true)
+ set(alwaysNavigateToHomeScreen) = prefs.edit().putBoolean(ALWAYS_NAVIGATE_TO_HOME_SCREEN, alwaysNavigateToHomeScreen).apply()
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Constants.kt
index f543854..d94e6e5 100644
--- a/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/launcher/helpers/Constants.kt
@@ -7,6 +7,7 @@ const val WIDGET_LIST_ITEMS_HOLDER = 1
const val WAS_HOME_SCREEN_INIT = "was_home_screen_init"
const val DRAWER_COLUMN_COUNT = "drawer_column_count"
const val SHOW_SEARCH_BAR = "show_search_bar"
+const val ALWAYS_NAVIGATE_TO_HOME_SCREEN = "always_navigate_to_home_screen"
// default home screen grid size
const val ROW_COUNT = 6
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index 88073cf..a47f5e8 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -136,6 +136,21 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
index bc085c1..2ced7a2 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -12,8 +12,9 @@
اﻷيقونات المخفية
لا يمكن إلغاء تثبيت بعض التطبيقات بسبب قيود النظام، ولكن يمكن إخفاء أيقوناتها لتجنب ظهورها.
درج التطبيق
+ Always navigate to home screen on home button
-
\ No newline at end of file
+
diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml
index d74b98e..eb5c471 100644
--- a/app/src/main/res/values-bg/strings.xml
+++ b/app/src/main/res/values-bg/strings.xml
@@ -12,6 +12,7 @@
Скрити икони
Някои приложения не могат да бъдат деинсталирани поради системни ограничения, но можете поне да скриете иконите им, за да не ги виждате.
App drawer
+ Always navigate to home screen on home button