Merge pull request #2710 from TeamNewPipe/release-0.17.4

Release 0.17.4
This commit is contained in:
Tobias Groza 2019-10-30 17:25:24 +01:00 committed by GitHub
commit 0e0f498c06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
267 changed files with 2994 additions and 2569 deletions

1
.gitignore vendored
View file

@ -7,7 +7,6 @@
/app/app.iml /app/app.iml
/.idea /.idea
/*.iml /*.iml
gradle.properties
*~ *~
.weblate .weblate
*.class *.class

View file

@ -8,10 +8,10 @@ android {
applicationId "org.schabi.newpipe" applicationId "org.schabi.newpipe"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
versionCode 780 versionCode 790
versionName "0.17.3" versionName "0.17.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
@ -43,37 +43,40 @@ android {
} }
ext { ext {
supportLibVersion = '28.0.0' androidxLibVersion = '1.0.0'
exoPlayerLibVersion = '2.9.6' exoPlayerLibVersion = '2.10.6'
roomDbLibVersion = '1.1.1' roomDbLibVersion = '2.1.0'
leakCanaryLibVersion = '1.5.4' //1.6.1 leakCanaryLibVersion = '1.5.4' //1.6.1
okHttpLibVersion = '3.12.1' okHttpLibVersion = '3.12.6'
icepickLibVersion = '3.2.0' icepickLibVersion = '3.2.0'
stethoLibVersion = '1.5.0' stethoLibVersion = '1.5.0'
} }
dependencies { dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude module: 'support-annotations' exclude module: 'support-annotations'
}) })
implementation 'com.github.teamnewpipe:NewPipeExtractor:6d504e08836b0b' implementation 'com.github.teamnewpipe:NewPipeExtractor:v0.17.4'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0' testImplementation 'org.mockito:mockito-core:2.23.0'
implementation "com.android.support:appcompat-v7:${supportLibVersion}" implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "com.android.support:support-v4:${supportLibVersion}" implementation "androidx.legacy:legacy-support-v4:${androidxLibVersion}"
implementation "com.android.support:design:${supportLibVersion}" implementation "com.google.android.material:material:${androidxLibVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}" implementation "androidx.recyclerview:recyclerview:${androidxLibVersion}"
implementation "com.android.support:preference-v14:${supportLibVersion}" implementation "androidx.legacy:legacy-preference-v14:${androidxLibVersion}"
implementation "com.android.support:cardview-v7:${supportLibVersion}" implementation "androidx.cardview:cardview:${androidxLibVersion}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Originally in NewPipeExtractor
implementation 'com.grack:nanojson:1.1'
implementation 'org.jsoup:jsoup:1.9.2'
implementation 'ch.acra:acra:4.9.2' //4.11 implementation 'ch.acra:acra:4.9.2' //4.11
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'de.hdodenhof:circleimageview:2.2.0' implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.nirhart:ParallaxScroll:dd53d1f9d1'
implementation 'com.nononsenseapps:filepicker:4.2.1' implementation 'com.nononsenseapps:filepicker:4.2.1'
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerLibVersion}" implementation "com.google.android.exoplayer:exoplayer:${exoPlayerLibVersion}"
@ -81,15 +84,15 @@ dependencies {
debugImplementation "com.facebook.stetho:stetho:${stethoLibVersion}" debugImplementation "com.facebook.stetho:stetho:${stethoLibVersion}"
debugImplementation "com.facebook.stetho:stetho-urlconnection:${stethoLibVersion}" debugImplementation "com.facebook.stetho:stetho-urlconnection:${stethoLibVersion}"
debugImplementation 'com.android.support:multidex:1.0.3' debugImplementation 'androidx.multidex:multidex:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2' implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1' implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation "android.arch.persistence.room:runtime:${roomDbLibVersion}" implementation "androidx.room:room-runtime:${roomDbLibVersion}"
implementation "android.arch.persistence.room:rxjava2:${roomDbLibVersion}" implementation "androidx.room:room-rxjava2:${roomDbLibVersion}"
annotationProcessor "android.arch.persistence.room:compiler:${roomDbLibVersion}" annotationProcessor "androidx.room:room-compiler:${roomDbLibVersion}"
implementation "frankiesardo:icepick:${icepickLibVersion}" implementation "frankiesardo:icepick:${icepickLibVersion}"
annotationProcessor "frankiesardo:icepick-processor:${icepickLibVersion}" annotationProcessor "frankiesardo:icepick-processor:${icepickLibVersion}"

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.report; package org.schabi.newpipe.report;
import android.os.Parcel; import android.os.Parcel;
import android.support.test.filters.LargeTest; import androidx.test.filters.LargeTest;
import android.support.test.runner.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View file

@ -3,8 +3,8 @@ package org.schabi.newpipe;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.multidex.MultiDex; import androidx.multidex.MultiDex;
import com.facebook.stetho.Stetho; import com.facebook.stetho.Stetho;
import com.facebook.stetho.okhttp3.StethoInterceptor; import com.facebook.stetho.okhttp3.StethoInterceptor;

View file

@ -29,7 +29,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<receiver android:name="android.support.v4.media.session.MediaButtonReceiver" > <receiver android:name="androidx.media.session.MediaButtonReceiver" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter> </intent-filter>
@ -115,7 +115,7 @@
android:label="@string/reCaptchaActivity"/> android:label="@string/reCaptchaActivity"/>
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider" android:authorities="${applicationId}.provider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">

View file

@ -1,116 +0,0 @@
package android.support.design.widget;
import android.animation.ValueAnimator;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.design.animation.AnimationUtils;
import android.util.AttributeSet;
import android.view.View;
// check this https://github.com/ToDou/appbarlayout-spring-behavior/blob/master/appbarspring/src/main/java/android/support/design/widget/AppBarFlingFixBehavior.java
public final class FlingBehavior extends AppBarLayout.Behavior {
private ValueAnimator mOffsetAnimator;
private static final int MAX_OFFSET_ANIMATION_DURATION = 600; // ms
public FlingBehavior() {
}
public FlingBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed, int type) {
if (dy != 0) {
int val = child.getBottom();
if (val != 0) {
int min, max;
if (dy < 0) {
// We're scrolling down
} else {
// We're scrolling up
if (mOffsetAnimator != null && mOffsetAnimator.isRunning()) {
mOffsetAnimator.cancel();
}
min = -child.getUpNestedPreScrollRange();
max = 0;
consumed[1] = scroll(coordinatorLayout, child, dy, min, max);
}
}
}
}
@Override
public boolean onNestedPreFling(@NonNull CoordinatorLayout coordinatorLayout, @NonNull AppBarLayout child, @NonNull View target, float velocityX, float velocityY) {
if (velocityY != 0) {
if (velocityY < 0) {
// We're flinging down
int val = child.getBottom();
if (val != 0) {
final int targetScroll =
+child.getDownNestedPreScrollRange();
animateOffsetTo(coordinatorLayout, child, targetScroll, velocityY);
}
} else {
// We're flinging up
int val = child.getBottom();
if (val != 0) {
final int targetScroll = -child.getUpNestedPreScrollRange();
if (getTopBottomOffsetForScrollingSibling() > targetScroll) {
animateOffsetTo(coordinatorLayout, child, targetScroll, velocityY);
}
}
}
}
return super.onNestedPreFling(coordinatorLayout, child, target, velocityX, velocityY);
}
private void animateOffsetTo(final CoordinatorLayout coordinatorLayout,
final AppBarLayout child, final int offset, float velocity) {
final int distance = Math.abs(getTopBottomOffsetForScrollingSibling() - offset);
final int duration;
velocity = Math.abs(velocity);
if (velocity > 0) {
duration = 3 * Math.round(1000 * (distance / velocity));
} else {
final float distanceRatio = (float) distance / child.getHeight();
duration = (int) ((distanceRatio + 1) * 150);
}
animateOffsetWithDuration(coordinatorLayout, child, offset, duration);
}
private void animateOffsetWithDuration(final CoordinatorLayout coordinatorLayout,
final AppBarLayout child, final int offset, final int duration) {
final int currentOffset = getTopBottomOffsetForScrollingSibling();
if (currentOffset == offset) {
if (mOffsetAnimator != null && mOffsetAnimator.isRunning()) {
mOffsetAnimator.cancel();
}
return;
}
if (mOffsetAnimator == null) {
mOffsetAnimator = new ValueAnimator();
mOffsetAnimator.setInterpolator(AnimationUtils.DECELERATE_INTERPOLATOR);
mOffsetAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animator) {
setHeaderTopBottomOffset(coordinatorLayout, child,
(Integer) animator.getAnimatedValue());
}
});
} else {
mOffsetAnimator.cancel();
}
mOffsetAnimator.setDuration(Math.min(duration, MAX_OFFSET_ANIMATION_DURATION));
mOffsetAnimator.setIntValues(currentOffset, offset);
mOffsetAnimator.start();
}
}

View file

@ -0,0 +1,82 @@
package com.google.android.material.appbar;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.OverScroller;
import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import java.lang.reflect.Field;
// check this https://stackoverflow.com/questions/56849221/recyclerview-fling-causes-laggy-while-appbarlayout-is-scrolling/57997489#57997489
public final class FlingBehavior extends AppBarLayout.Behavior {
public FlingBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) {
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
// remove reference to old nested scrolling child
resetNestedScrollingChild();
// Stop fling when your finger touches the screen
stopAppBarLayoutFling();
break;
default:
break;
}
return super.onInterceptTouchEvent(parent, child, ev);
}
@Nullable
private OverScroller getScrollerField() {
try {
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass().getSuperclass();
if (headerBehaviorType != null) {
Field field = headerBehaviorType.getDeclaredField("scroller");
field.setAccessible(true);
return ((OverScroller) field.get(this));
}
} catch (NoSuchFieldException | IllegalAccessException e) {
// ?
}
return null;
}
@Nullable
private Field getLastNestedScrollingChildRefField() {
try {
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass();
if (headerBehaviorType != null) {
Field field = headerBehaviorType.getDeclaredField("lastNestedScrollingChildRef");
field.setAccessible(true);
return field;
}
} catch (NoSuchFieldException e) {
// ?
}
return null;
}
private void resetNestedScrollingChild(){
Field field = getLastNestedScrollingChildRefField();
if(field != null){
try {
Object value = field.get(this);
if(value != null) field.set(this, null);
} catch (IllegalAccessException e) {
// ?
}
}
}
private void stopAppBarLayoutFling() {
OverScroller scroller = getScrollerField();
if (scroller != null) scroller.forceFinished(true);
}
}

View file

@ -6,8 +6,8 @@ import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.util.Log; import android.util.Log;
import com.nostra13.universalimageloader.cache.memory.impl.LRULimitedMemoryCache; import com.nostra13.universalimageloader.cache.memory.impl.LRULimitedMemoryCache;
@ -23,7 +23,6 @@ import org.acra.config.ConfigurationBuilder;
import org.acra.sender.ReportSenderFactory; import org.acra.sender.ReportSenderFactory;
import org.schabi.newpipe.extractor.Downloader; import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.utils.Localization;
import org.schabi.newpipe.report.AcraReportSenderFactory; import org.schabi.newpipe.report.AcraReportSenderFactory;
import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction; import org.schabi.newpipe.report.UserAction;

View file

@ -2,10 +2,10 @@ package org.schabi.newpipe;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;

View file

@ -12,8 +12,8 @@ import android.net.ConnectivityManager;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
import android.util.Log; import android.util.Log;
import org.json.JSONException; import org.json.JSONException;
@ -21,13 +21,9 @@ import org.json.JSONObject;
import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction; import org.schabi.newpipe.report.UserAction;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateEncodingException;
@ -38,7 +34,6 @@ import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response; import okhttp3.Response;
/** /**

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe; package org.schabi.newpipe;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import org.schabi.newpipe.extractor.DownloadRequest; import org.schabi.newpipe.extractor.DownloadRequest;
@ -10,7 +10,6 @@ import org.schabi.newpipe.extractor.utils.Localization;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -222,7 +221,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
return null; return null;
} }
return new DownloadResponse(body.string(), response.headers().toMultimap()); return new DownloadResponse(response.code(), body.string(), response.headers().toMultimap());
} }
@Override @Override
@ -242,7 +241,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
String contentType = requestHeaders.get("Content-Type").get(0); String contentType = requestHeaders.get("Content-Type").get(0);
RequestBody okRequestBody = null; RequestBody okRequestBody = null;
if(null != request.getRequestBody()){ if (null != request.getRequestBody()) {
okRequestBody = RequestBody.create(MediaType.parse(contentType), request.getRequestBody()); okRequestBody = RequestBody.create(MediaType.parse(contentType), request.getRequestBody());
} }
final Request.Builder requestBuilder = new Request.Builder() final Request.Builder requestBuilder = new Request.Builder()
@ -276,6 +275,22 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
return null; return null;
} }
return new DownloadResponse(body.string(), response.headers().toMultimap()); return new DownloadResponse(response.code(), body.string(), response.headers().toMultimap());
} }
@Override
public DownloadResponse head(String siteUrl) throws IOException, ReCaptchaException {
final Request request = new Request.Builder()
.head().url(siteUrl)
.addHeader("User-Agent", USER_AGENT)
.build();
final Response response = client.newCall(request).execute();
if (response.code() == 429) {
throw new ReCaptchaException("reCaptcha Challenge requested", siteUrl);
}
return new DownloadResponse(response.code(), null, response.headers().toMultimap());
}
} }

View file

@ -28,17 +28,7 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
@ -49,6 +39,17 @@ import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import com.google.android.material.navigation.NavigationView;
import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ExtractionException;
@ -73,6 +74,7 @@ public class MainActivity extends AppCompatActivity {
private DrawerLayout drawer = null; private DrawerLayout drawer = null;
private NavigationView drawerItems = null; private NavigationView drawerItems = null;
private TextView headerServiceView = null; private TextView headerServiceView = null;
private Button toggleServiceButton = null;
private boolean servicesShown = false; private boolean servicesShown = false;
private ImageView serviceArrow; private ImageView serviceArrow;
@ -266,8 +268,8 @@ public class MainActivity extends AppCompatActivity {
serviceArrow = hView.findViewById(R.id.drawer_arrow); serviceArrow = hView.findViewById(R.id.drawer_arrow);
headerServiceView = hView.findViewById(R.id.drawer_header_service_view); headerServiceView = hView.findViewById(R.id.drawer_header_service_view);
Button action = hView.findViewById(R.id.drawer_header_action_button); toggleServiceButton = hView.findViewById(R.id.drawer_header_action_button);
action.setOnClickListener(view -> { toggleServiceButton.setOnClickListener(view -> {
toggleServices(); toggleServices();
}); });
} }
@ -279,6 +281,7 @@ public class MainActivity extends AppCompatActivity {
drawerItems.getMenu().removeGroup(R.id.menu_tabs_group); drawerItems.getMenu().removeGroup(R.id.menu_tabs_group);
drawerItems.getMenu().removeGroup(R.id.menu_options_about_group); drawerItems.getMenu().removeGroup(R.id.menu_options_about_group);
if(servicesShown) { if(servicesShown) {
showServices(); showServices();
} else { } else {
@ -359,11 +362,13 @@ public class MainActivity extends AppCompatActivity {
// close drawer on return, and don't show animation, so its looks like the drawer isn't open // close drawer on return, and don't show animation, so its looks like the drawer isn't open
// when the user returns to MainActivity // when the user returns to MainActivity
drawer.closeDrawer(Gravity.START, false); drawer.closeDrawer(GravityCompat.START, false);
try { try {
String selectedServiceName = NewPipe.getService( String selectedServiceName = NewPipe.getService(
ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName(); ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName();
headerServiceView.setText(selectedServiceName); headerServiceView.setText(selectedServiceName);
toggleServiceButton.setContentDescription(
getString(R.string.drawer_header_description) + selectedServiceName);
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError(this, e); ErrorActivity.reportUiError(this, e);
} }
@ -557,6 +562,14 @@ public class MainActivity extends AppCompatActivity {
} }
} }
private void updateDrawerHeaderString(String content) {
NavigationView navigationView = findViewById(R.id.navigation);
View hView = navigationView.getHeaderView(0);
Button action = hView.findViewById(R.id.drawer_header_action_button);
action.setContentDescription(content);
}
private void handleIntent(Intent intent) { private void handleIntent(Intent intent) {
try { try {
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]"); if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe; package org.schabi.newpipe;
import android.arch.persistence.room.Room; import androidx.room.Room;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import org.schabi.newpipe.database.AppDatabase; import org.schabi.newpipe.database.AppDatabase;

View file

@ -5,13 +5,12 @@ import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils; import androidx.core.app.NavUtils;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.webkit.CookieManager; import android.webkit.CookieManager;
import android.webkit.ValueCallback;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;

View file

@ -9,12 +9,12 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -26,6 +26,8 @@ import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.Toast; import android.widget.Toast;
import androidx.fragment.app.FragmentManager;
import org.schabi.newpipe.download.DownloadDialog; import org.schabi.newpipe.download.DownloadDialog;
import org.schabi.newpipe.extractor.Info; import org.schabi.newpipe.extractor.Info;
import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.NewPipe;
@ -433,7 +435,7 @@ public class RouterActivity extends AppCompatActivity {
int selectedVideoStreamIndex = ListHelper.getDefaultResolutionIndex(this, int selectedVideoStreamIndex = ListHelper.getDefaultResolutionIndex(this,
sortedVideoStreams); sortedVideoStreams);
android.support.v4.app.FragmentManager fm = getSupportFragmentManager(); FragmentManager fm = getSupportFragmentManager();
DownloadDialog downloadDialog = DownloadDialog.newInstance(result); DownloadDialog downloadDialog = DownloadDialog.newInstance(result);
downloadDialog.setVideoStreams(sortedVideoStreams); downloadDialog.setVideoStreams(sortedVideoStreams);
downloadDialog.setAudioStreams(result.getAudioStreams()); downloadDialog.setAudioStreams(result.getAudioStreams());

View file

@ -4,13 +4,15 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.TabLayout; import com.google.android.material.tabs.TabLayout;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager; import androidx.fragment.app.FragmentStatePagerAdapter;
import android.support.v7.app.AppCompatActivity; import androidx.viewpager.widget.PagerAdapter;
import android.support.v7.widget.Toolbar; import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -36,7 +38,6 @@ public class AboutActivity extends AppCompatActivity {
new SoftwareComponent("ACRA", "2013", "Kevin Gaudin", "http://www.acra.ch", StandardLicenses.APACHE2), new SoftwareComponent("ACRA", "2013", "Kevin Gaudin", "http://www.acra.ch", StandardLicenses.APACHE2),
new SoftwareComponent("Universal Image Loader", "2011 - 2015", "Sergey Tarasevich", "https://github.com/nostra13/Android-Universal-Image-Loader", StandardLicenses.APACHE2), new SoftwareComponent("Universal Image Loader", "2011 - 2015", "Sergey Tarasevich", "https://github.com/nostra13/Android-Universal-Image-Loader", StandardLicenses.APACHE2),
new SoftwareComponent("CircleImageView", "2014 - 2017", "Henning Dodenhof", "https://github.com/hdodenhof/CircleImageView", StandardLicenses.APACHE2), new SoftwareComponent("CircleImageView", "2014 - 2017", "Henning Dodenhof", "https://github.com/hdodenhof/CircleImageView", StandardLicenses.APACHE2),
new SoftwareComponent("ParalaxScrollView", "2014", "Nir Hartmann", "https://github.com/nirhart/ParallaxScroll", StandardLicenses.MIT),
new SoftwareComponent("NoNonsense-FilePicker", "2016", "Jonas Kalderstam", "https://github.com/spacecowboy/NoNonsense-FilePicker", StandardLicenses.MPL2), new SoftwareComponent("NoNonsense-FilePicker", "2016", "Jonas Kalderstam", "https://github.com/spacecowboy/NoNonsense-FilePicker", StandardLicenses.MPL2),
new SoftwareComponent("ExoPlayer", "2014-2017", "Google Inc", "https://github.com/google/ExoPlayer", StandardLicenses.APACHE2), new SoftwareComponent("ExoPlayer", "2014-2017", "Google Inc", "https://github.com/google/ExoPlayer", StandardLicenses.APACHE2),
new SoftwareComponent("RxAndroid", "2015", "The RxAndroid authors", "https://github.com/ReactiveX/RxAndroid", StandardLicenses.APACHE2), new SoftwareComponent("RxAndroid", "2015", "The RxAndroid authors", "https://github.com/ReactiveX/RxAndroid", StandardLicenses.APACHE2),
@ -45,12 +46,12 @@ public class AboutActivity extends AppCompatActivity {
}; };
/** /**
* The {@link android.support.v4.view.PagerAdapter} that will provide * The {@link PagerAdapter} that will provide
* fragments for each of the sections. We use a * fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every * {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it * loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a * may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}. * {@link FragmentStatePagerAdapter}.
*/ */
private SectionsPagerAdapter mSectionsPagerAdapter; private SectionsPagerAdapter mSectionsPagerAdapter;

View file

@ -5,8 +5,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.*; import android.view.*;
import android.widget.TextView; import android.widget.TextView;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;

View file

@ -4,8 +4,8 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.webkit.WebView; import android.webkit.WebView;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.ThemeHelper;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.database; package org.schabi.newpipe.database;
import android.arch.persistence.room.Database; import androidx.room.Database;
import android.arch.persistence.room.RoomDatabase; import androidx.room.RoomDatabase;
import android.arch.persistence.room.TypeConverters; import androidx.room.TypeConverters;
import org.schabi.newpipe.database.history.dao.SearchHistoryDAO; import org.schabi.newpipe.database.history.dao.SearchHistoryDAO;
import org.schabi.newpipe.database.history.dao.StreamHistoryDAO; import org.schabi.newpipe.database.history.dao.StreamHistoryDAO;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database; package org.schabi.newpipe.database;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Delete; import androidx.room.Delete;
import android.arch.persistence.room.Insert; import androidx.room.Insert;
import android.arch.persistence.room.OnConflictStrategy; import androidx.room.OnConflictStrategy;
import android.arch.persistence.room.Update; import androidx.room.Update;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.database; package org.schabi.newpipe.database;
import android.arch.persistence.room.TypeConverter; import androidx.room.TypeConverter;
import org.schabi.newpipe.extractor.stream.StreamType; import org.schabi.newpipe.extractor.stream.StreamType;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.database; package org.schabi.newpipe.database;
import android.arch.persistence.db.SupportSQLiteDatabase; import androidx.sqlite.db.SupportSQLiteDatabase;
import android.arch.persistence.room.migration.Migration; import androidx.room.migration.Migration;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.util.Log; import android.util.Log;
import org.schabi.newpipe.BuildConfig; import org.schabi.newpipe.BuildConfig;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.database.history.dao; package org.schabi.newpipe.database.history.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import org.schabi.newpipe.database.history.model.SearchHistoryEntry; import org.schabi.newpipe.database.history.model.SearchHistoryEntry;

View file

@ -1,9 +1,9 @@
package org.schabi.newpipe.database.history.dao; package org.schabi.newpipe.database.history.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import org.schabi.newpipe.database.history.model.StreamHistoryEntry; import org.schabi.newpipe.database.history.model.StreamHistoryEntry;
import org.schabi.newpipe.database.stream.StreamStatisticsEntry; import org.schabi.newpipe.database.stream.StreamStatisticsEntry;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.history.model; package org.schabi.newpipe.database.history.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.Ignore; import androidx.room.Ignore;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import java.util.Date; import java.util.Date;

View file

@ -1,17 +1,17 @@
package org.schabi.newpipe.database.history.model; package org.schabi.newpipe.database.history.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.ForeignKey; import androidx.room.ForeignKey;
import android.arch.persistence.room.Ignore; import androidx.room.Ignore;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import org.schabi.newpipe.database.stream.model.StreamEntity; import org.schabi.newpipe.database.stream.model.StreamEntity;
import java.util.Date; import java.util.Date;
import static android.arch.persistence.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE; import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.JOIN_STREAM_ID; import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_ACCESS_DATE; import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_ACCESS_DATE;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.database.history.model; package org.schabi.newpipe.database.history.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import org.schabi.newpipe.database.stream.model.StreamEntity; import org.schabi.newpipe.database.stream.model.StreamEntity;
import org.schabi.newpipe.extractor.stream.StreamType; import org.schabi.newpipe.extractor.stream.StreamType;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.database.playlist; package org.schabi.newpipe.database.playlist;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_ID; import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_NAME; import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_NAME;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.database.playlist; package org.schabi.newpipe.database.playlist;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import org.schabi.newpipe.database.LocalItem; import org.schabi.newpipe.database.LocalItem;
import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity; import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.database.playlist.dao; package org.schabi.newpipe.database.playlist.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Query; import androidx.room.Query;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;
import org.schabi.newpipe.database.playlist.model.PlaylistEntity; import org.schabi.newpipe.database.playlist.model.PlaylistEntity;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.database.playlist.dao; package org.schabi.newpipe.database.playlist.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.arch.persistence.room.Transaction; import androidx.room.Transaction;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;
import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity; import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.database.playlist.dao; package org.schabi.newpipe.database.playlist.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.arch.persistence.room.Transaction; import androidx.room.Transaction;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;
import org.schabi.newpipe.database.playlist.PlaylistMetadataEntry; import org.schabi.newpipe.database.playlist.PlaylistMetadataEntry;

View file

@ -1,9 +1,9 @@
package org.schabi.newpipe.database.playlist.model; package org.schabi.newpipe.database.playlist.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_NAME; import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_NAME;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_TABLE; import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_TABLE;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.playlist.model; package org.schabi.newpipe.database.playlist.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.Ignore; import androidx.room.Ignore;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import org.schabi.newpipe.database.playlist.PlaylistLocalItem; import org.schabi.newpipe.database.playlist.PlaylistLocalItem;
import org.schabi.newpipe.extractor.playlist.PlaylistInfo; import org.schabi.newpipe.extractor.playlist.PlaylistInfo;

View file

@ -1,13 +1,13 @@
package org.schabi.newpipe.database.playlist.model; package org.schabi.newpipe.database.playlist.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.ForeignKey; import androidx.room.ForeignKey;
import android.arch.persistence.room.Index; import androidx.room.Index;
import org.schabi.newpipe.database.stream.model.StreamEntity; import org.schabi.newpipe.database.stream.model.StreamEntity;
import static android.arch.persistence.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_INDEX; import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_INDEX;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_PLAYLIST_ID; import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_STREAM_ID; import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_STREAM_ID;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.database.stream; package org.schabi.newpipe.database.stream;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import org.schabi.newpipe.database.LocalItem; import org.schabi.newpipe.database.LocalItem;
import org.schabi.newpipe.database.history.model.StreamHistoryEntity; import org.schabi.newpipe.database.history.model.StreamHistoryEntity;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.stream.dao; package org.schabi.newpipe.database.stream.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Insert; import androidx.room.Insert;
import android.arch.persistence.room.OnConflictStrategy; import androidx.room.OnConflictStrategy;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.arch.persistence.room.Transaction; import androidx.room.Transaction;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;
import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity; import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.stream.dao; package org.schabi.newpipe.database.stream.dao;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Insert; import androidx.room.Insert;
import android.arch.persistence.room.OnConflictStrategy; import androidx.room.OnConflictStrategy;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.arch.persistence.room.Transaction; import androidx.room.Transaction;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;
import org.schabi.newpipe.database.stream.model.StreamStateEntity; import org.schabi.newpipe.database.stream.model.StreamStateEntity;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.stream.model; package org.schabi.newpipe.database.stream.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.Ignore; import androidx.room.Ignore;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;

View file

@ -1,14 +1,14 @@
package org.schabi.newpipe.database.stream.model; package org.schabi.newpipe.database.stream.model;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.ForeignKey; import androidx.room.ForeignKey;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static android.arch.persistence.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.JOIN_STREAM_ID; import static org.schabi.newpipe.database.stream.model.StreamStateEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_STATE_TABLE; import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_STATE_TABLE;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.database.subscription; package org.schabi.newpipe.database.subscription;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Insert; import androidx.room.Insert;
import android.arch.persistence.room.OnConflictStrategy; import androidx.room.OnConflictStrategy;
import android.arch.persistence.room.Query; import androidx.room.Query;
import android.arch.persistence.room.Transaction; import androidx.room.Transaction;
import org.schabi.newpipe.database.BasicDAO; import org.schabi.newpipe.database.BasicDAO;

View file

@ -1,11 +1,11 @@
package org.schabi.newpipe.database.subscription; package org.schabi.newpipe.database.subscription;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.Ignore; import androidx.room.Ignore;
import android.arch.persistence.room.Index; import androidx.room.Index;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import org.schabi.newpipe.extractor.channel.ChannelInfo; import org.schabi.newpipe.extractor.channel.ChannelInfo;
import org.schabi.newpipe.extractor.channel.ChannelInfoItem; import org.schabi.newpipe.extractor.channel.ChannelInfoItem;

View file

@ -3,9 +3,9 @@ package org.schabi.newpipe.download;
import android.app.FragmentTransaction; import android.app.FragmentTransaction;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -11,15 +11,15 @@ import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.IdRes; import androidx.annotation.IdRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.support.v4.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import android.support.v4.provider.DocumentFile; import androidx.documentfile.provider.DocumentFile;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.view.menu.ActionMenuItemView; import androidx.appcompat.view.menu.ActionMenuItemView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -359,6 +359,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp); toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp);
toolbar.inflateMenu(R.menu.dialog_url); toolbar.inflateMenu(R.menu.dialog_url);
toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss());
toolbar.setNavigationContentDescription(R.string.cancel);
okButton = toolbar.findViewById(R.id.okay); okButton = toolbar.findViewById(R.id.okay);
okButton.setEnabled(false);// disable until the download service connection is done okButton.setEnabled(false);// disable until the download service connection is done

View file

@ -1,10 +1,9 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,15 +1,6 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -18,6 +9,17 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import org.schabi.newpipe.BaseFragment; import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ExtractionException;
@ -111,8 +113,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
tabsManager.unsetSavedTabsListener(); tabsManager.unsetSavedTabsListener();
pagerAdapter = null; if (viewPager != null) viewPager.setAdapter(null);
viewPager.setAdapter(pagerAdapter);
} }
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
@ -159,6 +160,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
viewPager.setOffscreenPageLimit(pagerAdapter.getCount()); viewPager.setOffscreenPageLimit(pagerAdapter.getCount());
updateTabsIcon(); updateTabsIcon();
updateTabsContentDescription();
updateCurrentTitle(); updateCurrentTitle();
} }
@ -171,6 +173,17 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
} }
} }
private void updateTabsContentDescription() {
for (int i = 0; i < tabsList.size(); i++) {
final TabLayout.Tab tabToSet = tabLayout.getTabAt(i);
if (tabToSet != null) {
final Tab t = tabsList.get(i);
tabToSet.setIcon(t.getTabIconRes(activity));
tabToSet.setContentDescription(t.getTabName(activity));
}
}
}
private void updateCurrentTitle() { private void updateCurrentTitle() {
setTitle(tabsList.get(viewPager.getCurrentItem()).getTabName(requireContext())); setTitle(tabsList.get(viewPager.getCurrentItem()).getTabName(requireContext()));
} }

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager; import androidx.recyclerview.widget.StaggeredGridLayoutManager;
/** /**
* Recycler view scroll listener which calls the method {@link #onScrolledDown(RecyclerView)} * Recycler view scroll listener which calls the method {@link #onScrolledDown(RecyclerView)}

View file

@ -1,9 +1,9 @@
package org.schabi.newpipe.fragments.detail; package org.schabi.newpipe.fragments.detail;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import android.view.ViewGroup; import android.view.ViewGroup;
import java.util.ArrayList; import java.util.ArrayList;

View file

@ -9,17 +9,17 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import android.support.design.widget.TabLayout; import com.google.android.material.tabs.TabLayout;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v4.view.ViewPager; import androidx.viewpager.widget.ViewPager;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.Html; import android.text.Html;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;

View file

@ -7,12 +7,12 @@ import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;

View file

@ -1,11 +1,12 @@
package org.schabi.newpipe.fragments.list; package org.schabi.newpipe.fragments.list;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull;
import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.ListInfo; import org.schabi.newpipe.extractor.ListInfo;
import org.schabi.newpipe.util.Constants; import org.schabi.newpipe.util.Constants;
@ -61,9 +62,11 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
if (currentWorker != null) currentWorker.dispose(); if (currentWorker != null) {
currentWorker.dispose();
currentWorker = null; currentWorker = null;
} }
}
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// State Saving // State Saving

View file

@ -4,10 +4,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View file

@ -2,8 +2,8 @@ package org.schabi.newpipe.fragments.list.comments;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -93,7 +93,7 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
public void handleResult(@NonNull CommentsInfo result) { public void handleResult(@NonNull CommentsInfo result) {
super.handleResult(result); super.handleResult(result);
AnimationUtils.slideUp(getView(),120, 96, 0.06f); AnimationUtils.slideUp(getView(),120, 150, 0.06f);
if (!result.getErrors().isEmpty()) { if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0); showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);

View file

@ -1,9 +1,9 @@
package org.schabi.newpipe.fragments.list.kiosk; package org.schabi.newpipe.fragments.list.kiosk;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;

View file

@ -3,10 +3,9 @@ package org.schabi.newpipe.fragments.list.playlist;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View file

@ -6,13 +6,13 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.TooltipCompat; import androidx.appcompat.widget.TooltipCompat;
import android.support.v7.widget.helper.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
@ -73,7 +73,7 @@ import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject; import io.reactivex.subjects.PublishSubject;
import static android.support.v7.widget.helper.ItemTouchHelper.Callback.makeMovementFlags; import static androidx.recyclerview.widget.ItemTouchHelper.Callback.makeMovementFlags;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static org.schabi.newpipe.util.AnimationUtils.animateView; import static org.schabi.newpipe.util.AnimationUtils.animateView;

View file

@ -2,8 +2,8 @@ package org.schabi.newpipe.fragments.list.search;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.support.annotation.AttrRes; import androidx.annotation.AttrRes;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -4,8 +4,8 @@ import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.info_list; package org.schabi.newpipe.info_list;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -3,8 +3,8 @@ package org.schabi.newpipe.info_list;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.info_list; package org.schabi.newpipe.info_list;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.info_list.holder; package org.schabi.newpipe.info_list.holder;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.util.Linkify; import android.text.util.Linkify;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.info_list.holder; package org.schabi.newpipe.info_list.holder;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.info_list.holder; package org.schabi.newpipe.info_list.holder;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;

View file

@ -5,11 +5,11 @@ import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.local; package org.schabi.newpipe.local;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.View; import android.view.View;
public class HeaderFooterHolder extends RecyclerView.ViewHolder { public class HeaderFooterHolder extends RecyclerView.ViewHolder {

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.local; package org.schabi.newpipe.local;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -3,9 +3,9 @@ package org.schabi.newpipe.local.bookmark;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,10 +1,10 @@
package org.schabi.newpipe.local.dialog; package org.schabi.newpipe.local.dialog;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -3,8 +3,8 @@ package org.schabi.newpipe.local.dialog;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;

View file

@ -2,9 +2,9 @@ package org.schabi.newpipe.local.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import android.view.Window; import android.view.Window;
import org.schabi.newpipe.database.stream.model.StreamEntity; import org.schabi.newpipe.database.stream.model.StreamEntity;

View file

@ -2,9 +2,9 @@ package org.schabi.newpipe.local.feed;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -183,7 +183,7 @@ public class FeedFragment extends BaseListFragment<List<SubscriptionEntity>, Voi
} }
@Override @Override
public void handleResult(@android.support.annotation.NonNull List<SubscriptionEntity> result) { public void handleResult(@androidx.annotation.NonNull List<SubscriptionEntity> result) {
super.handleResult(result); super.handleResult(result);
if (result.isEmpty()) { if (result.isEmpty()) {

View file

@ -1,9 +1,9 @@
package org.schabi.newpipe.local.history; package org.schabi.newpipe.local.history;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import org.schabi.newpipe.util.Localization; import org.schabi.newpipe.util.Localization;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.local.history; package org.schabi.newpipe.local.history;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import org.schabi.newpipe.extractor.stream.AudioStream; import org.schabi.newpipe.extractor.stream.AudioStream;
import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.StreamInfo;

View file

@ -21,7 +21,7 @@ package org.schabi.newpipe.local.history;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import org.schabi.newpipe.NewPipeDatabase; import org.schabi.newpipe.NewPipeDatabase;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
@ -51,7 +51,6 @@ import java.util.List;
import io.reactivex.Completable; import io.reactivex.Completable;
import io.reactivex.Flowable; import io.reactivex.Flowable;
import io.reactivex.Maybe; import io.reactivex.Maybe;
import io.reactivex.Scheduler;
import io.reactivex.Single; import io.reactivex.Single;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;

View file

@ -4,10 +4,10 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.Snackbar; import com.google.android.material.snackbar.Snackbar;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -22,7 +22,6 @@ import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription; import org.reactivestreams.Subscription;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.database.LocalItem; import org.schabi.newpipe.database.LocalItem;
import org.schabi.newpipe.database.playlist.PlaylistStreamEntry;
import org.schabi.newpipe.database.stream.StreamStatisticsEntry; import org.schabi.newpipe.database.stream.StreamStatisticsEntry;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.stream.StreamType; import org.schabi.newpipe.extractor.stream.StreamType;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.local.holder; package org.schabi.newpipe.local.holder;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.local.holder; package org.schabi.newpipe.local.holder;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.local.holder; package org.schabi.newpipe.local.holder;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;

View file

@ -4,11 +4,11 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.local.playlist; package org.schabi.newpipe.local.playlist;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import org.schabi.newpipe.database.AppDatabase; import org.schabi.newpipe.database.AppDatabase;
import org.schabi.newpipe.database.playlist.PlaylistMetadataEntry; import org.schabi.newpipe.database.playlist.PlaylistMetadataEntry;

View file

@ -4,10 +4,10 @@ import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.ThemeHelper;

View file

@ -19,7 +19,7 @@
package org.schabi.newpipe.local.subscription; package org.schabi.newpipe.local.subscription;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import com.grack.nanojson.JsonAppendableWriter; import com.grack.nanojson.JsonAppendableWriter;
import com.grack.nanojson.JsonArray; import com.grack.nanojson.JsonArray;

View file

@ -17,15 +17,15 @@ import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Parcelable; import android.os.Parcelable;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.local.subscription; package org.schabi.newpipe.local.subscription;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.util.Log; import android.util.Log;
import org.schabi.newpipe.MainActivity; import org.schabi.newpipe.MainActivity;
@ -93,7 +93,7 @@ public class SubscriptionService {
* in the cooldown interval, only the latest changes are emitted to the subscribers. * in the cooldown interval, only the latest changes are emitted to the subscribers.
* This reduces the amount of observations caused by frequent updates to the database. * This reduces the amount of observations caused by frequent updates to the database.
*/ */
@android.support.annotation.NonNull @androidx.annotation.NonNull
public Flowable<List<SubscriptionEntity>> getSubscription() { public Flowable<List<SubscriptionEntity>> getSubscription() {
return subscription; return subscription;
} }

View file

@ -3,11 +3,11 @@ package org.schabi.newpipe.local.subscription;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.support.v4.text.util.LinkifyCompat; import androidx.core.text.util.LinkifyCompat;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.util.Linkify; import android.text.util.Linkify;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View file

@ -23,11 +23,11 @@ import android.app.Service;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.widget.Toast; import android.widget.Toast;

View file

@ -20,7 +20,7 @@
package org.schabi.newpipe.local.subscription.services; package org.schabi.newpipe.local.subscription.services;
import android.content.Intent; import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;

View file

@ -20,9 +20,9 @@
package org.schabi.newpipe.local.subscription.services; package org.schabi.newpipe.local.subscription.services;
import android.content.Intent; import android.content.Intent;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;

View file

@ -28,9 +28,9 @@ import android.content.IntentFilter;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.RemoteViews; import android.widget.RemoteViews;

View file

@ -28,12 +28,13 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.media.AudioManager; import android.media.AudioManager;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.DefaultRenderersFactory; import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayerFactory; import com.google.android.exoplayer2.ExoPlayerFactory;
@ -209,7 +210,7 @@ public abstract class BasePlayer implements
this.databaseUpdateReactor = new CompositeDisposable(); this.databaseUpdateReactor = new CompositeDisposable();
final String userAgent = Downloader.USER_AGENT; final String userAgent = Downloader.USER_AGENT;
final DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); final DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter.Builder(context).build();
this.dataSource = new PlayerDataSource(context, userAgent, bandwidthMeter); this.dataSource = new PlayerDataSource(context, userAgent, bandwidthMeter);
final TrackSelection.Factory trackSelectionFactory = PlayerHelper.getQualitySelector(context); final TrackSelection.Factory trackSelectionFactory = PlayerHelper.getQualitySelector(context);
@ -1193,10 +1194,7 @@ public abstract class BasePlayer implements
} }
public boolean isPlaying() { public boolean isPlaying() {
if (simpleExoPlayer == null) return false; return simpleExoPlayer != null && simpleExoPlayer.isPlaying();
final int state = simpleExoPlayer.getPlaybackState();
return (state == Player.STATE_READY || state == Player.STATE_BUFFERING)
&& simpleExoPlayer.getPlayWhenReady();
} }
@Player.RepeatMode @Player.RepeatMode

View file

@ -33,14 +33,14 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.player; package org.schabi.newpipe.player;
import android.os.Binder; import android.os.Binder;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
class PlayerServiceBinder extends Binder { class PlayerServiceBinder extends Binder {
private final BasePlayer basePlayer; private final BasePlayer basePlayer;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.player; package org.schabi.newpipe.player;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import org.schabi.newpipe.player.playqueue.PlayQueue; import org.schabi.newpipe.player.playqueue.PlayQueue;

View file

@ -35,9 +35,9 @@ import android.graphics.PixelFormat;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.design.widget.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
import android.view.GestureDetector; import android.view.GestureDetector;

View file

@ -6,11 +6,11 @@ import android.content.ServiceConnection;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.provider.Settings; import android.provider.Settings;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.support.v7.widget.helper.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -31,9 +31,9 @@ import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -9,7 +9,7 @@ import android.media.AudioFocusRequest;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.audiofx.AudioEffect; import android.media.audiofx.AudioEffect;
import android.os.Build; import android.os.Build;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.util.Log; import android.util.Log;
import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.SimpleExoPlayer;

Some files were not shown because too many files have changed in this diff Show more