mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 14:31:30 +01:00
add an option to search the web from the app list
This commit is contained in:
parent
2d53562d58
commit
9216837879
5 changed files with 18 additions and 1 deletions
|
@ -62,6 +62,7 @@ import eu.jonahbauer.android.preference.annotations.Preferences;
|
||||||
}),
|
}),
|
||||||
@PreferenceGroup(name = "functionality", prefix = "settings_functionality_", suffix = "_key", value = {
|
@PreferenceGroup(name = "functionality", prefix = "settings_functionality_", suffix = "_key", value = {
|
||||||
@Preference(name = "search_auto_launch", type = boolean.class, defaultValue = "true"),
|
@Preference(name = "search_auto_launch", type = boolean.class, defaultValue = "true"),
|
||||||
|
@Preference(name = "search_web", type = boolean.class, description = "false"),
|
||||||
@Preference(name = "search_auto_open_keyboard", type = boolean.class, defaultValue = "true"),
|
@Preference(name = "search_auto_open_keyboard", type = boolean.class, defaultValue = "true"),
|
||||||
}),
|
}),
|
||||||
@PreferenceGroup(name = "enabled_gestures", prefix = "settings_enabled_gestures_", suffix = "_key", value = {
|
@PreferenceGroup(name = "enabled_gestures", prefix = "settings_enabled_gestures_", suffix = "_key", value = {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package de.jrpie.android.launcher.ui.list.apps
|
package de.jrpie.android.launcher.ui.list.apps
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -86,7 +87,13 @@ class ListFragmentApps : Fragment(), UIObject {
|
||||||
|
|
||||||
override fun onQueryTextSubmit(query: String): Boolean {
|
override fun onQueryTextSubmit(query: String): Boolean {
|
||||||
appsRViewAdapter.setSearchString(query)
|
appsRViewAdapter.setSearchString(query)
|
||||||
appsRViewAdapter.selectItem(0)
|
|
||||||
|
if (LauncherPreferences.functionality().searchWeb()) {
|
||||||
|
val i = Intent(Intent.ACTION_WEB_SEARCH).putExtra("query", query)
|
||||||
|
activity?.startActivity(i)
|
||||||
|
} else {
|
||||||
|
appsRViewAdapter.selectItem(0)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
<string name="settings_enabled_gestures_edge_swipe_key" translatable="false">enabled_gestures.edge_actions</string>
|
<string name="settings_enabled_gestures_edge_swipe_key" translatable="false">enabled_gestures.edge_actions</string>
|
||||||
<string name="settings_enabled_gestures_edge_swipe_edge_width_key" translatable="false">enabled_gestures.edge_actions.edge_width</string>
|
<string name="settings_enabled_gestures_edge_swipe_edge_width_key" translatable="false">enabled_gestures.edge_actions.edge_width</string>
|
||||||
<string name="settings_functionality_search_auto_launch_key" translatable="false">functionality.search_auto_launch</string>
|
<string name="settings_functionality_search_auto_launch_key" translatable="false">functionality.search_auto_launch</string>
|
||||||
|
<string name="settings_functionality_search_web_key" translatable="false">functionality.search_web</string>
|
||||||
<string name="settings_functionality_search_auto_open_keyboard_key" translatable="false">functionality.search_auto_keyboard</string>
|
<string name="settings_functionality_search_auto_open_keyboard_key" translatable="false">functionality.search_auto_keyboard</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,8 @@
|
||||||
<string name="settings_enabled_gestures_edge_swipe_summary">Swipe at the edge of the screen</string>
|
<string name="settings_enabled_gestures_edge_swipe_summary">Swipe at the edge of the screen</string>
|
||||||
<string name="settings_enabled_gestures_edge_swipe_edge_width">Edge width</string>
|
<string name="settings_enabled_gestures_edge_swipe_edge_width">Edge width</string>
|
||||||
<string name="settings_functionality_auto_launch">Launch search results</string>
|
<string name="settings_functionality_auto_launch">Launch search results</string>
|
||||||
|
<string name="settings_functionality_search_web">Search the web</string>
|
||||||
|
<string name="settings_functionality_search_web_summary">Press return while searching the app list to launch a web search.</string>
|
||||||
<string name="settings_functionality_auto_keyboard">Start keyboard for search</string>
|
<string name="settings_functionality_auto_keyboard">Start keyboard for search</string>
|
||||||
|
|
||||||
<string name="settings_launcher_sensitivity">Sensitivity</string>
|
<string name="settings_launcher_sensitivity">Sensitivity</string>
|
||||||
|
|
|
@ -93,6 +93,12 @@
|
||||||
android:key="@string/settings_functionality_search_auto_launch_key"
|
android:key="@string/settings_functionality_search_auto_launch_key"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:title="@string/settings_functionality_auto_launch" />
|
android:title="@string/settings_functionality_auto_launch" />
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="@string/settings_functionality_search_web_key"
|
||||||
|
android:title="@string/settings_functionality_search_web"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:summary="@string/settings_functionality_search_web_summary"
|
||||||
|
/>
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="@string/settings_functionality_search_auto_open_keyboard_key"
|
android:key="@string/settings_functionality_search_auto_open_keyboard_key"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
|
|
Loading…
Add table
Reference in a new issue