diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54415858e..f6708fa83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,6 +111,7 @@ jobs: path: app/build/reports/androidTests/connected/** sonar: + if: ${{ false }} # the key has expired and needs to be regenerated by the sonar admins runs-on: ubuntu-latest permissions: diff --git a/README.md b/README.md index bf1317f17..c19144064 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,30 @@ -
refactor
branch if you want to contribute new features. The current codebase is in maintenance mode and will only receive bugfixes.Screenshots • Supported Services • Description • Features • Installation and updates • Contribution • Donate • License
diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 95b1f4164..bf23d3d70 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -122,7 +122,10 @@ public class MainActivity extends AppCompatActivity { private static final int ITEM_ID_ABOUT = 2; private static final int ORDER = 0; + public static final String KEY_IS_IN_BACKGROUND = "is_in_background"; + private SharedPreferences sharedPreferences; + private SharedPreferences.Editor sharedPrefEditor; /*////////////////////////////////////////////////////////////////////////// // Activity's LifeCycle //////////////////////////////////////////////////////////////////////////*/ @@ -152,6 +155,8 @@ public class MainActivity extends AppCompatActivity { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); + sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + sharedPrefEditor = sharedPreferences.edit(); mainBinding = ActivityMainBinding.inflate(getLayoutInflater()); drawerLayoutBinding = mainBinding.drawerLayout; @@ -195,16 +200,29 @@ public class MainActivity extends AppCompatActivity { super.onPostCreate(savedInstanceState); final App app = App.getInstance(); - final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app); - if (prefs.getBoolean(app.getString(R.string.update_app_key), false) - && prefs.getBoolean(app.getString(R.string.update_check_consent_key), false)) { + if (sharedPreferences.getBoolean(app.getString(R.string.update_app_key), false) + && sharedPreferences + .getBoolean(app.getString(R.string.update_check_consent_key), false)) { // Start the worker which is checking all conditions // and eventually searching for a new version. NewVersionWorker.enqueueNewVersionCheckingWork(app, false); } } + @Override + protected void onStart() { + super.onStart(); + sharedPrefEditor.putBoolean(KEY_IS_IN_BACKGROUND, false).apply(); + Log.d(TAG, "App moved to foreground"); + } + + @Override + protected void onStop() { + super.onStop(); + sharedPrefEditor.putBoolean(KEY_IS_IN_BACKGROUND, true).apply(); + Log.d(TAG, "App moved to background"); + } private void setupDrawer() throws ExtractionException { addDrawerMenuForCurrentService(); @@ -504,13 +522,11 @@ public class MainActivity extends AppCompatActivity { ErrorUtil.showUiErrorSnackbar(this, "Setting up service toggle", e); } - final SharedPreferences sharedPreferences = - PreferenceManager.getDefaultSharedPreferences(this); if (sharedPreferences.getBoolean(Constants.KEY_THEME_CHANGE, false)) { if (DEBUG) { Log.d(TAG, "Theme has changed, recreating activity..."); } - sharedPreferences.edit().putBoolean(Constants.KEY_THEME_CHANGE, false).apply(); + sharedPrefEditor.putBoolean(Constants.KEY_THEME_CHANGE, false).apply(); ActivityCompat.recreate(this); } @@ -518,7 +534,7 @@ public class MainActivity extends AppCompatActivity { if (DEBUG) { Log.d(TAG, "main page has changed, recreating main fragment..."); } - sharedPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false).apply(); + sharedPrefEditor.putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false).apply(); NavigationHelper.openMainActivity(this); } diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt index dcbc11413..93dd8e522 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt @@ -11,7 +11,9 @@ import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.app.PendingIntentCompat import androidx.fragment.app.Fragment +import androidx.preference.PreferenceManager import com.google.android.material.snackbar.Snackbar +import org.schabi.newpipe.MainActivity import org.schabi.newpipe.R /** @@ -35,12 +37,20 @@ class ErrorUtil { * activity (since the workflow would be interrupted anyway in that case). So never use this * for background services. * + * If the crashed occurred while the app was in the background open a notification instead + * * @param context the context to use to start the new activity * @param errorInfo the error info to be reported */ @JvmStatic fun openActivity(context: Context, errorInfo: ErrorInfo) { - context.startActivity(getErrorActivityIntent(context, errorInfo)) + if (PreferenceManager.getDefaultSharedPreferences(context) + .getBoolean(MainActivity.KEY_IS_IN_BACKGROUND, true) + ) { + createNotification(context, errorInfo) + } else { + context.startActivity(getErrorActivityIntent(context, errorInfo)) + } } /** diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index f976f44aa..038f2bed1 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -274,7 +274,12 @@ class FeedFragment : BaseStateFragment+ * NewPipe is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *
+ *+ * NewPipe is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with NewPipe. If not, see
@foobar
.
*
* Will correctly handle right-to-left usernames by using a {@link BidiFormatter}.
+ * For right-to-left usernames, it will put the @ on the right side to read more naturally.
*
* @param plainName username, with an optional leading @
* @return a usernames that can include RTL-characters
*/
@NonNull
public static String localizeUserName(final String plainName) {
- final BidiFormatter bidi = BidiFormatter.getInstance();
-
- if (plainName.startsWith("@")) {
- return "@" + bidi.unicodeWrap(plainName.substring(1));
- } else {
- return bidi.unicodeWrap(plainName);
- }
+ return BidiFormatter.getInstance().unicodeWrap(plainName);
}
public static org.schabi.newpipe.extractor.localization.Localization getPreferredLocalization(
diff --git a/app/src/main/res/layout/select_feed_group_fragment.xml b/app/src/main/res/layout/select_feed_group_fragment.xml
new file mode 100644
index 000000000..bb17d5f6e
--- /dev/null
+++ b/app/src/main/res/layout/select_feed_group_fragment.xml
@@ -0,0 +1,42 @@
+
+لقطات الشاشة • الخدمات المدعومة • وصف • سمات • التثبيت والتحديثات • مساهمة • التبرعات • رخصة
موقع • مدونة • الأسئلة الشائعة • إضغط
diff --git a/doc/README.asm.md b/doc/README.asm.md index 8042b3db9..37d0949b7 100644 --- a/doc/README.asm.md +++ b/doc/README.asm.md @@ -2,16 +2,26 @@স্ক্ৰীণশ্বট • সমৰ্থিত সেৱাসমূহ • বিৱৰণ • diff --git a/doc/README.de.md b/doc/README.de.md index 5b3275d07..34ad94ab1 100644 --- a/doc/README.de.md +++ b/doc/README.de.md @@ -1,19 +1,30 @@ -
refactor
branch als Arbeitsgrundlage, wenn du neue Funktionen beitragen willst. Die aktuelle Codebase ist im reinen Maintenance mode und bekommt nur noch Fehlerbehebungen.Screenshots • Unterstützte Dienste • Beschreibung • Features • Installation und Updates • Beitrag • Spenden • Lizenz
Website • Blog • FAQ • Über NewPipe
diff --git a/doc/README.es.md b/doc/README.es.md index 8ec58e771..4a08cba08 100644 --- a/doc/README.es.md +++ b/doc/README.es.md @@ -2,15 +2,26 @@Capturas de Pantalla • Descripción • Características • Instalación y Actualizaciones • Contribución • Donar • Licencia
diff --git a/doc/README.fr.md b/doc/README.fr.md index 772f4a1ae..cfebcb2a6 100644 --- a/doc/README.fr.md +++ b/doc/README.fr.md @@ -5,15 +5,26 @@Captures d'écran • Services Supportés • Description • Fonctionnalités • Installation et mises à jour • Contribuer • Dons • Licence
diff --git a/doc/README.hi.md b/doc/README.hi.md index 37ae71a4a..6098c6c26 100644 --- a/doc/README.hi.md +++ b/doc/README.hi.md @@ -2,16 +2,26 @@ऐप कैसी दिखती है • समर्थित सेवाएँ • विवरण • सुविधाएँ • स्थापित करना और अपडेट करना • योगदान करें • आर्थिक योगदान करें • लाइसेंस
वेबसाइट • ब्लॉग • साधारण सवाल-जवाब • प्रेस
diff --git a/doc/README.it.md b/doc/README.it.md index 6c227ea2f..d926db6bc 100644 --- a/doc/README.it.md +++ b/doc/README.it.md @@ -2,15 +2,26 @@Screenshot • Servizi Supportati • Descrizione • Funzionalità • Installazione e aggiornamenti • Contribuire • Donare • Licenza
diff --git a/doc/README.ja.md b/doc/README.ja.md index e8f708a8a..1e751855b 100644 --- a/doc/README.ja.md +++ b/doc/README.ja.md @@ -2,15 +2,26 @@スクリーンショット • 説明 • 機能 • インストールと更新 • 貢献 • 寄付 • ライセンス
diff --git a/doc/README.ko.md b/doc/README.ko.md index 3215bd713..39fb7e11c 100644 --- a/doc/README.ko.md +++ b/doc/README.ko.md @@ -2,15 +2,26 @@Screenshots • Description • Features • Updates • Contribution • Donate • License
diff --git a/doc/README.pa.md b/doc/README.pa.md index 0e254adf1..9b84ded18 100644 --- a/doc/README.pa.md +++ b/doc/README.pa.md @@ -2,16 +2,26 @@ਐਪ ਕਿਹੋ-ਜਿਹੀ ਦਿਖਦੀ ਹੈ • ਸਮਰਥਿਤ ਸੇਵਾਵਾਂ • ਵਰਣਨ • ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ • ਇੰਸਟਾਲੇਸ਼ਨ ਅਤੇ ਅੱਪਡੇਟ • ਯੋਗਦਾਨ • ਦਾਨ • ਲਾਈਸੈਂਸ
ਵੈੱਬਸਾਈਟ • ਬਲੌਗ • ਆਮ ਸਵਾਲ ਜਵਾਬ • ਪ੍ਰੈਸ
diff --git a/doc/README.pl.md b/doc/README.pl.md index 96d493153..9574491c7 100644 --- a/doc/README.pl.md +++ b/doc/README.pl.md @@ -2,15 +2,26 @@Screenshoty • Opis • Funkcje • Instalacja i aktualizacje • Wkład • Wesprzyj • Licencja
diff --git a/doc/README.pt_BR.md b/doc/README.pt_BR.md index da6c4fce6..b73da2de1 100644 --- a/doc/README.pt_BR.md +++ b/doc/README.pt_BR.md @@ -6,15 +6,26 @@Screenshots • Serviços Suportados • Descrição • Recursos • Instalação e atualizações • Contribuições • Doar • Licença
diff --git a/doc/README.ro.md b/doc/README.ro.md index 29c1d3666..3f146f7e4 100644 --- a/doc/README.ro.md +++ b/doc/README.ro.md @@ -2,15 +2,26 @@Capturi de ecran • Descriere • Funcţii • Instalare şi actualizări • Contribuţie • Donaţi • Licenţă
diff --git a/doc/README.ru.md b/doc/README.ru.md index e3c76d329..8a9955707 100644 --- a/doc/README.ru.md +++ b/doc/README.ru.md @@ -2,15 +2,26 @@Скриншоты • Поддерживаемые сервисы • Описание • Возможности • Установка и обновления • Участие • Пожертвование • Лицензия
diff --git a/doc/README.ryu.md b/doc/README.ryu.md index 2e24aa41c..f3ca31af0 100644 --- a/doc/README.ryu.md +++ b/doc/README.ryu.md @@ -2,15 +2,26 @@スクリーンショット • しちめい • ちぬー • インストールとぅこうしん • こうきん • ちーふ • ライセンス
diff --git a/doc/README.so.md b/doc/README.so.md index 640feae60..843bed749 100644 --- a/doc/README.so.md +++ b/doc/README.so.md @@ -2,15 +2,26 @@Sawir-shaashadeed • Faahfaahin • Waxqabadka • Kushubida iyo cusboonaysiinta • Kusoo Kordhin • Ugu Deeq • Laysinka
Website-ka • Maqaalada • Su'aalaha Aalaa La-iswaydiiyo • Warbaahinta
diff --git a/doc/README.sr.md b/doc/README.sr.md index 1a9118638..21e4d857c 100644 --- a/doc/README.sr.md +++ b/doc/README.sr.md @@ -5,15 +5,26 @@Снимци екрана • Подржане услуге • Опис • Карактеристике • Инсталација и ажурирања • Допринос • Донација • Лиценца
Веб-сајт • Блог • ЧПП • Штампа
diff --git a/doc/README.tr.md b/doc/README.tr.md index bbdd85f76..6e95e54de 100644 --- a/doc/README.tr.md +++ b/doc/README.tr.md @@ -2,15 +2,26 @@Ekran fotoğrafları • Açıklama • Özellikler • Kurulum ve güncellemeler • Katkıda bulunma • Bağış • Lisans
Web sitesi • Blog • SSS • Basın
diff --git a/doc/README.zh_TW.md b/doc/README.zh_TW.md index 760a43ad5..05518624f 100644 --- a/doc/README.zh_TW.md +++ b/doc/README.zh_TW.md @@ -2,15 +2,26 @@