Rename showSearchBar setting for consistency

This commit is contained in:
Ensar Sarajčić 2023-07-18 08:33:56 +02:00
parent dffca7823c
commit fe1e59297d
5 changed files with 10 additions and 10 deletions

View File

@ -107,11 +107,11 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupDrawerSearchBar() {
val useSearchBar = config.useSearchBar
settings_show_search.isChecked = useSearchBar
val showSearchBar = config.showSearchBar
settings_show_search_bar.isChecked = showSearchBar
settings_drawer_search_holder.setOnClickListener {
settings_show_search.toggle()
config.useSearchBar = settings_show_search.isChecked
settings_show_search_bar.toggle()
config.showSearchBar = settings_show_search_bar.isChecked
}
}

View File

@ -175,7 +175,7 @@ class AllAppsFragment(context: Context, attributeSet: AttributeSet) : MyFragment
background = ColorDrawable(context.getProperBackgroundColor())
(all_apps_grid.adapter as? LaunchersAdapter)?.updateTextColor(context.getProperTextColor())
search_bar.beVisibleIf(context.config.useSearchBar)
search_bar.beVisibleIf(context.config.showSearchBar)
search_bar.getToolbar()?.beGone()
search_bar.updateColors()
search_bar.setupMenu()

View File

@ -17,7 +17,7 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getInt(DRAWER_COLUMN_COUNT, context.resources.getInteger(R.integer.portrait_column_count))
set(drawerColumnCount) = prefs.edit().putInt(DRAWER_COLUMN_COUNT, drawerColumnCount).apply()
var useSearchBar: Boolean
get() = prefs.getBoolean(USE_SEARCH_BAR, true)
set(searchBarEnabled) = prefs.edit().putBoolean(USE_SEARCH_BAR, searchBarEnabled).apply()
var showSearchBar: Boolean
get() = prefs.getBoolean(SHOW_SEARCH_BAR, true)
set(showSearchBar) = prefs.edit().putBoolean(SHOW_SEARCH_BAR, showSearchBar).apply()
}

View File

@ -6,7 +6,7 @@ const val WIDGET_LIST_ITEMS_HOLDER = 1
// shared prefs
const val WAS_HOME_SCREEN_INIT = "was_home_screen_init"
const val DRAWER_COLUMN_COUNT = "drawer_column_count"
const val USE_SEARCH_BAR = "use_search_bar"
const val SHOW_SEARCH_BAR = "show_search_bar"
// default home screen grid size
const val ROW_COUNT = 6

View File

@ -179,7 +179,7 @@
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_show_search"
android:id="@+id/settings_show_search_bar"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"