From b1a72189f37c5f7e4de41ef36d7dc0481ba9f62a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 31 Oct 2021 11:27:54 +0100 Subject: [PATCH] Pause on focus loss by default --- .../danoeh/antennapod/preferences/PreferenceUpgrader.java | 7 +++++-- app/src/main/res/xml/preferences_playback.xml | 2 +- .../antennapod/core/preferences/UserPreferences.java | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java index 84c738632..af35bbac9 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java @@ -108,9 +108,12 @@ public class PreferenceUpgrader { } } if (oldVersion < 2040000) { - SharedPreferences prefs = context.getSharedPreferences(SwipeActions.PREF_NAME, Context.MODE_PRIVATE); - prefs.edit().putString(SwipeActions.KEY_PREFIX_SWIPEACTIONS + QueueFragment.TAG, + SharedPreferences swipePrefs = context.getSharedPreferences(SwipeActions.PREF_NAME, Context.MODE_PRIVATE); + swipePrefs.edit().putString(SwipeActions.KEY_PREFIX_SWIPEACTIONS + QueueFragment.TAG, SwipeAction.REMOVE_FROM_QUEUE + "," + SwipeAction.REMOVE_FROM_QUEUE).apply(); } + if (oldVersion < 2050000) { + prefs.edit().putBoolean(UserPreferences.PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, true).apply(); + } } } diff --git a/app/src/main/res/xml/preferences_playback.xml b/app/src/main/res/xml/preferences_playback.xml index 2be8492eb..59bdaedcb 100644 --- a/app/src/main/res/xml/preferences_playback.xml +++ b/app/src/main/res/xml/preferences_playback.xml @@ -23,7 +23,7 @@ android:summary="@string/pref_unpauseOnBluetoothReconnect_sum" android:title="@string/pref_unpauseOnBluetoothReconnect_title"/>