舍弃原来的主题系统

This commit is contained in:
HapeLee committed 2025-06-06 05:08:55 +08:00
1 parent 68dd23b57e
commit 6ed3ef9566
48 files changed
+182 -291

No files matched your search

@@ -29,6 +29,7 @@ import android.os.BatteryManager
import android.os.Build
import android.os.Process
import android.provider.Settings
import android.util.TypedValue
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.core.content.ContextCompat
@@ -417,3 +418,8 @@ val Context.isDebuggable: Boolean
val Context.dataStore by preferencesDataStore(name = "settings")
fun Context.themeColor(attr: Int): Int {
val typedValue = TypedValue()
theme.resolveAttribute(attr, typedValue, true)
return ContextCompat.getColor(this, typedValue.resourceId)
}