mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Implement auto launching from search
I implemented it before, but now it can be enabled / disabled in settings.
This commit is contained in:
parent
93fdf19d46
commit
64d4738f9c
5 changed files with 49 additions and 28 deletions
|
@ -111,6 +111,7 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
|
|||
|
||||
setSwitchColor(settings_launcher_switch_screen_timeout, vibrantColor)
|
||||
setSwitchColor(settings_launcher_switch_screen_full, vibrantColor)
|
||||
setSwitchColor(settings_launcher_switch_auto_launch, vibrantColor)
|
||||
setSwitchColor(settings_launcher_switch_enable_double, vibrantColor)
|
||||
|
||||
settings_launcher_container.setBackgroundColor(dominantColor)
|
||||
|
@ -137,7 +138,14 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
|
|||
|
||||
setWindowFlags(activity!!.window)
|
||||
}
|
||||
|
||||
|
||||
settings_launcher_switch_auto_launch.isChecked = launcherPreferences.getBoolean(PREF_SEARCH_AUTO_LAUNCH, false)
|
||||
settings_launcher_switch_auto_launch.setOnCheckedChangeListener { _, isChecked -> // Toggle double actions
|
||||
launcherPreferences.edit()
|
||||
.putBoolean(PREF_SEARCH_AUTO_LAUNCH, isChecked)
|
||||
.apply()
|
||||
}
|
||||
|
||||
settings_launcher_switch_enable_double.isChecked = launcherPreferences.getBoolean(PREF_DOUBLE_ACTIONS_ENABLED, false)
|
||||
settings_launcher_switch_enable_double.setOnCheckedChangeListener { _, isChecked -> // Toggle double actions
|
||||
launcherPreferences.edit()
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_time_format"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/settings_launcher_text_screen_timeout"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
@ -72,9 +70,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_theme"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/settings_launcher_text_screen_timeout"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
@ -134,9 +130,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_disable_timeout"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/settings_launcher_text_time_format" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
@ -148,10 +142,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/settings_launcher_text_screen_timeout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/settings_launcher_text_screen_timeout" />
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -168,9 +159,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_full_screen"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/settings_launcher_text_time_format" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
@ -182,10 +171,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/settings_launcher_text_screen_timeout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/settings_launcher_text_screen_timeout" />
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -215,14 +201,41 @@
|
|||
android:orientation="horizontal"
|
||||
android:paddingLeft="8sp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_launcher_text_auto_launch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_auto_launch"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/settings_launcher_switch_auto_launch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16sp"
|
||||
android:gravity="top"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="8sp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_launcher_text_enable_double"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_launcher_enable_double"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/settings_launcher_text_time_format" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
@ -234,10 +247,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/settings_launcher_text_screen_timeout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/settings_launcher_text_screen_timeout" />
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
<string name="settings_launcher_section_functions">Funktionen</string>
|
||||
|
||||
<string name="settings_launcher_enable_double">Doppelte Wischaktionen</string>
|
||||
<string name="settings_launcher_auto_launch">Suchergebisse launchen</string>
|
||||
|
||||
<!--
|
||||
-
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
<string name="settings_launcher_section_functions">Fonctions</string>
|
||||
|
||||
<string name="settings_launcher_enable_double">Double balayage actions</string>
|
||||
<string name="settings_launcher_auto_launch">Lancer apps par recherche</string>
|
||||
|
||||
<!--
|
||||
-
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
<string name="settings_launcher_section_functions">Functions</string>
|
||||
|
||||
<string name="settings_launcher_enable_double">Double swipe actions</string>
|
||||
<string name="settings_launcher_auto_launch">Launch search results</string>
|
||||
|
||||
<!--
|
||||
-
|
||||
|
|
Loading…
Add table
Reference in a new issue