Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.content.ContentResolver
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.drawable.BitmapDrawable
import android.net.Uri
import android.os.Bundle
Expand Down Expand Up @@ -268,8 +269,10 @@ class MultimediaImageFragment :
setupDoneButton()
}

@NeedsTest("Verify the webview background color is transparent and matches the app theme")
private fun setupWebView() {
binding.multimediaWebView.setWebViewClient(SafeWebViewClient())
binding.multimediaWebView.setBackgroundColor(Color.TRANSPARENT)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.annotation.MainThread
import androidx.fragment.app.Fragment
import androidx.fragment.app.findFragment
import com.ichi2.anki.BuildConfig
import com.ichi2.anki.common.annotations.NeedsTest
import com.ichi2.anki.common.crashreporting.runCatchingWithReport
import timber.log.Timber

Expand All @@ -45,6 +46,12 @@ open class SafeWebViewLayout :
field = value
}

@NeedsTest("Verify background color applies to inner WebView")
override fun setBackgroundColor(color: Int) {
super.setBackgroundColor(color)
webView.setBackgroundColor(color)
}

protected open fun createWebView() = WebView(context)

init {
Expand Down
Loading