diff --git a/build.gradle b/build.gradle index 51b8a16f..4f2fb41c 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,6 @@ buildscript { repositories { google() jcenter() - } dependencies { apply plugin: 'maven' @@ -20,5 +19,6 @@ allprojects { google() jcenter() maven { url "https://jitpack.io" } + maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } } diff --git a/fastlane/metadata/android/en-US/changelogs/3001002.txt b/fastlane/metadata/android/en-US/changelogs/3001002.txt new file mode 100644 index 00000000..cf524deb --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3001002.txt @@ -0,0 +1 @@ +- 🖼 Downscale and display huge images in preview mode instead of crash (#1034) \ No newline at end of file diff --git a/markdown/build.gradle b/markdown/build.gradle index 8d09fa64..1f73a475 100644 --- a/markdown/build.gradle +++ b/markdown/build.gradle @@ -23,7 +23,7 @@ android { } ext { - markwonVersion = "4.6.1" + markwonVersion = "4.6.2-SNAPSHOT" rxMarkdownVersion = "0.1.3" } diff --git a/markdown/src/main/java/it/niedermann/android/markdown/markwon/MarkwonMarkdownViewer.java b/markdown/src/main/java/it/niedermann/android/markdown/markwon/MarkwonMarkdownViewer.java index f324907a..e4ed823d 100644 --- a/markdown/src/main/java/it/niedermann/android/markdown/markwon/MarkwonMarkdownViewer.java +++ b/markdown/src/main/java/it/niedermann/android/markdown/markwon/MarkwonMarkdownViewer.java @@ -23,6 +23,7 @@ import io.noties.markwon.SoftBreakAddsNewLinePlugin; 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.image.DefaultDownScalingMediaDecoder; import io.noties.markwon.image.ImagesPlugin; import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin; import io.noties.markwon.linkify.LinkifyPlugin; @@ -84,7 +85,7 @@ public class MarkwonMarkdownViewer extends AppCompatTextView implements Markdown .usePlugin(TaskListPlugin.create(context)) .usePlugin(LinkifyPlugin.create(true)) .usePlugin(LinkClickInterceptorPlugin.create()) - .usePlugin(ImagesPlugin.create()) + .usePlugin(ImagesPlugin.create(plugin -> plugin.defaultMediaDecoder(DefaultDownScalingMediaDecoder.create(context.getResources().getDisplayMetrics().widthPixels, 0)))) .usePlugin(SoftBreakAddsNewLinePlugin.create()) .usePlugin(SyntaxHighlightPlugin.create(prism4j, prism4jTheme)) .usePlugin(new ToggleableTaskListPlugin((toggledCheckboxPosition, newCheckedState) -> {