Directly add https://www.reddit.com prefix to user name and subreddit name. Update some libraries.

This commit is contained in:
Alex Ning 2020-08-11 14:17:08 +08:00
parent b8b1ce13df
commit 0527449ed6
5 changed files with 15 additions and 19 deletions

View File

@ -35,10 +35,10 @@ android {
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-rc1'
// Lifecycle components
def lifecycleVersion = '2.2.0'
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
@ -51,8 +51,8 @@ dependencies {
def roomVersion = '2.2.5'
implementation "androidx.room:room-runtime:$roomVersion"
annotationProcessor "androidx.room:room-compiler:$roomVersion"
implementation 'androidx.work:work-runtime:2.3.4'
implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation 'androidx.work:work-runtime:2.4.0'
implementation 'com.google.android.material:material:1.3.0-alpha02'
implementation 'com.google.android.exoplayer:exoplayer-core:2.10.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.10.4'
@ -72,11 +72,11 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation 'com.github.santalu:aspect-ratio-imageview:1.0.9'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation 'io.noties.markwon:core:4.3.1'
implementation 'io.noties.markwon:linkify:4.3.1'
implementation 'io.noties.markwon:ext-strikethrough:4.3.1'
implementation 'io.noties.markwon:simple-ext:4.3.1'
implementation 'io.noties.markwon:recycler-table:4.3.1'
implementation 'io.noties.markwon:core:4.5.0'
implementation 'io.noties.markwon:linkify:4.5.0'
implementation 'io.noties.markwon:ext-strikethrough:4.5.0'
implementation 'io.noties.markwon:simple-ext:4.5.0'
implementation 'io.noties.markwon:recycler-table:4.5.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.20'
implementation 'com.github.Ferfalk:SimpleSearchView:0.1.4'

View File

@ -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

View File

@ -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

View File

@ -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())

View File

@ -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;