Skip to content

Commit 01f9a3d

Browse files
committed
Fix Checkstyle & remove unused fields
1 parent 150649a commit 01f9a3d

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

app/src/main/java/org/schabi/newpipe/util/text/InternalUrlsHandler.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
import androidx.core.content.ContextCompat;
66

77
import androidx.annotation.NonNull;
8-
9-
import org.schabi.newpipe.MainActivity;
10-
import org.schabi.newpipe.error.ErrorInfo;
11-
import org.schabi.newpipe.error.ErrorUtil;
12-
import org.schabi.newpipe.error.UserAction;
138
import org.schabi.newpipe.extractor.NewPipe;
149
import org.schabi.newpipe.extractor.StreamingService;
1510
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
@@ -21,15 +16,11 @@
2116
import java.util.regex.Matcher;
2217
import java.util.regex.Pattern;
2318

24-
import io.reactivex.rxjava3.disposables.CompositeDisposable;
25-
2619
public final class InternalUrlsHandler {
27-
private static final String TAG = InternalUrlsHandler.class.getSimpleName();
28-
private static final boolean DEBUG = MainActivity.DEBUG;
29-
3020
private static final Pattern AMPERSAND_TIMESTAMP_PATTERN = Pattern.compile("(.*)&t=(\\d+)");
31-
private static final Pattern HASHTAG_TIMESTAMP_PATTERN =
32-
Pattern.compile("(.*)#timestamp=(\\d+)");
21+
22+
private InternalUrlsHandler() {
23+
}
3324

3425
/**
3526
* Handle a YouTube timestamp description URL in NewPipe.
@@ -39,7 +30,6 @@ public final class InternalUrlsHandler {
3930
* player will be opened when the user will click on the timestamp in the video description,
4031
* at the time and for the video indicated in the timestamp.
4132
*
42-
* @param disposables a field of the Activity/Fragment class that calls this method
4333
* @param context the context to use
4434
* @param url the URL to check if it can be handled
4535
* @return true if the URL can be handled by NewPipe, false if it cannot

app/src/main/java/org/schabi/newpipe/util/text/TextLinkifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static void fromMarkdown(@NonNull final TextView textView,
192192
* <p>
193193
* Instead of using an {@link android.content.Intent#ACTION_VIEW} intent in the description of
194194
* a content, this method will parse the {@link CharSequence} and replace all current web links
195-
* with {@link ShareUtils#openUrlInBrowser(Context, String, boolean)}.
195+
* with {@link ShareUtils#openUrlInBrowser(Context, String)}.
196196
* </p>
197197
*
198198
* <p>
@@ -240,7 +240,7 @@ private static void changeLinkIntents(@NonNull final TextView textView,
240240
for (final URLSpan span : urls) {
241241
final String url = span.getURL();
242242
final LongPressClickableSpan longPressClickableSpan =
243-
new UrlLongPressClickableSpan(context, disposables, url);
243+
new UrlLongPressClickableSpan(context, url);
244244

245245
textBlockLinked.setSpan(longPressClickableSpan,
246246
textBlockLinked.getSpanStart(span),

app/src/main/java/org/schabi/newpipe/util/text/UrlLongPressClickableSpan.java

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

88
import org.schabi.newpipe.util.external_communication.ShareUtils;
99

10-
import io.reactivex.rxjava3.disposables.CompositeDisposable;
11-
1210
final class UrlLongPressClickableSpan extends LongPressClickableSpan {
1311

1412
@NonNull
1513
private final Context context;
1614
@NonNull
17-
private final CompositeDisposable disposables;
18-
@NonNull
1915
private final String url;
2016

2117
UrlLongPressClickableSpan(@NonNull final Context context,
22-
@NonNull final CompositeDisposable disposables,
2318
@NonNull final String url) {
2419
this.context = context;
25-
this.disposables = disposables;
2620
this.url = url;
2721
}
2822

0 commit comments

Comments
 (0)