mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-16 07:10:29 +05:30
16 lines
581 B
Kotlin
16 lines
581 B
Kotlin
package com.github.libretube
|
|
|
|
import android.content.Context
|
|
import androidx.preference.PreferenceManager
|
|
|
|
fun updateAccentColor(context: Context) {
|
|
val colorAccent = PreferenceManager.getDefaultSharedPreferences(context).getString("accent_color", "red")
|
|
when (colorAccent) {
|
|
"red" -> context.setTheme(R.style.Theme_LibreTube)
|
|
"blue" -> context.setTheme(R.style.Theme_Blue)
|
|
"yellow" -> context.setTheme(R.style.Theme_Yellow)
|
|
"green" -> context.setTheme(R.style.Theme_Green)
|
|
"purple" -> context.setTheme(R.style.Theme_Purple)
|
|
}
|
|
}
|