diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index d5fdc97e0..088707b6e 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,3 +1,5 @@
+### Please do **not** open pull requests for *new features* now, as we are planning to rewrite large chunks of the code. Only bugfix PRs will be accepted. More details will be announced soon!
+
NewPipe contribution guidelines
===============================
diff --git a/README.md b/README.md
index 52e6eef1a..f184b5360 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+### Please do **not** open pull requests for *new features* now, as we are planning to rewrite large chunks of the code. Only bugfix PRs will be accepted. More details will be announced soon!
+
NewPipe
A libre lightweight streaming front-end for Android.
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
index e6c7f8f38..d8b2b43a5 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
@@ -2007,7 +2007,10 @@ public final class VideoDetailFragment
restoreDefaultBrightness();
} else {
// Do not restore if user has disabled brightness gesture
- if (!PlayerHelper.isBrightnessGestureEnabled(activity)) {
+ if (!PlayerHelper.getActionForRightGestureSide(activity)
+ .equals(getString(R.string.brightness_control_key))
+ && !PlayerHelper.getActionForLeftGestureSide(activity)
+ .equals(getString(R.string.brightness_control_key))) {
return;
}
// Restore already saved brightness level
diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt
index a6dba0dd5..0d28f2f58 100644
--- a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt
+++ b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt
@@ -193,18 +193,20 @@ class MainPlayerGestureListener(
isMoving = true
// -- Brightness and Volume control --
- val isBrightnessGestureEnabled = PlayerHelper.isBrightnessGestureEnabled(player.context)
- val isVolumeGestureEnabled = PlayerHelper.isVolumeGestureEnabled(player.context)
- if (isBrightnessGestureEnabled && isVolumeGestureEnabled) {
- if (getDisplayHalfPortion(initialEvent) === DisplayPortion.LEFT_HALF) {
- onScrollBrightness(distanceY)
- } else /* DisplayPortion.RIGHT_HALF */ {
- onScrollVolume(distanceY)
+ if (getDisplayHalfPortion(initialEvent) == DisplayPortion.RIGHT_HALF) {
+ when (PlayerHelper.getActionForRightGestureSide(player.context)) {
+ player.context.getString(R.string.volume_control_key) ->
+ onScrollVolume(distanceY)
+ player.context.getString(R.string.brightness_control_key) ->
+ onScrollBrightness(distanceY)
+ }
+ } else {
+ when (PlayerHelper.getActionForLeftGestureSide(player.context)) {
+ player.context.getString(R.string.volume_control_key) ->
+ onScrollVolume(distanceY)
+ player.context.getString(R.string.brightness_control_key) ->
+ onScrollBrightness(distanceY)
}
- } else if (isBrightnessGestureEnabled) {
- onScrollBrightness(distanceY)
- } else if (isVolumeGestureEnabled) {
- onScrollVolume(distanceY)
}
return true
diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
index 1bc6f41a1..a110a80d6 100644
--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
@@ -228,14 +228,16 @@ public final class PlayerHelper {
.getBoolean(context.getString(R.string.resume_on_audio_focus_gain_key), false);
}
- public static boolean isVolumeGestureEnabled(@NonNull final Context context) {
+ public static String getActionForRightGestureSide(@NonNull final Context context) {
return getPreferences(context)
- .getBoolean(context.getString(R.string.volume_gesture_control_key), true);
+ .getString(context.getString(R.string.right_gesture_control_key),
+ context.getString(R.string.default_right_gesture_control_value));
}
- public static boolean isBrightnessGestureEnabled(@NonNull final Context context) {
+ public static String getActionForLeftGestureSide(@NonNull final Context context) {
return getPreferences(context)
- .getBoolean(context.getString(R.string.brightness_gesture_control_key), true);
+ .getString(context.getString(R.string.left_gesture_control_key),
+ context.getString(R.string.default_left_gesture_control_value));
}
public static boolean isStartMainPlayerFullscreenEnabled(@NonNull final Context context) {
diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingMigrations.java b/app/src/main/java/org/schabi/newpipe/settings/SettingMigrations.java
index b1e2c04eb..1bfaec6c2 100644
--- a/app/src/main/java/org/schabi/newpipe/settings/SettingMigrations.java
+++ b/app/src/main/java/org/schabi/newpipe/settings/SettingMigrations.java
@@ -108,6 +108,25 @@ public final class SettingMigrations {
}
};
+ public static final Migration MIGRATION_4_5 = new Migration(4, 5) {
+ @Override
+ protected void migrate(final Context context) {
+ final boolean brightness = sp.getBoolean("brightness_gesture_control", true);
+ final boolean volume = sp.getBoolean("volume_gesture_control", true);
+
+ final SharedPreferences.Editor editor = sp.edit();
+
+ editor.putString(context.getString(R.string.right_gesture_control_key),
+ context.getString(volume
+ ? R.string.volume_control_key : R.string.none_control_key));
+ editor.putString(context.getString(R.string.left_gesture_control_key),
+ context.getString(brightness
+ ? R.string.brightness_control_key : R.string.none_control_key));
+
+ editor.apply();
+ }
+ };
+
/**
* List of all implemented migrations.
*
@@ -119,12 +138,13 @@ public final class SettingMigrations {
MIGRATION_1_2,
MIGRATION_2_3,
MIGRATION_3_4,
+ MIGRATION_4_5,
};
/**
* Version number for preferences. Must be incremented every time a migration is necessary.
*/
- public static final int VERSION = 4;
+ public static final int VERSION = 5;
public static void initMigrations(final Context context, final boolean isFirstRun) {
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index 36dcf2b33..5847878a0 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -16,8 +16,6 @@
use_external_video_player
use_external_audio_player
- volume_gesture_control
- brightness_gesture_control
resume_on_audio_focus_gain
popup_remember_size_pos_key
use_inexact_seek_key
@@ -192,6 +190,35 @@
- @string/audio_webm_key
+ left_gesture_control
+ @string/brightness_control_key
+ brightness_control
+ volume_control
+ none_control
+
+ - @string/brightness
+ - @string/volume
+ - @string/none
+
+
+ - @string/brightness_control_key
+ - @string/volume_control_key
+ - @string/none_control_key
+
+
+ right_gesture_control
+ @string/volume_control_key
+
+ - @string/volume
+ - @string/brightness
+ - @string/none
+
+
+ - @string/volume_control_key
+ - @string/brightness_control_key
+ - @string/none_control_key
+
+
prefer_original_audio
prefer_descriptive_audio
last_resize_mode
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 69b2a112e..88f6b2b66 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -105,10 +105,13 @@
Auto-enqueue next stream
Continue ending (non-repeating) playback queue by appending a related stream
Auto-enqueuing
- Volume gesture control
- Use gestures to control player volume
- Brightness gesture control
- Use gestures to control player brightness
+ Choose gesture for left half of player screen
+ Left gesture action
+ Choose gesture for right half of player screen
+ Right gesture action
+ Brightness
+ Volume
+ None
Search suggestions
Choose the suggestions to show when searching
Local search suggestions
diff --git a/app/src/main/res/xml/video_audio_settings.xml b/app/src/main/res/xml/video_audio_settings.xml
index a0f82273c..f433eb7f5 100644
--- a/app/src/main/res/xml/video_audio_settings.xml
+++ b/app/src/main/res/xml/video_audio_settings.xml
@@ -190,19 +190,23 @@
app:singleLineTitle="false"
app:iconSpaceReserved="false" />
-
-
diff --git a/fastlane/metadata/android/cs/changelogs/993.txt b/fastlane/metadata/android/cs/changelogs/993.txt
index 3df0fe64b..2d57d44a1 100644
--- a/fastlane/metadata/android/cs/changelogs/993.txt
+++ b/fastlane/metadata/android/cs/changelogs/993.txt
@@ -10,4 +10,3 @@ Vylepšeno
Opraveno
• Oprava otevírání URL prohlížeče, stahování a externích přehrávačů v Android 11+
• Oprava interakce s celou obrazovkou v MIUI
-• Úpravy nastavení ExoPlayer pro opravu přehrávání na některých zařízeních
diff --git a/fastlane/metadata/android/en-US/changelogs/993.txt b/fastlane/metadata/android/en-US/changelogs/993.txt
index 5d45efd13..722bc50cf 100644
--- a/fastlane/metadata/android/en-US/changelogs/993.txt
+++ b/fastlane/metadata/android/en-US/changelogs/993.txt
@@ -10,4 +10,3 @@ Improved
Fixed
• Fix opening browser URLs, downloads and external players on Android 11+
• Fix interacting with fullscreen requiring two taps on MIUI
-• Allow tweaking ExoPlayer settings to fix playback on some devices
\ No newline at end of file
diff --git a/fastlane/metadata/android/es/changelogs/993.txt b/fastlane/metadata/android/es/changelogs/993.txt
index 66c147a42..f951484e0 100644
--- a/fastlane/metadata/android/es/changelogs/993.txt
+++ b/fastlane/metadata/android/es/changelogs/993.txt
@@ -10,4 +10,3 @@ Mejorado
Solucionado
• Abrir URL del navegador, descargas y reproductores externos en Android 11+
• Interación en pantalla completa, requería dos toques en MIUI
-• Cambiar la configuración de ExoPlayer para la reproducción en algunos dispositivos
diff --git a/fastlane/metadata/android/hi/changelogs/993.txt b/fastlane/metadata/android/hi/changelogs/993.txt
deleted file mode 100644
index e3aa57e5f..000000000
--- a/fastlane/metadata/android/hi/changelogs/993.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-New
-• Add warning when adding playlist duplicates and add button to remove them
-• Allow ignoring hardware buttons
-• Allow hiding partially watched videos in feed
-
-Improved
-• Use more grid columns on big screens
-• Make progress indicators consistent with settings
-
-Fixed
-• Fix opening browser URLs, downloads and external players on Android 11+
-• Fix interacting with fullscreen requiring two taps on MIUI
-• Allow tweaking ExoPlayer settings to fix playback on some devices
diff --git a/fastlane/metadata/android/it/changelogs/993.txt b/fastlane/metadata/android/it/changelogs/993.txt
index b7098fd24..ecaf530d2 100644
--- a/fastlane/metadata/android/it/changelogs/993.txt
+++ b/fastlane/metadata/android/it/changelogs/993.txt
@@ -10,4 +10,3 @@ Migliorato
Corretto
• Fix apertura URL, download e player esterni su Android 11+
• Fix interazione con schermo intero che richiedeva due otcchi su MIUI
-• Regola le impostazioni di ExoPlayer per correggere la riproduzione su alcuni dispositivi
diff --git a/fastlane/metadata/android/pa/changelogs/993.txt b/fastlane/metadata/android/pa/changelogs/993.txt
index 6fad07e20..e83950724 100644
--- a/fastlane/metadata/android/pa/changelogs/993.txt
+++ b/fastlane/metadata/android/pa/changelogs/993.txt
@@ -10,4 +10,3 @@
ਠੀਕ ਕੀਤੇ
• Android 11 'ਤੇ ਖੋਲ੍ਹਣ ਵਾਲੇ ਬ੍ਰਾਊਜ਼ਰ URL, ਡਾਊਨਲੋਡ ਅਤੇ ਬਾਹਰੀ ਪਲੇਅਰ ਨੂੰ ਠੀਕ ਕਰੋ
• MIUI 'ਤੇ ਦੋ ਟੈਪਾਂ ਦੀ ਲੋੜ ਵਾਲੀ ਪੂਰੀ ਸਕ੍ਰੀਨ ਨਾਲ ਇੰਟਰੈਕਟਿੰਗ ਨੂੰ ਠੀਕ ਕਰੋ
-• ਕੁਝ ਡਿਵਾਈਸਾਂ 'ਤੇ ਪਲੇਬੈਕ ਨੂੰ ਠੀਕ ਕਰਨ ਲਈ ExoPlayer ਸੈਟਿੰਗਾਂ ਨੂੰ ਟਵੀਕ ਕਰਨ ਦਿਓ
diff --git a/fastlane/metadata/android/pl/changelogs/993.txt b/fastlane/metadata/android/pl/changelogs/993.txt
index 38cd01325..a24d4077e 100644
--- a/fastlane/metadata/android/pl/changelogs/993.txt
+++ b/fastlane/metadata/android/pl/changelogs/993.txt
@@ -10,4 +10,3 @@ Ulepszone
Naprawione
• Otwier. URL-i przeglądarki, pobranych i zew. odtwarzaczy na Androidzie 11+
• Interakcja z trybem pełnoekr. wymagającym dwóch naciśnięć na MIUI
-• Dostosow. ustawień ExoPlayera, aby naprawić odtwarzanie na niektórych urządz.
diff --git a/fastlane/metadata/android/pt-PT/changelogs/993.txt b/fastlane/metadata/android/pt-PT/changelogs/993.txt
index 7f06f8081..80c7b25f5 100644
--- a/fastlane/metadata/android/pt-PT/changelogs/993.txt
+++ b/fastlane/metadata/android/pt-PT/changelogs/993.txt
@@ -10,4 +10,3 @@ Melhorado
Fixa
- Corrigir URLs de abertura do navegador, downloads e leitores externos no Android 11+
- Fixação interagindo com tela cheia requer duas torneiras no MIUI
-- Permitir ajustes no ExoPlayer para fixar a reprodução em alguns dispositivos
diff --git a/fastlane/metadata/android/pt/changelogs/993.txt b/fastlane/metadata/android/pt/changelogs/993.txt
index 7f06f8081..80c7b25f5 100644
--- a/fastlane/metadata/android/pt/changelogs/993.txt
+++ b/fastlane/metadata/android/pt/changelogs/993.txt
@@ -10,4 +10,3 @@ Melhorado
Fixa
- Corrigir URLs de abertura do navegador, downloads e leitores externos no Android 11+
- Fixação interagindo com tela cheia requer duas torneiras no MIUI
-- Permitir ajustes no ExoPlayer para fixar a reprodução em alguns dispositivos
diff --git a/fastlane/metadata/android/ru/changelogs/993.txt b/fastlane/metadata/android/ru/changelogs/993.txt
index ea26a1aff..dc0f2f638 100644
--- a/fastlane/metadata/android/ru/changelogs/993.txt
+++ b/fastlane/metadata/android/ru/changelogs/993.txt
@@ -10,4 +10,3 @@
Исправления
• Исправлено открытие URL-адресов браузера, загрузок и внешних проигрывателей на Android 11+
• Исправлено взаимодействие с полноэкранным режимом, требующее двух нажатий в MIUI
-• Разрешить изменять настройки ExoPlayer, чтобы исправить воспроизведение на некоторых устройствах
diff --git a/fastlane/metadata/android/uk/changelogs/993.txt b/fastlane/metadata/android/uk/changelogs/993.txt
index 1ce103bca..7b540cda2 100644
--- a/fastlane/metadata/android/uk/changelogs/993.txt
+++ b/fastlane/metadata/android/uk/changelogs/993.txt
@@ -10,4 +10,3 @@
Виправлено
• Відкриття URL-адрес браузера, завантажень і зовнішніх програвачів на Android 11+
• Роботу повноекранного режиму, який вимагав двох дотиків у MIUI
-• Дозвіл змінювати налаштування ExoPlayer, щоб виправити відтворення на деяких пристроях
diff --git a/fastlane/metadata/android/zh-Hant/changelogs/993.txt b/fastlane/metadata/android/zh-Hant/changelogs/993.txt
index edb1f70fe..0a095cff9 100644
--- a/fastlane/metadata/android/zh-Hant/changelogs/993.txt
+++ b/fastlane/metadata/android/zh-Hant/changelogs/993.txt
@@ -10,4 +10,3 @@
修正
• 修正 Android 11+ 上開啟瀏覽器 URL、下載與外部播放器
• 修正 MIUI 上全螢幕操作需要輕觸兩下
-• 允許微調 ExoPlayer 設定以修正部分裝置上的播放問題
diff --git a/fastlane/metadata/android/zh_Hant_HK/changelogs/993.txt b/fastlane/metadata/android/zh_Hant_HK/changelogs/993.txt
index 754da7342..76e24fb31 100644
--- a/fastlane/metadata/android/zh_Hant_HK/changelogs/993.txt
+++ b/fastlane/metadata/android/zh_Hant_HK/changelogs/993.txt
@@ -10,4 +10,3 @@
執漏
• 修正 Android 11+ 開啟瀏覽器 URL、下載同外面播放器
• 修正 MIUI 全螢幕時要撳兩下至搞得掂
-• 有得調校 ExoPlayer 設定解決某啲機播唔到片嘅問題