mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-03 17:59:41 +02:00
Fix Checkstyle & remove unused fields
This commit is contained in:
parent
150649aea9
commit
01f9a3de33
3 changed files with 5 additions and 21 deletions
|
@ -5,11 +5,6 @@ import android.content.Intent;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.schabi.newpipe.MainActivity;
|
|
||||||
import org.schabi.newpipe.error.ErrorInfo;
|
|
||||||
import org.schabi.newpipe.error.ErrorUtil;
|
|
||||||
import org.schabi.newpipe.error.UserAction;
|
|
||||||
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;
|
||||||
|
@ -21,15 +16,11 @@ import org.schabi.newpipe.util.NavigationHelper;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
|
||||||
|
|
||||||
public final class InternalUrlsHandler {
|
public final class InternalUrlsHandler {
|
||||||
private static final String TAG = InternalUrlsHandler.class.getSimpleName();
|
|
||||||
private static final boolean DEBUG = MainActivity.DEBUG;
|
|
||||||
|
|
||||||
private static final Pattern AMPERSAND_TIMESTAMP_PATTERN = Pattern.compile("(.*)&t=(\\d+)");
|
private static final Pattern AMPERSAND_TIMESTAMP_PATTERN = Pattern.compile("(.*)&t=(\\d+)");
|
||||||
private static final Pattern HASHTAG_TIMESTAMP_PATTERN =
|
|
||||||
Pattern.compile("(.*)#timestamp=(\\d+)");
|
private InternalUrlsHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a YouTube timestamp description URL in NewPipe.
|
* Handle a YouTube timestamp description URL in NewPipe.
|
||||||
|
@ -39,7 +30,6 @@ public final class InternalUrlsHandler {
|
||||||
* player will be opened when the user will click on the timestamp in the video description,
|
* player will be opened when the user will click on the timestamp in the video description,
|
||||||
* at the time and for the video indicated in the timestamp.
|
* at the time and for the video indicated in the timestamp.
|
||||||
*
|
*
|
||||||
* @param disposables a field of the Activity/Fragment class that calls this method
|
|
||||||
* @param context the context to use
|
* @param context the context to use
|
||||||
* @param url the URL to check if it can be handled
|
* @param url the URL to check if it can be handled
|
||||||
* @return true if the URL can be handled by NewPipe, false if it cannot
|
* @return true if the URL can be handled by NewPipe, false if it cannot
|
||||||
|
|
|
@ -192,7 +192,7 @@ public final class TextLinkifier {
|
||||||
* <p>
|
* <p>
|
||||||
* Instead of using an {@link android.content.Intent#ACTION_VIEW} intent in the description of
|
* Instead of using an {@link android.content.Intent#ACTION_VIEW} intent in the description of
|
||||||
* a content, this method will parse the {@link CharSequence} and replace all current web links
|
* a content, this method will parse the {@link CharSequence} and replace all current web links
|
||||||
* with {@link ShareUtils#openUrlInBrowser(Context, String, boolean)}.
|
* with {@link ShareUtils#openUrlInBrowser(Context, String)}.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -240,7 +240,7 @@ public final class TextLinkifier {
|
||||||
for (final URLSpan span : urls) {
|
for (final URLSpan span : urls) {
|
||||||
final String url = span.getURL();
|
final String url = span.getURL();
|
||||||
final LongPressClickableSpan longPressClickableSpan =
|
final LongPressClickableSpan longPressClickableSpan =
|
||||||
new UrlLongPressClickableSpan(context, disposables, url);
|
new UrlLongPressClickableSpan(context, url);
|
||||||
|
|
||||||
textBlockLinked.setSpan(longPressClickableSpan,
|
textBlockLinked.setSpan(longPressClickableSpan,
|
||||||
textBlockLinked.getSpanStart(span),
|
textBlockLinked.getSpanStart(span),
|
||||||
|
|
|
@ -7,22 +7,16 @@ import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.schabi.newpipe.util.external_communication.ShareUtils;
|
import org.schabi.newpipe.util.external_communication.ShareUtils;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
|
||||||
|
|
||||||
final class UrlLongPressClickableSpan extends LongPressClickableSpan {
|
final class UrlLongPressClickableSpan extends LongPressClickableSpan {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final Context context;
|
private final Context context;
|
||||||
@NonNull
|
@NonNull
|
||||||
private final CompositeDisposable disposables;
|
|
||||||
@NonNull
|
|
||||||
private final String url;
|
private final String url;
|
||||||
|
|
||||||
UrlLongPressClickableSpan(@NonNull final Context context,
|
UrlLongPressClickableSpan(@NonNull final Context context,
|
||||||
@NonNull final CompositeDisposable disposables,
|
|
||||||
@NonNull final String url) {
|
@NonNull final String url) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.disposables = disposables;
|
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue