Skip to content

Commit ea0a0c7

Browse files
authored
Merge pull request #4333 from TeamNewPipe/release/0.20.0
Release 0.20.0
2 parents 7918e3a + 535a050 commit ea0a0c7

File tree

400 files changed

+15084
-9034
lines changed

Some content is hidden

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

400 files changed

+15084
-9034
lines changed

.github/CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ with your GitHub account.
3333

3434
## Code contribution
3535

36+
* If you want to add a feature or change one, please open an issue describing your change. This gives the team and community a chance to give feedback before you spend any time on something that could be done differently or not done at all. It also prevents two contributors from working on the same thing and one being disappointed when only one user's code can be added.
3637
* Stick to NewPipe's style conventions: follow [checkStyle](https://github.com/checkstyle/checkstyle). It will run each time you build the project.
3738
* Do not bring non-free software (e.g. binary blobs) into the project. Also, make sure you do not introduce Google
3839
libraries.

app/build.gradle

+12-9
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
resValue "string", "app_name", "NewPipe"
1414
minSdkVersion 19
1515
targetSdkVersion 29
16-
versionCode 953
17-
versionName "0.19.8"
16+
versionCode 954
17+
versionName "0.20.0"
1818

1919
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2020
vectorDrawables.useSupportLibrary = true
@@ -33,7 +33,7 @@ android {
3333

3434
// suffix the app id and the app name with git branch name
3535
def workingBranch = getGitWorkingBranch()
36-
def normalizedWorkingBranch = workingBranch.replaceAll("[^A-Za-z]+", "").toLowerCase()
36+
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
3737
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev") {
3838
// default values when branch name could not be determined or is master or dev
3939
applicationIdSuffix ".debug"
@@ -84,11 +84,12 @@ ext {
8484
checkstyleVersion = '8.32'
8585
stethoVersion = '1.5.1'
8686
leakCanaryVersion = '2.2'
87-
exoPlayerVersion = '2.11.6'
87+
exoPlayerVersion = '2.11.8'
8888
androidxLifecycleVersion = '2.2.0'
8989
androidxRoomVersion = '2.2.5'
9090
groupieVersion = '2.8.0'
9191
markwonVersion = '4.3.1'
92+
googleAutoServiceVersion = '1.0-rc7'
9293
}
9394

9495
configurations {
@@ -138,7 +139,7 @@ afterEvaluate {
138139
}
139140

140141
dependencies {
141-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
142+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
142143

143144
implementation "frankiesardo:icepick:${icepickVersion}"
144145
kapt "frankiesardo:icepick-processor:${icepickVersion}"
@@ -163,18 +164,21 @@ dependencies {
163164
exclude module: 'support-annotations'
164165
}
165166

166-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:5ac80624a40f4c600ae493e66881b5bf008f0ddb'
167+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:2463884aa8b696df5812f7feff553008bbd2f888'
167168

168169
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
169170
implementation "org.jsoup:jsoup:1.13.1"
170171

171-
implementation "com.squareup.okhttp3:okhttp:3.12.11"
172+
implementation "com.squareup.okhttp3:okhttp:3.12.12"
172173

173174
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerVersion}"
174175
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerVersion}"
175176

176177
implementation "com.google.android.material:material:1.1.0"
177178

179+
compileOnly "com.google.auto.service:auto-service-annotations:${googleAutoServiceVersion}"
180+
kapt "com.google.auto.service:auto-service:${googleAutoServiceVersion}"
181+
178182
implementation "androidx.appcompat:appcompat:1.1.0"
179183
implementation "androidx.preference:preference:1.1.1"
180184
implementation "androidx.recyclerview:recyclerview:1.1.0"
@@ -183,7 +187,6 @@ dependencies {
183187

184188
implementation "androidx.lifecycle:lifecycle-livedata:${androidxLifecycleVersion}"
185189
implementation "androidx.lifecycle:lifecycle-viewmodel:${androidxLifecycleVersion}"
186-
implementation "androidx.lifecycle:lifecycle-extensions:${androidxLifecycleVersion}"
187190

188191
implementation "androidx.room:room-runtime:${androidxRoomVersion}"
189192
implementation "androidx.room:room-rxjava2:${androidxRoomVersion}"
@@ -206,7 +209,7 @@ dependencies {
206209
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
207210
implementation "com.jakewharton.rxbinding2:rxbinding:2.2.0"
208211

209-
implementation "org.ocpsoft.prettytime:prettytime:4.0.5.Final"
212+
implementation "org.ocpsoft.prettytime:prettytime:4.0.6.Final"
210213
}
211214

212215
static String getGitWorkingBranch() {

app/src/androidTest/java/org/schabi/newpipe/report/ErrorInfoTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public class ErrorInfoTest {
2121

2222
@Test
2323
public void errorInfoTestParcelable() {
24-
ErrorInfo info = ErrorInfo.make(UserAction.USER_REPORT, "youtube", "request",
24+
final ErrorInfo info = ErrorInfo.make(UserAction.USER_REPORT, "youtube", "request",
2525
R.string.general_error);
2626
// Obtain a Parcel object and write the parcelable object to it:
27-
Parcel parcel = Parcel.obtain();
27+
final Parcel parcel = Parcel.obtain();
2828
info.writeToParcel(parcel, 0);
2929
parcel.setDataPosition(0);
30-
ErrorInfo infoFromParcel = ErrorInfo.CREATOR.createFromParcel(parcel);
30+
final ErrorInfo infoFromParcel = ErrorInfo.CREATOR.createFromParcel(parcel);
3131

3232
assertEquals(UserAction.USER_REPORT, infoFromParcel.userAction);
3333
assertEquals("youtube", infoFromParcel.serviceName);

app/src/debug/java/org/schabi/newpipe/DebugApp.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.schabi.newpipe
22

3-
import android.content.Context
43
import androidx.multidex.MultiDex
54
import androidx.preference.PreferenceManager
65
import com.facebook.stetho.Stetho
@@ -11,11 +10,6 @@ import okhttp3.OkHttpClient
1110
import org.schabi.newpipe.extractor.downloader.Downloader
1211

1312
class DebugApp : App() {
14-
override fun attachBaseContext(base: Context) {
15-
super.attachBaseContext(base)
16-
MultiDex.install(this)
17-
}
18-
1913
override fun onCreate() {
2014
super.onCreate()
2115
initStetho()
@@ -34,6 +28,12 @@ class DebugApp : App() {
3428
return downloader
3529
}
3630

31+
override fun initACRA() {
32+
// install MultiDex before initializing ACRA
33+
MultiDex.install(this)
34+
super.initACRA()
35+
}
36+
3737
private fun initStetho() {
3838
// Create an InitializerBuilder
3939
val initializerBuilder = Stetho.newInitializerBuilder(this)

app/src/main/AndroidManifest.xml

+11-19
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
android:logo="@mipmap/ic_launcher"
2424
android:requestLegacyExternalStorage="true"
2525
android:theme="@style/OpeningTheme"
26+
android:resizeableActivity="true"
2627
tools:ignore="AllowBackup">
2728
<activity
2829
android:name=".MainActivity"
@@ -43,34 +44,19 @@
4344
</receiver>
4445

4546
<service
46-
android:name=".player.BackgroundPlayer"
47-
android:exported="false">
47+
android:name=".player.MainPlayer"
48+
android:exported="false"
49+
android:foregroundServiceType="mediaPlayback">
4850
<intent-filter>
4951
<action android:name="android.intent.action.MEDIA_BUTTON" />
5052
</intent-filter>
5153
</service>
5254

5355
<activity
5456
android:name=".player.BackgroundPlayerActivity"
55-
android:label="@string/title_activity_background_player"
57+
android:label="@string/title_activity_play_queue"
5658
android:launchMode="singleTask" />
5759

58-
<activity
59-
android:name=".player.PopupVideoPlayerActivity"
60-
android:label="@string/title_activity_popup_player"
61-
android:launchMode="singleTask" />
62-
63-
<service
64-
android:name=".player.PopupVideoPlayer"
65-
android:exported="false" />
66-
67-
<activity
68-
android:name=".player.MainVideoPlayer"
69-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
70-
android:label="@string/app_name"
71-
android:launchMode="singleTask"
72-
android:theme="@style/VideoPlayerTheme" />
73-
7460
<activity
7561
android:name=".settings.SettingsActivity"
7662
android:label="@string/settings" />
@@ -334,5 +320,11 @@
334320
<service
335321
android:name=".RouterActivity$FetcherService"
336322
android:exported="false" />
323+
324+
<!-- see https://github.com/TeamNewPipe/NewPipe/issues/3947 -->
325+
<!-- Version < 3.0. DeX Mode and Screen Mirroring support -->
326+
<meta-data android:name="com.samsung.android.keepalive.density" android:value="true"/>
327+
<!-- Version >= 3.0. DeX Dual Mode support -->
328+
<meta-data android:name="com.samsung.android.multidisplay.keep_process_alive" android:value="true"/>
337329
</application>
338330
</manifest>

app/src/main/java/androidx/fragment/app/FragmentStatePagerAdapterMenuWorkaround.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public Object instantiateItem(@NonNull final ViewGroup container, final int posi
150150
// from its saved state, where the fragment manager has already
151151
// taken care of restoring the fragments we previously had instantiated.
152152
if (mFragments.size() > position) {
153-
Fragment f = mFragments.get(position);
153+
final Fragment f = mFragments.get(position);
154154
if (f != null) {
155155
return f;
156156
}
@@ -160,12 +160,12 @@ public Object instantiateItem(@NonNull final ViewGroup container, final int posi
160160
mCurTransaction = mFragmentManager.beginTransaction();
161161
}
162162

163-
Fragment fragment = getItem(position);
163+
final Fragment fragment = getItem(position);
164164
if (DEBUG) {
165165
Log.v(TAG, "Adding item #" + position + ": f=" + fragment);
166166
}
167167
if (mSavedState.size() > position) {
168-
Fragment.SavedState fss = mSavedState.get(position);
168+
final Fragment.SavedState fss = mSavedState.get(position);
169169
if (fss != null) {
170170
fragment.setInitialSavedState(fss);
171171
}
@@ -191,7 +191,7 @@ public Object instantiateItem(@NonNull final ViewGroup container, final int posi
191191
@Override
192192
public void destroyItem(@NonNull final ViewGroup container, final int position,
193193
@NonNull final Object object) {
194-
Fragment fragment = (Fragment) object;
194+
final Fragment fragment = (Fragment) object;
195195

196196
if (mCurTransaction == null) {
197197
mCurTransaction = mFragmentManager.beginTransaction();
@@ -217,7 +217,7 @@ public void destroyItem(@NonNull final ViewGroup container, final int position,
217217
@SuppressWarnings({"ReferenceEquality", "deprecation"})
218218
public void setPrimaryItem(@NonNull final ViewGroup container, final int position,
219219
@NonNull final Object object) {
220-
Fragment fragment = (Fragment) object;
220+
final Fragment fragment = (Fragment) object;
221221
if (fragment != mCurrentPrimaryItem) {
222222
if (mCurrentPrimaryItem != null) {
223223
mCurrentPrimaryItem.setMenuVisibility(false);
@@ -267,17 +267,17 @@ public Parcelable saveState() {
267267
Bundle state = null;
268268
if (mSavedState.size() > 0) {
269269
state = new Bundle();
270-
Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
270+
final Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
271271
mSavedState.toArray(fss);
272272
state.putParcelableArray("states", fss);
273273
}
274274
for (int i = 0; i < mFragments.size(); i++) {
275-
Fragment f = mFragments.get(i);
275+
final Fragment f = mFragments.get(i);
276276
if (f != null && f.isAdded()) {
277277
if (state == null) {
278278
state = new Bundle();
279279
}
280-
String key = "f" + i;
280+
final String key = "f" + i;
281281
mFragmentManager.putFragment(state, key, f);
282282

283283
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -294,21 +294,21 @@ public Parcelable saveState() {
294294
@Override
295295
public void restoreState(@Nullable final Parcelable state, @Nullable final ClassLoader loader) {
296296
if (state != null) {
297-
Bundle bundle = (Bundle) state;
297+
final Bundle bundle = (Bundle) state;
298298
bundle.setClassLoader(loader);
299-
Parcelable[] fss = bundle.getParcelableArray("states");
299+
final Parcelable[] fss = bundle.getParcelableArray("states");
300300
mSavedState.clear();
301301
mFragments.clear();
302302
if (fss != null) {
303-
for (int i = 0; i < fss.length; i++) {
304-
mSavedState.add((Fragment.SavedState) fss[i]);
303+
for (final Parcelable parcelable : fss) {
304+
mSavedState.add((Fragment.SavedState) parcelable);
305305
}
306306
}
307-
Iterable<String> keys = bundle.keySet();
308-
for (String key: keys) {
307+
final Iterable<String> keys = bundle.keySet();
308+
for (final String key : keys) {
309309
if (key.startsWith("f")) {
310-
int index = Integer.parseInt(key.substring(1));
311-
Fragment f = mFragmentManager.getFragment(bundle, key);
310+
final int index = Integer.parseInt(key.substring(1));
311+
final Fragment f = mFragmentManager.getFragment(bundle, key);
312312
if (f != null) {
313313
while (mFragments.size() <= index) {
314314
mFragments.add(null);

0 commit comments

Comments
 (0)