0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-27 05:23:00 +00:00

added transparent theme

This commit is contained in:
X1nto 2020-05-05 13:06:28 +04:00
parent 7eca993049
commit c27b072f29
3 changed files with 67 additions and 0 deletions

View file

@ -66,6 +66,7 @@ open class ThemeActivity : AppCompatActivity() {
Configuration.UI_MODE_NIGHT_NO -> setLightAccent(currentAccent)
}
}
"TRANS" -> setTransAccent(currentAccent)
else -> setLightAccent("Blue")
}
}
@ -88,6 +89,15 @@ open class ThemeActivity : AppCompatActivity() {
}
}
private fun setTransAccent(accentColor: String) {
when (accentColor) {
"Blue" -> setTheme(R.style.TransparentTheme_Blue)
"Red" -> setTheme(R.style.TransparentTheme_Red)
"Green" -> setTheme(R.style.TransparentTheme_Green)
"Yellow" -> setTheme(R.style.TransparentTheme_Yellow)
}
}
private fun setTaskBG() {
val label = getString(R.string.app_name)
val color = ResourcesCompat.getColor(resources, R.color.Black, null)

View file

@ -5,12 +5,14 @@
<item>@string/theme_light</item>
<item>@string/theme_dark</item>
<item>@string/theme_follow</item>
<item>Transparent</item>
</string-array>
<string-array name="theme_modes_values">
<item>LIGHT</item>
<item>DARK</item>
<item>FOLLOW</item>
<item>TRANS</item>
</string-array>
<string-array name="accent_color">

View file

@ -6,4 +6,59 @@
<item name="android:windowTranslucentNavigation">true</item>
</style>
<style name="TransparentTheme.Blue" parent="Theme.MaterialComponents.NoActionBar">
<item name="colorPrimary">#1490D7</item>
<item name="colorPrimaryVariant">#2C7EB9</item>
<item name="colorSecondary">#3E78AF</item>
<item name="colorSecondaryVariant">#803E78AF</item>
<item name="colorSurface">@android:color/transparent</item>
<item name="colorSurfaceVariant">@android:color/transparent</item>
<item name="colorSurfaceSurfaceVariant">?colorSurface</item>
<item name="colorOnPrimary">#F9F9F9</item>
<item name="colorOnPrimaryVariant">#e8e8e8</item>
<item name="colorOnSecondary">#F9F9F9</item>
<item name="colorOnBackground">?colorOnSurface</item>
<item name="colorError">#CC0047</item>
<item name="colorOnError">#F9F9F9</item>
<item name="colorOnSurface">#444444</item>
<item name="colorOnSurfaceVariant">#FFFFFF</item>
<item name="colorDisabled">#808080</item>
<item name="colorDisabledVariant">#000000</item>
<item name="iconColor">?colorPrimaryVariant</item>
<item name="toolbarIconColor">#111111</item>
<item name="DialogBG">#ffffff</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">?colorSurface</item>
<item name="android:statusBarColor">#787777</item>
</style>
<style name="TransparentTheme.Red" parent="TransparentTheme.Blue">
<item name="colorPrimary">#D71414</item>
<item name="colorPrimaryVariant">#B92C2C</item>
<item name="colorSecondary">#AF3E3E</item>
<item name="colorSecondaryVariant">#80AF3E3E</item>
</style>
<style name="TransparentTheme.Green" parent="TransparentTheme.Blue">
<item name="colorPrimary">#3ED714</item>
<item name="colorPrimaryVariant">#2CB943</item>
<item name="colorSecondary">#3EAF51</item>
<item name="colorSecondaryVariant">#803EAF44</item>
</style>
<style name="TransparentTheme.Yellow" parent="TransparentTheme.Blue">
<item name="colorPrimary">#D7AD14</item>
<item name="colorPrimaryVariant">#B9B22C</item>
<item name="colorSecondary">#AFAD3E</item>
<item name="colorSecondaryVariant">#80AFAD3E</item>
</style>
</resources>