Skip to content

Commit f68893f

Browse files
Merge branch 'master_newpipe' into dev
# Conflicts: # .github/workflows/ci.yml # README.md # app/build.gradle # app/src/main/java/org/schabi/newpipe/fragments/BlankFragment.java # app/src/main/java/org/schabi/newpipe/player/Player.java # app/src/main/res/values-be/strings.xml # app/src/main/res/values-de/strings.xml # app/src/main/res/values-et/strings.xml # app/src/main/res/values-hu/strings.xml # app/src/main/res/values-pt-rBR/strings.xml # app/src/main/res/values-sv/strings.xml # app/src/main/res/values/strings.xml # fastlane/metadata/android/hu/full_description.txt # fastlane/metadata/android/lv/changelogs/64.txt # fastlane/metadata/android/lv/short_description.txt # fastlane/metadata/android/pt-PT/changelogs/951.txt # fastlane/metadata/android/sk/full_description.txt # fastlane/metadata/android/sr/full_description.txt # fastlane/metadata/android/sr/short_description.txt # fastlane/metadata/android/ti/full_description.txt # fastlane/metadata/android/ti/short_description.txt
2 parents be0471c + 95a0e0c commit f68893f

File tree

202 files changed

+2927
-818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2927
-818
lines changed

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ android {
2323
if (System.properties.containsKey('versionCodeOverride')) {
2424
versionCode System.getProperty('versionCodeOverride') as Integer
2525
} else {
26-
versionCode 1004
26+
versionCode 1005
2727
}
28-
versionName "0.27.7"
28+
versionName "0.28.0"
2929
if (System.properties.containsKey('versionNameSuffix')) {
3030
versionNameSuffix System.getProperty('versionNameSuffix')
3131
}
@@ -216,12 +216,12 @@ dependencies {
216216
// Or you can use a commit you pushed to GitHub by just replacing TeamNewPipe with your GitHub
217217
// name and the commit hash with the commit hash of the (pushed) commit you want to test
218218
// This works thanks to JitPack: https://jitpack.io/
219-
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
219+
implementation 'com.github.TeamNewPipe:nanojson:e9d656ddb49a412a5a0a5d5ef20ca7ef09549996'
220220
// WORKAROUND: if you get errors with the NewPipeExtractor dependency, replace `v0.24.3` with
221221
// the corresponding commit hash, since JitPack sometimes deletes artifacts.
222222
// If there’s already a git hash, just add more of it to the end (or remove a letter)
223223
// to cause jitpack to regenerate the artifact.
224-
implementation 'com.github.polymorphicshade:TubularExtractor:d1f1257f5af55da2247831fb4c923181473f0e36'
224+
implementation 'com.github.polymorphicshade:TubularExtractor:89362281c298597aeac54e542c22718449301d9b'
225225
implementation 'com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'
226226

227227
/** Checkstyle **/
@@ -232,7 +232,7 @@ dependencies {
232232
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
233233

234234
/** AndroidX **/
235-
implementation 'androidx.appcompat:appcompat:1.6.1'
235+
implementation 'androidx.appcompat:appcompat:1.7.1'
236236
implementation 'androidx.cardview:cardview:1.0.0'
237237
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
238238
implementation 'androidx.core:core-ktx:1.12.0'

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@
5757
</intent-filter>
5858
</receiver>
5959

60+
<service
61+
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
62+
android:enabled="false"
63+
android:exported="false">
64+
<meta-data
65+
android:name="autoStoreLocales"
66+
android:value="true" />
67+
</service>
68+
6069
<service
6170
android:name=".player.PlayerService"
6271
android:exported="true"

app/src/main/java/org/schabi/newpipe/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void onCreate() {
102102
NewPipe.init(getDownloader(),
103103
Localization.getPreferredLocalization(this),
104104
Localization.getPreferredContentCountry(this));
105-
Localization.initPrettyTime(Localization.resolvePrettyTime(getApplicationContext()));
105+
Localization.initPrettyTime(Localization.resolvePrettyTime());
106106

107107
BridgeStateSaverInitializer.init(this);
108108
StateSaver.init(this);

app/src/main/java/org/schabi/newpipe/DownloaderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public final class DownloaderImpl extends Downloader {
3131
public static final String USER_AGENT =
32-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0";
32+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0";
3333
public static final String YOUTUBE_RESTRICTED_MODE_COOKIE_KEY =
3434
"youtube_restricted_mode_key";
3535
public static final String YOUTUBE_RESTRICTED_MODE_COOKIE = "PREF=f2=8000000";

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
package org.schabi.newpipe;
2222

23-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
24-
2523
import android.content.BroadcastReceiver;
2624
import android.content.Context;
2725
import android.content.Intent;
@@ -81,6 +79,7 @@
8179
import org.schabi.newpipe.player.helper.PlayerHolder;
8280
import org.schabi.newpipe.player.playqueue.PlayQueue;
8381
import org.schabi.newpipe.settings.UpdateSettingsFragment;
82+
import org.schabi.newpipe.settings.migration.MigrationManager;
8483
import org.schabi.newpipe.util.Constants;
8584
import org.schabi.newpipe.util.DeviceUtils;
8685
import org.schabi.newpipe.util.KioskTranslator;
@@ -141,6 +140,7 @@ protected void onCreate(final Bundle savedInstanceState) {
141140
+ "savedInstanceState = [" + savedInstanceState + "]");
142141
}
143142

143+
Localization.migrateAppLanguageSettingIfNecessary(getApplicationContext());
144144
ThemeHelper.setDayNightMode(this);
145145
ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this));
146146

@@ -157,7 +157,6 @@ protected void onCreate(final Bundle savedInstanceState) {
157157
}
158158
}
159159

160-
assureCorrectAppLanguage(this);
161160
super.onCreate(savedInstanceState);
162161
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
163162
sharedPrefEditor = sharedPreferences.edit();
@@ -196,7 +195,7 @@ protected void onCreate(final Bundle savedInstanceState) {
196195
UpdateSettingsFragment.askForConsentToUpdateChecks(this);
197196
}
198197

199-
Localization.migrateAppLanguageSettingIfNecessary(getApplicationContext());
198+
MigrationManager.showUserInfoIfPresent(this);
200199
}
201200

202201
@Override
@@ -264,19 +263,6 @@ public void onDrawerClosed(final View drawerView) {
264263
*/
265264
private void addDrawerMenuForCurrentService() throws ExtractionException {
266265
//Tabs
267-
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
268-
final StreamingService service = NewPipe.getService(currentServiceId);
269-
270-
int kioskMenuItemId = 0;
271-
272-
for (final String ks : service.getKioskList().getAvailableKiosks()) {
273-
drawerLayoutBinding.navigation.getMenu()
274-
.add(R.id.menu_tabs_group, kioskMenuItemId, 0, KioskTranslator
275-
.getTranslatedKioskName(ks, this))
276-
.setIcon(KioskTranslator.getKioskIcon(ks));
277-
kioskMenuItemId++;
278-
}
279-
280266
drawerLayoutBinding.navigation.getMenu()
281267
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER,
282268
R.string.tab_subscriptions)
@@ -294,6 +280,20 @@ private void addDrawerMenuForCurrentService() throws ExtractionException {
294280
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
295281
.setIcon(R.drawable.ic_history);
296282

283+
//Kiosks
284+
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
285+
final StreamingService service = NewPipe.getService(currentServiceId);
286+
287+
int kioskMenuItemId = 0;
288+
289+
for (final String ks : service.getKioskList().getAvailableKiosks()) {
290+
drawerLayoutBinding.navigation.getMenu()
291+
.add(R.id.menu_kiosks_group, kioskMenuItemId, 0, KioskTranslator
292+
.getTranslatedKioskName(ks, this))
293+
.setIcon(KioskTranslator.getKioskIcon(ks));
294+
kioskMenuItemId++;
295+
}
296+
297297
//Settings and About
298298
drawerLayoutBinding.navigation.getMenu()
299299
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
@@ -313,10 +313,13 @@ private boolean drawerItemSelected(final MenuItem item) {
313313
changeService(item);
314314
break;
315315
case R.id.menu_tabs_group:
316+
tabSelected(item);
317+
break;
318+
case R.id.menu_kiosks_group:
316319
try {
317-
tabSelected(item);
320+
kioskSelected(item);
318321
} catch (final Exception e) {
319-
ErrorUtil.showUiErrorSnackbar(this, "Selecting main page tab", e);
322+
ErrorUtil.showUiErrorSnackbar(this, "Selecting drawer kiosk", e);
320323
}
321324
break;
322325
case R.id.menu_options_about_group:
@@ -340,7 +343,7 @@ private void changeService(final MenuItem item) {
340343
.setChecked(true);
341344
}
342345

343-
private void tabSelected(final MenuItem item) throws ExtractionException {
346+
private void tabSelected(final MenuItem item) {
344347
switch (item.getItemId()) {
345348
case ITEM_ID_SUBSCRIPTIONS:
346349
NavigationHelper.openSubscriptionFragment(getSupportFragmentManager());
@@ -357,18 +360,19 @@ private void tabSelected(final MenuItem item) throws ExtractionException {
357360
case ITEM_ID_HISTORY:
358361
NavigationHelper.openStatisticFragment(getSupportFragmentManager());
359362
break;
360-
default:
361-
final StreamingService currentService = ServiceHelper.getSelectedService(this);
362-
int kioskMenuItemId = 0;
363-
for (final String kioskId : currentService.getKioskList().getAvailableKiosks()) {
364-
if (kioskMenuItemId == item.getItemId()) {
365-
NavigationHelper.openKioskFragment(getSupportFragmentManager(),
366-
currentService.getServiceId(), kioskId);
367-
break;
368-
}
369-
kioskMenuItemId++;
370-
}
363+
}
364+
}
365+
366+
private void kioskSelected(final MenuItem item) throws ExtractionException {
367+
final StreamingService currentService = ServiceHelper.getSelectedService(this);
368+
int kioskMenuItemId = 0;
369+
for (final String kioskId : currentService.getKioskList().getAvailableKiosks()) {
370+
if (kioskMenuItemId == item.getItemId()) {
371+
NavigationHelper.openKioskFragment(getSupportFragmentManager(),
372+
currentService.getServiceId(), kioskId);
371373
break;
374+
}
375+
kioskMenuItemId++;
372376
}
373377
}
374378

@@ -409,6 +413,7 @@ private void toggleServices() {
409413

410414
drawerLayoutBinding.navigation.getMenu().removeGroup(R.id.menu_services_group);
411415
drawerLayoutBinding.navigation.getMenu().removeGroup(R.id.menu_tabs_group);
416+
drawerLayoutBinding.navigation.getMenu().removeGroup(R.id.menu_kiosks_group);
412417
drawerLayoutBinding.navigation.getMenu().removeGroup(R.id.menu_options_about_group);
413418

414419
// Show up or down arrow
@@ -502,9 +507,8 @@ protected void onDestroy() {
502507

503508
@Override
504509
protected void onResume() {
505-
assureCorrectAppLanguage(this);
506510
// Change the date format to match the selected language on resume
507-
Localization.initPrettyTime(Localization.resolvePrettyTime(getApplicationContext()));
511+
Localization.initPrettyTime(Localization.resolvePrettyTime());
508512
super.onResume();
509513

510514
// Close drawer on return, and don't show animation,

app/src/main/java/org/schabi/newpipe/RouterActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
import org.schabi.newpipe.util.Constants;
8585
import org.schabi.newpipe.util.DeviceUtils;
8686
import org.schabi.newpipe.util.ExtractorHelper;
87-
import org.schabi.newpipe.util.Localization;
8887
import org.schabi.newpipe.util.NavigationHelper;
8988
import org.schabi.newpipe.util.PermissionHelper;
9089
import org.schabi.newpipe.util.ThemeHelper;
@@ -132,7 +131,6 @@ protected void onCreate(final Bundle savedInstanceState) {
132131
ThemeHelper.setDayNightMode(this);
133132
setTheme(ThemeHelper.isLightThemeSelected(this)
134133
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
135-
Localization.assureCorrectAppLanguage(this);
136134

137135
// Pass-through touch events to background activities
138136
// so that our transparent window won't lock UI in the mean time

app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ import org.schabi.newpipe.BuildConfig
1616
import org.schabi.newpipe.R
1717
import org.schabi.newpipe.databinding.ActivityAboutBinding
1818
import org.schabi.newpipe.databinding.FragmentAboutBinding
19-
import org.schabi.newpipe.util.Localization
2019
import org.schabi.newpipe.util.ThemeHelper
2120
import org.schabi.newpipe.util.external_communication.ShareUtils
2221

2322
class AboutActivity : AppCompatActivity() {
2423

2524
override fun onCreate(savedInstanceState: Bundle?) {
26-
Localization.assureCorrectAppLanguage(this)
2725
super.onCreate(savedInstanceState)
2826
ThemeHelper.setTheme(this)
2927
title = getString(R.string.title_activity_about)

app/src/main/java/org/schabi/newpipe/about/LicenseFragment.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import org.schabi.newpipe.R
1919
import org.schabi.newpipe.databinding.FragmentLicensesBinding
2020
import org.schabi.newpipe.databinding.ItemSoftwareComponentBinding
2121
import org.schabi.newpipe.ktx.parcelableArrayList
22-
import org.schabi.newpipe.util.Localization
2322
import org.schabi.newpipe.util.external_communication.ShareUtils
2423

2524
/**
@@ -100,7 +99,6 @@ class LicenseFragment : Fragment() {
10099
val webView = WebView(context)
101100
webView.loadData(webViewData, "text/html; charset=UTF-8", "base64")
102101

103-
Localization.assureCorrectAppLanguage(context)
104102
val builder = AlertDialog.Builder(requireContext())
105103
.setTitle(softwareComponent.name)
106104
.setView(webView)

app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import us.shandian.giga.service.DownloadManagerService;
2121
import us.shandian.giga.ui.fragment.MissionsFragment;
2222

23-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
24-
2523
public class DownloadActivity extends AppCompatActivity {
2624

2725
private static final String MISSIONS_FRAGMENT_TAG = "fragment_tag";
@@ -33,7 +31,6 @@ protected void onCreate(final Bundle savedInstanceState) {
3331
i.setClass(this, DownloadManagerService.class);
3432
startService(i);
3533

36-
assureCorrectAppLanguage(this);
3734
ThemeHelper.setTheme(this);
3835

3936
super.onCreate(savedInstanceState);

app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import static org.schabi.newpipe.extractor.stream.DeliveryMethod.PROGRESSIVE_HTTP;
44
import static org.schabi.newpipe.util.ListHelper.getStreamsOfSpecifiedDelivery;
5-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
65

76
import android.app.Activity;
87
import android.content.ComponentName;
@@ -751,7 +750,6 @@ private String getNameEditText() {
751750
}
752751

753752
private void showFailedDialog(@StringRes final int msg) {
754-
assureCorrectAppLanguage(requireContext());
755753
new AlertDialog.Builder(context)
756754
.setTitle(R.string.general_error)
757755
.setMessage(msg)

0 commit comments

Comments
 (0)