Skip to content

Commit

Permalink
Create text subpackage in util
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Jan 15, 2023
1 parent cdd5e89 commit 22c201b
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.external_communication.ShareUtils;
import org.schabi.newpipe.util.external_communication.TextLinkifier;
import org.schabi.newpipe.util.text.TextLinkifier;

import icepick.State;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import org.schabi.newpipe.extractor.comments.CommentsInfoItem;
import org.schabi.newpipe.info_list.InfoItemBuilder;
import org.schabi.newpipe.local.history.HistoryRecordManager;
import org.schabi.newpipe.util.CommentTextOnTouchListener;
import org.schabi.newpipe.util.text.CommentTextOnTouchListener;
import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PicassoHelper;
import org.schabi.newpipe.util.external_communication.ShareUtils;
import org.schabi.newpipe.util.external_communication.TimestampExtractor;
import org.schabi.newpipe.util.text.TimestampExtractor;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
import org.schabi.newpipe.util.external_communication.TextLinkifier;
import org.schabi.newpipe.util.text.TextLinkifier;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.schabi.newpipe.util;
package org.schabi.newpipe.util.text;

import static org.schabi.newpipe.util.TouchUtils.getOffsetForHorizontalLine;
import static org.schabi.newpipe.util.text.TouchUtils.getOffsetForHorizontalLine;

import android.text.Selection;
import android.text.Spannable;
Expand All @@ -12,7 +12,6 @@
import android.widget.TextView;

import org.schabi.newpipe.util.external_communication.ShareUtils;
import org.schabi.newpipe.util.external_communication.InternalUrlsHandler;

import io.reactivex.rxjava3.disposables.CompositeDisposable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import android.content.Context;
import android.view.View;
Expand All @@ -7,7 +7,7 @@

import org.schabi.newpipe.extractor.Info;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.views.LongPressClickableSpan;
import org.schabi.newpipe.util.external_communication.ShareUtils;

final class HashtagLongPressClickableSpan extends LongPressClickableSpan {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import android.content.Context;
import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.views;
package org.schabi.newpipe.util.text;

import android.text.style.ClickableSpan;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.schabi.newpipe.views;
package org.schabi.newpipe.util.text;

import static org.schabi.newpipe.util.TouchUtils.getOffsetForHorizontalLine;
import static org.schabi.newpipe.util.text.TouchUtils.getOffsetForHorizontalLine;

import android.os.Handler;
import android.os.Looper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import android.content.Context;
import android.text.SpannableStringBuilder;
Expand All @@ -15,8 +15,7 @@
import org.schabi.newpipe.extractor.Info;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.views.LongPressClickableSpan;
import org.schabi.newpipe.views.LongPressLinkMovementMethod;
import org.schabi.newpipe.util.external_communication.ShareUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -88,8 +87,7 @@ public static void createLinksFromPlainText(@NonNull final TextView textView,
@NonNull final CompositeDisposable disposables) {
textView.setAutoLinkMask(Linkify.WEB_URLS);
textView.setText(plainTextBlock, TextView.BufferType.SPANNABLE);
changeIntentsOfDescriptionLinks(textView, textView.getText(), relatedInfo, disposables
);
changeIntentsOfDescriptionLinks(textView, textView.getText(), relatedInfo, disposables);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import static org.schabi.newpipe.util.external_communication.InternalUrlsHandler.playOnPopup;
import static org.schabi.newpipe.util.text.InternalUrlsHandler.playOnPopup;

import android.content.Context;
import android.view.View;
Expand All @@ -10,7 +10,7 @@
import org.schabi.newpipe.extractor.ServiceList;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.views.LongPressClickableSpan;
import org.schabi.newpipe.util.external_communication.ShareUtils;

import io.reactivex.rxjava3.disposables.CompositeDisposable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.schabi.newpipe.util;
package org.schabi.newpipe.util.text;

import android.text.Layout;
import android.view.MotionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.schabi.newpipe.util.external_communication;
package org.schabi.newpipe.util.text;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;

import org.schabi.newpipe.views.LongPressClickableSpan;
import org.schabi.newpipe.util.external_communication.ShareUtils;

import io.reactivex.rxjava3.disposables.CompositeDisposable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.schabi.newpipe.util.text.TimestampExtractor;

import java.time.Duration;
import java.util.Arrays;
Expand Down

0 comments on commit 22c201b

Please sign in to comment.