fix logs text color

pull/1366/head
deniscerri 4 days ago
parent 8bbc3d0c71
commit 358d1b45e4
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -206,6 +206,7 @@ class HistoryPaginatedAdapter(onItemClickListener: OnItemClickListener, activity
val length = card.findViewById<TextView>(R.id.duration)
length.text = if(item.downloadPath.size == 1) item.duration else ""
length.isVisible = length.text.isNotBlank()
val author = card.findViewById<TextView>(R.id.download_type)
author.text = item.author

@ -24,7 +24,9 @@ import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.preference.PreferenceManager
import androidx.webkit.WebSettingsCompat
import androidx.webkit.WebViewAssetLoader
import androidx.webkit.WebViewFeature
import com.deniscerri.ytdl.MainActivity
import com.deniscerri.ytdl.R
import com.deniscerri.ytdl.database.viewmodel.LogViewModel
@ -85,6 +87,9 @@ class DownloadLogFragment : Fragment() {
// WebSettings configuration
webView.setBackgroundColor(android.graphics.Color.TRANSPARENT)
webView.addJavascriptInterface(WebAppInterface(), "Android")
if (WebViewFeature.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING)) {
WebSettingsCompat.setAlgorithmicDarkeningAllowed(webView.settings, true)
}
webView.settings.apply {
javaScriptEnabled = true
domStorageEnabled = true
@ -246,9 +251,18 @@ class DownloadLogFragment : Fragment() {
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
:root {
--text-color: #000000;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #FFFFFF;
}
}
html, body {
background-color: transparent;
color: #E0E0E0;
margin: 0;
padding: 0;
width: 100%;

@ -40,8 +40,8 @@
android:layout_width="0dp"
android:layout_height="40dp"
android:adjustViewBounds="true"
android:layout_marginStart="17dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="6dp"
android:checkable="false"
app:cardCornerRadius="10dp"
app:cardMaxElevation="12dp"
@ -58,7 +58,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:layout_marginTop="10dp"
android:layout_marginTop="5dp"
android:layout_marginStart="10dp"
android:background="?attr/colorSurfaceVariant"
android:scaleType="centerCrop"

Loading…
Cancel
Save