aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-08-11 06:17:08 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-08-11 06:17:08 +0000
commit0527449ed6e9b12fa669efdd5bf76474df089b8f (patch)
tree57cdac337fd0baf036b3abbb216176b48115562e /app/src
parentb8b1ce13df1f8fd7d44dea48c69c69018d6a9367 (diff)
downloadinfinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar.gz
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar.bz2
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar.lz
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar.xz
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.tar.zst
infinity-for-reddit-0527449ed6e9b12fa669efdd5bf76474df089b8f.zip
Directly add https://www.reddit.com prefix to user name and subreddit name. Update some libraries.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java5
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java2
4 files changed, 6 insertions, 10 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
index 04d415ad..9d667d3a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
@@ -48,7 +48,6 @@ import io.noties.markwon.recycler.MarkwonAdapter;
import io.noties.markwon.recycler.table.TableEntry;
import io.noties.markwon.recycler.table.TableEntryPlugin;
import io.noties.markwon.simple.ext.SimpleExtPlugin;
-import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.CopyTextBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Comment.Comment;
@@ -226,7 +225,7 @@ public class CommentActivity extends BaseActivity {
intent.setData(uri);
}
startActivity(intent);
- }).urlProcessor(new UrlProcessorRelativeToAbsolute("https://www.reddit.com"));
+ });
}
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
index fb69a601..028e674e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
@@ -77,7 +77,6 @@ import io.noties.markwon.recycler.MarkwonAdapter;
import io.noties.markwon.recycler.table.TableEntry;
import io.noties.markwon.recycler.table.TableEntryPlugin;
import io.noties.markwon.simple.ext.SimpleExtPlugin;
-import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.Activity.CommentActivity;
@@ -265,7 +264,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
}
intent.putExtra(LinkResolverActivity.EXTRA_IS_NSFW, mPost.isNSFW());
mActivity.startActivity(intent);
- }).urlProcessor(new UrlProcessorRelativeToAbsolute("https://www.reddit.com"));
+ });
}
@Override
@@ -297,7 +296,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
}
intent.putExtra(LinkResolverActivity.EXTRA_IS_NSFW, mPost.isNSFW());
mActivity.startActivity(intent);
- }).urlProcessor(new UrlProcessorRelativeToAbsolute("https://www.reddit.com"));
+ });
}
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
index c7431b20..bc45fa84 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
@@ -38,15 +38,14 @@ import io.noties.markwon.recycler.MarkwonAdapter;
import io.noties.markwon.recycler.table.TableEntry;
import io.noties.markwon.recycler.table.TableEntryPlugin;
import io.noties.markwon.simple.ext.SimpleExtPlugin;
-import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubredditDataAsyncTask;
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper;
-import ml.docilealligator.infinityforreddit.Subreddit.FetchSubredditData;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
+import ml.docilealligator.infinityforreddit.Subreddit.FetchSubredditData;
import ml.docilealligator.infinityforreddit.Subreddit.SubredditData;
import ml.docilealligator.infinityforreddit.Subreddit.SubredditViewModel;
import retrofit2.Retrofit;
@@ -118,8 +117,7 @@ public class SidebarFragment extends Fragment {
intent.setData(uri);
}
startActivity(intent);
- }).urlProcessor(new UrlProcessorRelativeToAbsolute("https://www.reddit.com"));
-
+ });
}
})
.usePlugin(StrikethroughPlugin.create())
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java
index dca08778..f74d604e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java
@@ -34,7 +34,7 @@ public class Utils {
private static final long YEAR_MILLIS = 12 * MONTH_MILLIS;
public static String modifyMarkdown(String markdown) {
- StringBuilder regexed = new StringBuilder(markdown.replaceAll("((?<=[\\s])|^)/{0,1}[rRuU]/[\\w-]+/{0,1}", "[$0]($0)"));
+ StringBuilder regexed = new StringBuilder(markdown.replaceAll("((?<=[\\s])|^)/{0,1}[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com/$0)"));
int startIndex = 0;