[app] Add more markdown support

This commit is contained in:
tehcneko 2021-02-10 17:31:08 +08:00
parent f5154f28d1
commit 04473023bf
2 changed files with 17 additions and 6 deletions

View File

@ -69,6 +69,7 @@ dependencies {
implementation 'com.caverock:androidsvg-aar:1.4'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
implementation 'com.github.jinatonic.confetti:confetti:1.1.2'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.takisoft.preferencex:preferencex:1.1.0'
@ -76,9 +77,11 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
final def markwon_version = '4.6.2'
implementation "io.noties.markwon:core:$markwon_version"
implementation "io.noties.markwon:image:$markwon_version"
implementation "io.noties.markwon:image-glide:$markwon_version"
implementation "io.noties.markwon:ext-strikethrough:$markwon_version"
implementation "io.noties.markwon:ext-tables:$markwon_version"
implementation "io.noties.markwon:ext-tasklist:$markwon_version"
implementation "io.noties.markwon:html:$markwon_version"
implementation "io.noties.markwon:image-glide:$markwon_version"
implementation "io.noties.markwon:linkify:$markwon_version"
implementation 'rikka.insets:insets:1.0.1'
implementation 'rikka.recyclerview:recyclerview-utils:1.2.0'
@ -87,9 +90,11 @@ dependencies {
implementation 'tech.rectifier.preferencex-android:preferencex-simplemenu:88f93154b2'
implementation 'me.zhanghai.android.appiconloader:appiconloader-glide:1.2.0'
implementation 'me.zhanghai.android.fastscroll:library:1.1.5'
//noinspection DifferentStdlibGradleVersion
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21'
implementation 'com.github.jinatonic.confetti:confetti:1.1.2'
implementation files('libs/WeatherView-2.0.3.aar')
compileOnly project(":hiddenapi-stubs")
}
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}

View File

@ -69,6 +69,9 @@ import io.github.lsposed.manager.util.NavUtil;
import io.github.lsposed.manager.util.chrome.CustomTabsURLSpan;
import io.github.lsposed.manager.util.chrome.LinkTransformationMethod;
import io.noties.markwon.Markwon;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.ext.tables.TablePlugin;
import io.noties.markwon.ext.tasklist.TaskListPlugin;
import io.noties.markwon.html.HtmlPlugin;
import io.noties.markwon.image.glide.GlideImagesPlugin;
import io.noties.markwon.linkify.LinkifyPlugin;
@ -93,9 +96,12 @@ public class RepoItemActivity extends BaseActivity {
bar.setSubtitle(modulePackageName);
bar.setDisplayHomeAsUpEnabled(true);
markwon = Markwon.builder(this)
.usePlugin(StrikethroughPlugin.create())
.usePlugin(TablePlugin.create(this))
.usePlugin(TaskListPlugin.create(this))
.usePlugin(HtmlPlugin.create())
.usePlugin(GlideImagesPlugin.create(GlideApp.with(this)))
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
.usePlugin(HtmlPlugin.create())
.build();
module = RepoLoader.getInstance().getOnlineModule(modulePackageName);
binding.viewPager.setAdapter(new PagerAdapter());