Skip to content
Merged
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 @@ -36,6 +36,7 @@ import androidx.lifecycle.lifecycleScope
import com.ichi2.anki.CollectionManager.TR
import com.ichi2.anki.R
import com.ichi2.anki.SingleFragmentActivity
import com.ichi2.anki.common.utils.android.getColorFromAttr
import com.ichi2.anki.databinding.FragmentMediaCheckBinding
import com.ichi2.anki.launchCatchingTask
import com.ichi2.anki.ui.internationalization.sentenceCase
Expand All @@ -46,6 +47,7 @@ import com.ichi2.utils.negativeButton
import com.ichi2.utils.positiveButton
import com.ichi2.utils.show
import com.ichi2.utils.title
import com.ichi2.utils.toRGBHex
import dev.androidbroadcast.vbpd.viewBinding
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -131,11 +133,19 @@ class MediaCheckFragment : Fragment(R.layout.fragment_media_check) {
}

private fun updateWebView(report: String) {
val backgroundColor = getColorFromAttr(requireContext(), android.R.attr.colorBackground)
val textColor = getColorFromAttr(requireContext(), android.R.attr.textColorPrimary)

val backgroundColorHex = backgroundColor.toRGBHex()
val textColorHex = textColor.toRGBHex()

val html =
"""
<html>
<body style="
padding: 0px 8px;
background-color: $backgroundColorHex;
color: $textColorHex;
padding: 0px 8px;
font-size:14px;
white-space: pre-wrap;">$report
</body>
Expand Down
Loading