MY Option

This commit is contained in:
Bnyro 2022-05-20 00:19:11 +02:00
parent 3b26ab31ed
commit 5c420b773c
6 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_libretube_round"
android:supportsRtl="true"
android:theme="@style/Theme.Red"
android:theme="@style/Theme.MY"
android:name=".myApp"
android:networkSecurityConfig="@xml/network_security_config"
android:largeHeap="true"

View File

@ -29,7 +29,6 @@ import androidx.navigation.ui.setupWithNavController
import androidx.preference.PreferenceManager
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.color.DynamicColors
import java.util.*
class MainActivity : AppCompatActivity() {
val TAG = "MainActivity"

View File

@ -8,7 +8,7 @@ import java.util.*
fun updateAccentColor(context: Context) {
val colorAccent = PreferenceManager.getDefaultSharedPreferences(context).getString("accent_color", "red")
when (colorAccent) {
"my" -> {}
"my" -> context.setTheme(R.style.Theme_MY)
"red" -> context.setTheme(R.style.Theme_Red)
"blue" -> context.setTheme(R.style.Theme_Blue)
"yellow" -> context.setTheme(R.style.Theme_Yellow)

View File

@ -1,5 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MY" parent="Theme.Material3.Dark.NoActionBar"></style>
<style name="Theme.Red" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/red_dark_accentLight</item> // container

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MY" parent="Theme.Material3.Light.NoActionBar"></style>
<style name="Theme.Red" parent="Theme.Material3.Light.NoActionBar">
<item name="colorPrimary">@color/red_light_accentLight</item> // container

View File

@ -1,5 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MY" parent="Theme.Material3.Light.NoActionBar"></style>
<style name="Theme.Red" parent="Theme.Material3.Light.NoActionBar">
<item name="colorPrimary">@color/red_light_accentLight</item> // container