|
@@ -15,6 +15,7 @@ import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field
|
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_search_field_position
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_search_field_position
|
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_show_search_field_switch
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_show_search_field_switch
|
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_open_keyboard_switch
|
|
import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_open_keyboard_switch
|
|
|
|
|
+import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_search_all_switch
|
|
|
|
|
|
|
|
import javax.inject.Inject
|
|
import javax.inject.Inject
|
|
|
|
|
|
|
@@ -42,6 +43,7 @@ class CustomizeSearchFieldFragment : BaseFragment() {
|
|
|
setupShowSearchBarSwitch()
|
|
setupShowSearchBarSwitch()
|
|
|
setupSearchBarPositionOption()
|
|
setupSearchBarPositionOption()
|
|
|
setupKeyboardSwitch()
|
|
setupKeyboardSwitch()
|
|
|
|
|
+ setupSearchAllAppsSwitch()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun setupShowSearchBarSwitch() {
|
|
private fun setupShowSearchBarSwitch() {
|
|
@@ -91,4 +93,19 @@ class CustomizeSearchFieldFragment : BaseFragment() {
|
|
|
R.string.customize_app_drawer_fragment_open_keyboard_subtitle
|
|
R.string.customize_app_drawer_fragment_open_keyboard_subtitle
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private fun setupSearchAllAppsSwitch() {
|
|
|
|
|
+ val prefsRepo = unlauncherDataSource.corePreferencesRepo
|
|
|
|
|
+ customize_app_drawer_search_all_switch.setOnCheckedChangeListener { _, checked ->
|
|
|
|
|
+ prefsRepo.updateSearchAllAppsInDrawer(checked)
|
|
|
|
|
+ }
|
|
|
|
|
+ prefsRepo.liveData().observe(viewLifecycleOwner) {
|
|
|
|
|
+ customize_app_drawer_search_all_switch.isChecked = it.searchAllAppsInDrawer
|
|
|
|
|
+ }
|
|
|
|
|
+ customize_app_drawer_search_all_switch.text =
|
|
|
|
|
+ createTitleAndSubtitleText(
|
|
|
|
|
+ requireContext(), R.string.customize_app_drawer_fragment_search_all,
|
|
|
|
|
+ R.string.customize_app_drawer_fragment_search_all_subtitle
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|