0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-26 13:12:59 +00:00

made logs readable on light theme

This commit is contained in:
X1nto 2021-02-07 14:08:55 +04:00
parent e5a0050cb5
commit 284a6c07a8
2 changed files with 5 additions and 2 deletions

View file

@ -3,9 +3,11 @@ package com.vanced.manager.utils
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.Typeface
import android.text.Spannable
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.util.Log
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.vanced.manager.BuildConfig.APPLICATION_ID
@ -34,8 +36,9 @@ object AppUtils: CoroutineScope by CoroutineScope(Dispatchers.IO) {
fun log(tag: String, message: String) {
logs.add(
SpannableString("$tag: $message\n").apply {
setSpan(ForegroundColorSpan(Color.CYAN), 0, tag.length + 1, 0)
setSpan(ForegroundColorSpan(Color.GREEN), tag.length + 2, tag.length + message.length + 2, 0)
setSpan(ForegroundColorSpan(Color.parseColor("#2e73ff")), 0, tag.length + 1, 0)
setSpan(StyleSpan(Typeface.BOLD), 0, tag.length + 1, 0)
setSpan(ForegroundColorSpan(Color.MAGENTA), tag.length + 2, tag.length + message.length + 2, 0)
}
)
Log.d(tag, message)

0
git Normal file
View file