Skip to content

Commit

Permalink
Move disable haptic feedback into advanced section
Browse files Browse the repository at this point in the history
Because this applies to more than just the start screen.
  • Loading branch information
markusfisch committed Dec 15, 2024
1 parent 11176f4 commit 3d083f4
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ private void initPreferences() {
} else {
findViewById(R.id.immersive_mode).setVisibility(View.GONE);
}
initPreference(R.id.disable_haptic_feedback,
R.string.disable_haptic_feedback,
PreferencesActivity::getDisableHapticFeedbackOptions,
() -> prefs.disableHapticFeedback(),
(value) -> prefs.setDisableHapticFeedback(value));
initPreference(R.id.open_list_with,
R.string.open_list_with,
PreferencesActivity::getOpenListWithOptions,
Expand Down Expand Up @@ -225,6 +220,11 @@ private void initPreferences() {
},
() -> PieLauncherApp.iconPack.updatePacks(
getPackageManager()));
initPreference(R.id.disable_haptic_feedback,
R.string.disable_haptic_feedback,
PreferencesActivity::getDisableHapticFeedbackOptions,
() -> prefs.disableHapticFeedback(),
(value) -> prefs.setDisableHapticFeedback(value));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
initPreference(R.id.use_light_dialogs,
R.string.use_light_dialogs,
Expand Down Expand Up @@ -421,13 +421,6 @@ private static Map<Integer, Integer> getImmersiveModeOptions() {
return map;
}

private static Map<Boolean, Integer> getDisableHapticFeedbackOptions() {
Map<Boolean, Integer> map = new LinkedHashMap<>();
map.put(Boolean.TRUE, R.string.disable_haptic_feedback_yes);
map.put(Boolean.FALSE, R.string.disable_haptic_feedback_no);
return map;
}

private static Map<Integer, Integer> getOpenListWithOptions() {
Map<Integer, Integer> map = new LinkedHashMap<>();
map.put(Preferences.OPEN_LIST_WITH_TAP,
Expand Down Expand Up @@ -511,6 +504,13 @@ private Map<String, String> getIconPackOptions() {
return map;
}

private static Map<Boolean, Integer> getDisableHapticFeedbackOptions() {
Map<Boolean, Integer> map = new LinkedHashMap<>();
map.put(Boolean.TRUE, R.string.disable_haptic_feedback_yes);
map.put(Boolean.FALSE, R.string.disable_haptic_feedback_no);
return map;
}

private static Map<Boolean, Integer> getUseLightDialogOptions() {
Map<Boolean, Integer> map = new LinkedHashMap<>();
map.put(Boolean.TRUE, R.string.use_light_dialogs_yes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class Preferences {
private static final String BLUR_BACKGROUND = "blur_background";
private static final String DEAD_ZONE = "dead_zone";
private static final String IMMERSIVE_MODE = "immersive_mode_option";
private static final String DISABLE_HAPTIC_FEEDBACK = "disable_haptic_feedback";
private static final String OPEN_LIST_WITH = "open_list_with";
private static final String DISPLAY_KEYBOARD = "display_keyboard";
private static final String DOUBLE_SPACE_LAUNCH = "space_action_double_launch";
Expand All @@ -52,6 +51,7 @@ public class Preferences {
private static final String SHOW_APP_NAMES = "show_app_names";
private static final String ICON_PRESS = "icon_press";
private static final String ICON_PACK = "icon_pack";
private static final String DISABLE_HAPTIC_FEEDBACK = "disable_haptic_feedback";
private static final String USE_LIGHT_DIALOGS = "use_light_dialogs";
private static final String FORCE_RELAUNCH = "force_relaunch";

Expand Down Expand Up @@ -106,8 +106,6 @@ public Preferences(Context context) {
blurBackground);
deadZone = preferences.getInt(DEAD_ZONE, deadZone);
immersiveMode = preferences.getInt(IMMERSIVE_MODE, immersiveMode);
disableHapticFeedback = preferences.getBoolean(DISABLE_HAPTIC_FEEDBACK,
disableHapticFeedback);
openListWith = preferences.getInt(OPEN_LIST_WITH, getOpenListWith());
displayKeyboard = preferences.getBoolean(DISPLAY_KEYBOARD,
displayKeyboard);
Expand All @@ -122,6 +120,8 @@ public Preferences(Context context) {
showAppNames = preferences.getInt(SHOW_APP_NAMES, showAppNames);
iconPress = preferences.getInt(ICON_PRESS, iconPress);
iconPack = preferences.getString(ICON_PACK, iconPack);
disableHapticFeedback = preferences.getBoolean(DISABLE_HAPTIC_FEEDBACK,
disableHapticFeedback);
useLightDialogs = preferences.getBoolean(USE_LIGHT_DIALOGS,
isEReader(context));
forceRelaunch = preferences.getBoolean(FORCE_RELAUNCH, forceRelaunch);
Expand Down Expand Up @@ -207,15 +207,6 @@ public void setImmersiveMode(int immersiveMode) {
put(IMMERSIVE_MODE, immersiveMode).commit();
}

public boolean disableHapticFeedback() {
return disableHapticFeedback;
}

public void setDisableHapticFeedback(boolean disableHapticFeedback) {
this.disableHapticFeedback = disableHapticFeedback;
put(DISABLE_HAPTIC_FEEDBACK, disableHapticFeedback).commit();
}

public int openListWith() {
return openListWith;
}
Expand Down Expand Up @@ -297,6 +288,15 @@ public void setIconPack(String iconPack) {
put(ICON_PACK, iconPack).apply();
}

public boolean disableHapticFeedback() {
return disableHapticFeedback;
}

public void setDisableHapticFeedback(boolean disableHapticFeedback) {
this.disableHapticFeedback = disableHapticFeedback;
put(DISABLE_HAPTIC_FEEDBACK, disableHapticFeedback).commit();
}

public boolean useLightDialogs() {
return useLightDialogs;
}
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@
android:id="@+id/dead_zone"
android:text="@string/dead_zone_both" />
<de.markusfisch.android.pielauncher.widget.PreferenceView
style="@style/PreferenceWithSeparator"
style="@style/Preference"
android:id="@+id/immersive_mode"
android:text="@string/immersive_mode_disabled" />
<de.markusfisch.android.pielauncher.widget.PreferenceView
style="@style/Preference"
android:id="@+id/disable_haptic_feedback"
android:text="@string/disable_haptic_feedback_no" />
<TextView
style="@style/CategoryHeader"
android:text="@string/category_app_drawer" />
Expand Down Expand Up @@ -109,6 +105,10 @@
style="@style/PreferenceWithSeparator"
android:id="@+id/hidden_apps"
android:text="@string/show_hidden_apps" />
<de.markusfisch.android.pielauncher.widget.PreferenceView
style="@style/PreferenceWithSeparator"
android:id="@+id/disable_haptic_feedback"
android:text="@string/disable_haptic_feedback_no" />
<de.markusfisch.android.pielauncher.widget.PreferenceView
style="@style/PreferenceWithSeparator"
android:id="@+id/use_light_dialogs"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Statusleiste ausblenden</string>
<string name="immersive_mode_navigation_bar">Navigationsleiste ausblenden</string>
<string name="immersive_mode_disabled">Status- und Navigationsleiste anzeigen (Standard)</string>
<string name="disable_haptic_feedback">Haptische Rückmeldung</string>
<string name="disable_haptic_feedback_yes">Deaktivieren</string>
<string name="disable_haptic_feedback_no">Systemeinstellungen folgen (Standard)</string>
<string name="category_app_drawer">App Liste</string>
<string name="open_list_with">Öffnet durch</string>
<string name="open_list_with_tap">Tipp auf den Startbildschirm (Standard)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Icon Pack</string>
<string name="icon_pack_default">System (Standard)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">Versteckte Apps</font></big>\nListe der nicht sichtbaren Apps</string>
<string name="disable_haptic_feedback">Haptische Rückmeldung</string>
<string name="disable_haptic_feedback_yes">Deaktivieren</string>
<string name="disable_haptic_feedback_no">Systemeinstellungen folgen (Standard)</string>
<string name="use_light_dialogs">Dialogfarben umkehren</string>
<string name="use_light_dialogs_yes">Ja</string>
<string name="use_light_dialogs_no">Nein (Standard)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Masquer la barre système</string>
<string name="immersive_mode_navigation_bar">Masquer la barre de navigation</string>
<string name="immersive_mode_disabled">Afficher la barre d\'état et de navigation (d\'usine)</string>
<string name="disable_haptic_feedback">Rétroaction haptique</string>
<string name="disable_haptic_feedback_yes">Désactiver</string>
<string name="disable_haptic_feedback_no">Suivre les paramètres du système (d\'usine)</string>
<string name="category_app_drawer">Liste d\'apps</string>
<string name="open_list_with">Ouvert par</string>
<string name="open_list_with_tap">Tapez sur l\'écran d\'accueil (d\'usine)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Pack d\'icônes</string>
<string name="icon_pack_default">Système (d\'usine)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">App cachées</font></big>\nListe des applications cachées</string>
<string name="disable_haptic_feedback">Rétroaction haptique</string>
<string name="disable_haptic_feedback_yes">Désactiver</string>
<string name="disable_haptic_feedback_no">Suivre les paramètres du système (d\'usine)</string>
<string name="use_light_dialogs">Inverser les couleurs du dialogue</string>
<string name="use_light_dialogs_yes">Oui</string>
<string name="use_light_dialogs_no">Non (d\'usine)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Statusbalk verbergen</string>
<string name="immersive_mode_navigation_bar">Verberg navigatiebalk</string>
<string name="immersive_mode_disabled">Status- en navigatiebalk weergeven (standaard)</string>
<string name="disable_haptic_feedback">Haptische feedback</string>
<string name="disable_haptic_feedback_yes">Uitschakelen</string>
<string name="disable_haptic_feedback_no">Systeeminstellingen volgen (standaard)</string>
<string name="category_app_drawer">App-lade</string>
<string name="open_list_with">Openen met</string>
<string name="open_list_with_tap">Tik op startscherm (Standaard)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Pictogrammenpakket</string>
<string name="icon_pack_default">Systeem (standaard)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">Verborgen apps</font></big>\nLijst met verborgen apps</string>
<string name="disable_haptic_feedback">Haptische feedback</string>
<string name="disable_haptic_feedback_yes">Uitschakelen</string>
<string name="disable_haptic_feedback_no">Systeeminstellingen volgen (standaard)</string>
<string name="use_light_dialogs">Dialoogkleuren omkeren</string>
<string name="use_light_dialogs_yes">Ja</string>
<string name="use_light_dialogs_no">Nee (standaard)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Скрыть строку состояния</string>
<string name="immersive_mode_navigation_bar">Скрыть панель навигации</string>
<string name="immersive_mode_disabled">Показывать системную и навигационную панели (Стандартно)</string>
<string name="disable_haptic_feedback">Тактильная обратная связь</string>
<string name="disable_haptic_feedback_yes">Отключить</string>
<string name="disable_haptic_feedback_no">Следуйте системным настройкам (Стандартно)</string>
<string name="category_app_drawer">Список приложений</string>
<string name="open_list_with">Открываться через</string>
<string name="open_list_with_tap">Нажатие на главный экран (Стандартно)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Набор иконок</string>
<string name="icon_pack_default">Системные (Стандартно)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">Скрытые приложения</font></big>\nСписок скрытых приложений</string>
<string name="disable_haptic_feedback">Тактильная обратная связь</string>
<string name="disable_haptic_feedback_yes">Отключить</string>
<string name="disable_haptic_feedback_no">Следуйте системным настройкам (Стандартно)</string>
<string name="use_light_dialogs">Инвертировать цвета диалоговых окон</string>
<string name="use_light_dialogs_yes">Да</string>
<string name="use_light_dialogs_no">Нет (Стандартно)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Dölj statusfältet</string>
<string name="immersive_mode_navigation_bar">Dölj navigeringsfältet</string>
<string name="immersive_mode_disabled">Visa status- och navigeringsfält (standard)</string>
<string name="disable_haptic_feedback">Haptisk feedback</string>
<string name="disable_haptic_feedback_yes">Avaktivera</string>
<string name="disable_haptic_feedback_no">Följ systeminställningarna (standard)</string>
<string name="category_app_drawer">Applåda</string>
<string name="open_list_with">Öppnas med</string>
<string name="open_list_with_tap">Tryck på startskärmen (standard)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Ikonpaket</string>
<string name="icon_pack_default">System (standard)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">Dolda appar</font></big>\nLista med dolda appar</string>
<string name="disable_haptic_feedback">Haptisk feedback</string>
<string name="disable_haptic_feedback_yes">Avaktivera</string>
<string name="disable_haptic_feedback_no">Följ systeminställningarna (standard)</string>
<string name="use_light_dialogs">Invertera dialogrutans färger</string>
<string name="use_light_dialogs_yes">Ja</string>
<string name="use_light_dialogs_no">Nej (standard)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">Приховати рядок стану</string>
<string name="immersive_mode_navigation_bar">Приховати панель навігації</string>
<string name="immersive_mode_disabled">Показати статус і панель навігації (за замовчуванням)</string>
<string name="disable_haptic_feedback">Тактильний зворотний зв\'язок</string>
<string name="disable_haptic_feedback_yes">Вимкнути</string>
<string name="disable_haptic_feedback_no">Дотримуйтесь налаштувань системи (за замовчуванням)</string>
<string name="category_app_drawer">Список додатків</string>
<string name="open_list_with">Відкривається через</string>
<string name="open_list_with_tap">Натисніть на головному екрані (за замовчуванням)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">Пакет іконок</string>
<string name="icon_pack_default">Системний (за замовчуванням)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">Приховані програми</font></big>\nСписок прихованих програм</string>
<string name="disable_haptic_feedback">Тактильний зворотний зв\'язок</string>
<string name="disable_haptic_feedback_yes">Вимкнути</string>
<string name="disable_haptic_feedback_no">Дотримуйтесь налаштувань системи (за замовчуванням)</string>
<string name="use_light_dialogs">Інвертувати кольори діалогів</string>
<string name="use_light_dialogs_yes">Так</string>
<string name="use_light_dialogs_no">Ні (за замовчуванням)</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<string name="immersive_mode_status_bar">隐藏状态栏</string>
<string name="immersive_mode_navigation_bar">隐藏导航栏</string>
<string name="immersive_mode_disabled">显示状态栏和导航栏 (默认)</string>
<string name="disable_haptic_feedback">触觉反馈</string>
<string name="disable_haptic_feedback_yes">禁用</string>
<string name="disable_haptic_feedback_no">遵循系统设置 (默认)</string>
<string name="category_app_drawer">应用程序列表</string>
<string name="open_list_with">通过</string>
<string name="open_list_with_tap">点击主屏幕 (默认)</string>
Expand Down Expand Up @@ -69,6 +66,9 @@
<string name="icon_pack">图标包</string>
<string name="icon_pack_default">系统(默认)</string>
<string name="show_hidden_apps"><big><font color="#ffffff">隐藏的应用程序</font></big>\n隐藏应用程序列表。</string>
<string name="disable_haptic_feedback">触觉反馈</string>
<string name="disable_haptic_feedback_yes">禁用</string>
<string name="disable_haptic_feedback_no">遵循系统设置 (默认)</string>
<string name="use_light_dialogs">反转对话框颜色</string>
<string name="use_light_dialogs_yes">是</string>
<string name="use_light_dialogs_no">没有 (默认)</string>
Expand Down

0 comments on commit 3d083f4

Please sign in to comment.