Skip to content

Commit c8eb940

Browse files
committed
Fixed background color
1 parent a6d351e commit c8eb940

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Add the dependency:
5454

5555
```groovy
5656
dependencies {
57-
implementation 'com.github.imcloudfloating:markdown-it-android:1.0.0'
57+
implementation 'com.github.imcloudfloating:markdown-it-android:1.0.3'
5858
}
5959
```
6060

markdown-it/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
android {
8-
def lib_version = "1.0.2"
8+
def lib_version = "1.0.3"
99
compileSdkVersion 30
1010
buildToolsVersion "30.0.3"
1111

markdown-it/src/main/java/com/github/imcloudfloating/markdown/MarkdownIt.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.github.imcloudfloating.markdown
33
import android.annotation.SuppressLint
44
import android.content.Context
55
import android.content.Intent
6-
import android.graphics.Color
76
import android.os.Build
87
import android.util.AttributeSet
98
import android.util.Log
@@ -37,6 +36,7 @@ class MarkdownIt(context: Context, attrs: AttributeSet) : WebView(context, attrs
3736
super.onPageFinished(view, url)
3837
loaded = true
3938
renderContent()
39+
visibility = VISIBLE
4040
}
4141

4242
override fun shouldOverrideUrlLoading(
@@ -62,8 +62,8 @@ class MarkdownIt(context: Context, attrs: AttributeSet) : WebView(context, attrs
6262
}
6363

6464
init {
65-
setBackgroundColor(Color.TRANSPARENT)
6665
if (!isInEditMode) {
66+
visibility = INVISIBLE
6767
loadUrl("file:///android_asset/markdown-it/index.html")
6868
addJavascriptInterface(WebAppInterface(context, fitSystemTheme), "android")
6969
settings.run {
@@ -89,14 +89,13 @@ class MarkdownIt(context: Context, attrs: AttributeSet) : WebView(context, attrs
8989
* Render markdown string
9090
*/
9191
private fun renderContent() {
92-
Log.d(TAG, "render")
9392
execJavascript("javascript:setContent('${markdownString}')")
9493
}
9594

9695
private fun execJavascript(script: String) {
9796
if (loaded) {
9897
evaluateJavascript(script, null)
99-
return
98+
Log.d(TAG, "Render")
10099
}
101100
}
102101
}

0 commit comments

Comments
 (0)