From 70593c17ee201b6936f6aeb77d172d4b5b4eaeae Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sat, 4 Jul 2020 22:30:58 +0200 Subject: [PATCH] Added preview of the current playback speed and video quality in the VideoOptionsFragment --- .../peertube/fragment/VideoOptionsFragment.java | 17 +++++++++++++++-- app/src/main/res/values-ar/strings.xml | 6 +++--- app/src/main/res/values-bn/strings.xml | 4 ++-- app/src/main/res/values-de/strings.xml | 4 ++-- app/src/main/res/values-es/strings.xml | 4 ++-- app/src/main/res/values-fi/strings.xml | 4 ++-- app/src/main/res/values-fr/strings.xml | 4 ++-- app/src/main/res/values-gd/strings.xml | 4 ++-- app/src/main/res/values-it/strings.xml | 4 ++-- app/src/main/res/values-ja/strings.xml | 4 ++-- app/src/main/res/values-nb-rNO/strings.xml | 4 ++-- app/src/main/res/values-nl/strings.xml | 4 ++-- app/src/main/res/values-pl/strings.xml | 4 ++-- app/src/main/res/values-ru/strings.xml | 4 ++-- app/src/main/res/values-sv/strings.xml | 4 ++-- app/src/main/res/values-tr/strings.xml | 4 ++-- app/src/main/res/values-zh-rCN/strings.xml | 4 ++-- app/src/main/res/values-zh-rTW/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 4 ++-- 19 files changed, 52 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java index 212c2d2..01da654 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java @@ -18,7 +18,9 @@ package net.schueller.peertube.fragment; import android.annotation.SuppressLint; +import android.content.SharedPreferences; import android.os.Bundle; +import android.preference.PreferenceManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -65,7 +67,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment { LinearLayout menuRow = (LinearLayout) inflater.inflate(R.layout.row_popup_menu, null); TextView iconView = menuRow.findViewById(R.id.video_quality_icon); TextView textView = menuRow.findViewById(R.id.video_quality_text); - textView.setText(getString(R.string.menu_video_options_playback_speed)); + textView.setText(String.format(getString(R.string.menu_video_options_playback_speed), videoPlayerService.getPlayBackSpeed())); iconView.setText(R.string.video_option_speed_icon); new Iconics.IconicsBuilder().ctx(getContext()).on(iconView).build(); textView.setOnClickListener(view1 -> { @@ -80,7 +82,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment { LinearLayout menuRow2 = (LinearLayout) inflater.inflate(R.layout.row_popup_menu, null); TextView iconView2 = menuRow2.findViewById(R.id.video_quality_icon); TextView textView2 = menuRow2.findViewById(R.id.video_quality_text); - textView2.setText(getString(R.string.menu_video_options_quality)); + textView2.setText(String.format(getString(R.string.menu_video_options_quality), getCurrentVideoQuality(files))); iconView2.setText(R.string.video_option_quality_icon); new Iconics.IconicsBuilder().ctx(getContext()).on(iconView2).build(); textView2.setOnClickListener(view1 -> { @@ -95,4 +97,15 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment { } + private String getCurrentVideoQuality(ArrayList files) { + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext()); + Integer videoQuality = sharedPref.getInt("pref_quality", 0); + + for (File file : files) { + if (videoQuality.equals(file.getResolution().getId())) { + return file.getResolution().getLabel(); + } + } + return "Auto"; + } } \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 571c662..fbb0413 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -143,9 +143,9 @@ الرخصة اللغة العلامات - سرعة التشغيل - الجودة - الفيديو + سرعة التشغيل + (%s) الجودة + الفيديو (s%) القنوات حول الحساب: diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 0420e84..5fa6e20 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -285,8 +285,8 @@ গাঢ় বেগুনি অ্যাকাউন্ট সাম্প্রতিক - প্লেব্যাক এর গতি - কোয়ালিটি + প্লেব্যাক এর গতি (%s) + কোয়ালিটি (%s) ভিডিও চ্যানেলগুলি সম্পর্কিত diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aae549c..8171a43 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -276,8 +276,8 @@ Lizenz Sprache Tags - Wiedergabegeschwindigkeit - Qualität + Wiedergabegeschwindigkeit (%s) + Qualität (%s) Videos Kanäle Über diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8c61319..c34ccb4 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -96,8 +96,8 @@ Licencia Idioma Etiquetas - Velocidad de reproducción - Calidad + Velocidad de reproducción (%s) + Calidad (%s) Vídeos Canales Acerca de diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 78b7b91..8071156 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -103,7 +103,7 @@ maori oriya (makrokieli) bislama - Laatu + Laatu (%s) Jotain meni pieleen, yritä myöhemmin! bulgaria uzbekki @@ -204,7 +204,7 @@ navajo kanuri sunda - Toistonopeus + Toistonopeus (%s) sichuanin-yi Punainen Videon esikatselukuva diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d1dab69..a39fbef 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -99,8 +99,8 @@ Licence Langue Étiquettes - Vitesse de lecture - Qualité + Vitesse de lecture (%s) + Qualité (%s) Vidéos Chaînes À propos diff --git a/app/src/main/res/values-gd/strings.xml b/app/src/main/res/values-gd/strings.xml index d338263..69b4a36 100644 --- a/app/src/main/res/values-gd/strings.xml +++ b/app/src/main/res/values-gd/strings.xml @@ -285,8 +285,8 @@ Ceadachas Cànan Tagaichean - Luaths na cluiche - Càileachd + Luaths na cluiche (%s) + Càileachd (%s) Videothan Seanailean Mu dhèidhinn diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9f0d2e8..7c482cf 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -286,8 +286,8 @@ Licenza Lingua Parole chiave - Velocità di riproduzione - Qualità + Velocità di riproduzione (%s) + Qualità (%s) Video Canali A proposito diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index c9616a4..f993ef9 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -88,8 +88,8 @@ ラインセンス 言語 タグ - 再生速度 - クオリティ + 再生速度 (%s) + クオリティ(%s) ビデオ チャンネル 情報 diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index abfcf6f..8288fd7 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -51,8 +51,8 @@ Lisens Språk Etiketter - Avspillingshastighet - Kvalitet + Avspillingshastighet (%s) + Kvalitet (%s) Videoer Kanaler Om diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 591194e..97f079d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -275,8 +275,8 @@ Licentie Taal Labels - Afspeelsnelheid - Kwaliteit + Afspeelsnelheid (%s) + Kwaliteit (%s) Video\'s Kanalen Over diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 9367e80..3cc2890 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -48,8 +48,8 @@ Konto: Kanały Filmy - Jakość - Prędkość odtwarzania + Jakość (%s) + Prędkość odtwarzania (%s) Znaczniki Język Licencja diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2807285..719be8e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -277,8 +277,8 @@ Лицензия Язык Теги - Скорость воспроизведения - Качество + Скорость воспроизведения (%s) + Качество (%s) Описание: Что-то пошло не так, пожалуйста, попробуйте позже! Выберите сервер diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 6a7f958..f3989a9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -272,8 +272,8 @@ Licens Språk Taggar - Uppspelningshastighet - Kvalitet + Uppspelningshastighet (%s) + Kvalitet (%s) Videor Kanaler Om diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index dcb7795..77350d6 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -291,8 +291,8 @@ Lisans Dil Etiketler - Oynatma hızı - Kalite + Oynatma hızı (%s) + Kalite (%s) Hesap Yeniler diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 91e491e..e7835eb 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -112,8 +112,8 @@ 类别 许可 标签 - 播放速度 - 画质 + 播放速度 (%s) + 画质 (%s) 视频 频道 关于 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 039b46c..b8c74d4 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -279,8 +279,8 @@ 授權條款 語言 標籤 - 播放速度 - 畫質 + 播放速度 (%s) + 畫質 (%s) 影片 頻道 關於 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 543c2a3..4bee5e8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -324,8 +324,8 @@ License Language Tags - Playback speed - Quality + Playback speed (%s) + Quality (%s) Videos Channels About