|
1 | 1 | package com.fox2code.mmm; |
2 | 2 |
|
3 | 3 | import android.content.Context; |
| 4 | +import android.text.Spanned; |
4 | 5 | import android.util.Log; |
5 | 6 | import android.widget.Button; |
6 | 7 | import android.widget.ImageButton; |
| 8 | +import android.widget.TextView; |
7 | 9 | import android.widget.Toast; |
8 | 10 |
|
9 | 11 | import androidx.annotation.DrawableRes; |
@@ -76,12 +78,13 @@ public void doAction(ImageButton button, ModuleHolder moduleHolder) { |
76 | 78 | builder.setTitle(moduleInfo.name).setCancelable(true) |
77 | 79 | .setIcon(R.drawable.ic_baseline_extension_24); |
78 | 80 | CharSequence desc = moduleInfo.description; |
| 81 | + Markwon markwon = null; |
79 | 82 | if (moduleInfo instanceof LocalModuleInfo) { |
80 | 83 | LocalModuleInfo localModuleInfo = (LocalModuleInfo) moduleInfo; |
81 | 84 | if (!localModuleInfo.updateChangeLog.isEmpty()) { |
82 | | - Markwon markwon = MainApplication.getINSTANCE().getMarkwon(); |
| 85 | + markwon = MainApplication.getINSTANCE().getMarkwon(); |
83 | 86 | // Re-render each time in cse of config changes |
84 | | - desc = markwon.render(markwon.parse(localModuleInfo.updateChangeLog)); |
| 87 | + desc = markwon.toMarkdown(localModuleInfo.updateChangeLog); |
85 | 88 | } |
86 | 89 | } |
87 | 90 |
|
@@ -110,6 +113,11 @@ public void doAction(ImageButton button, ModuleHolder moduleHolder) { |
110 | 113 | alertButton.setPadding(dim5dp, dim5dp, dim5dp, dim5dp); |
111 | 114 | } |
112 | 115 | } |
| 116 | + if (markwon != null) { |
| 117 | + TextView messageView = alertDialog.getWindow() |
| 118 | + .findViewById(android.R.id.message); |
| 119 | + markwon.setParsedMarkdown(messageView, (Spanned) desc); |
| 120 | + } |
113 | 121 | } |
114 | 122 | }, |
115 | 123 | UNINSTALL() { |
|
0 commit comments