Add SC light theme

This commit is contained in:
SpiritCroc 2020-07-20 14:40:05 +02:00
parent eb3f2ad28e
commit f9b031dca5
14 changed files with 162 additions and 7 deletions

View File

@ -26,6 +26,7 @@ import im.vector.riotx.R
sealed class ActivityOtherThemes(@StyleRes val dark: Int,
@StyleRes val black: Int,
@StyleRes val status: Int,
@StyleRes val sc_light: Int,
@StyleRes val sc: Int,
@StyleRes val sc_dark: Int,
@StyleRes val sc_colored: Int,
@ -35,6 +36,7 @@ sealed class ActivityOtherThemes(@StyleRes val dark: Int,
R.style.AppTheme_Dark,
R.style.AppTheme_Black,
R.style.AppTheme_Status,
R.style.AppTheme_SC_Light,
R.style.AppTheme_SC,
R.style.AppTheme_SC_Dark,
R.style.AppTheme_SC_Colored,
@ -48,6 +50,7 @@ sealed class ActivityOtherThemes(@StyleRes val dark: Int,
R.style.AppTheme_AttachmentsPreview_SC,
R.style.AppTheme_AttachmentsPreview_SC,
R.style.AppTheme_AttachmentsPreview_SC,
R.style.AppTheme_AttachmentsPreview_SC,
R.style.AppTheme_AttachmentsPreview_SC
)
@ -58,6 +61,7 @@ sealed class ActivityOtherThemes(@StyleRes val dark: Int,
R.style.AppTheme_Transparent_SC,
R.style.AppTheme_Transparent_SC,
R.style.AppTheme_Transparent_SC,
R.style.AppTheme_Transparent_SC,
R.style.AppTheme_Transparent_SC
)
}

View File

@ -43,6 +43,7 @@ object ThemeUtils {
private const val THEME_LIGHT_VALUE = "light"
private const val THEME_BLACK_VALUE = "black"
private const val THEME_STATUS_VALUE = "status"
private const val THEME_SC_LIGHT_VALUE = "sc_light"
private const val THEME_SC_VALUE = "sc"
private const val THEME_SC_DARK_VALUE = "sc_dark"
private const val THEME_SC_COLORED_VALUE = "sc_colored"
@ -78,6 +79,7 @@ object ThemeUtils {
fun isLightTheme(context: Context): Boolean {
return when (getApplicationTheme(context)) {
THEME_LIGHT_VALUE,
THEME_SC_LIGHT_VALUE,
THEME_STATUS_VALUE -> true
else -> false
}
@ -126,7 +128,11 @@ object ThemeUtils {
fun isScTheme(context: Context?): Boolean {
if (context != null) {
mIsScTheme = when (getApplicationTheme(context)) {
THEME_SC_VALUE, THEME_SC_DARK_VALUE, THEME_SC_COLORED_VALUE, THEME_SC_DARK_COLORED_VALUE -> true
THEME_SC_LIGHT_VALUE,
THEME_SC_VALUE,
THEME_SC_DARK_VALUE,
THEME_SC_COLORED_VALUE,
THEME_SC_DARK_COLORED_VALUE -> true
else -> false
}
}
@ -144,6 +150,7 @@ object ThemeUtils {
THEME_DARK_VALUE -> context.setTheme(R.style.AppTheme_Dark)
THEME_BLACK_VALUE -> context.setTheme(R.style.AppTheme_Black)
THEME_STATUS_VALUE -> context.setTheme(R.style.AppTheme_Status)
THEME_SC_LIGHT_VALUE -> context.setTheme(R.style.AppTheme_SC_Light)
THEME_SC_VALUE -> context.setTheme(R.style.AppTheme_SC)
THEME_SC_DARK_VALUE -> context.setTheme(R.style.AppTheme_SC_Dark)
THEME_SC_COLORED_VALUE -> context.setTheme(R.style.AppTheme_SC_Colored)
@ -173,6 +180,7 @@ object ThemeUtils {
THEME_DARK_VALUE -> activity.setTheme(otherThemes.dark)
THEME_BLACK_VALUE -> activity.setTheme(otherThemes.black)
THEME_STATUS_VALUE -> activity.setTheme(otherThemes.status)
THEME_SC_LIGHT_VALUE -> activity.setTheme(otherThemes.sc_light)
THEME_SC_VALUE -> activity.setTheme(otherThemes.sc)
THEME_SC_DARK_VALUE -> activity.setTheme(otherThemes.sc_dark)
THEME_SC_COLORED_VALUE -> activity.setTheme(otherThemes.sc_colored)

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:drawable="@drawable/vector_tabbar_unselected_background_sc_light" android:state_focused="false" android:state_pressed="false" android:state_selected="false" />
<item android:drawable="@drawable/vector_tabbar_selected_background_sc_light" android:state_focused="false" android:state_pressed="false" android:state_selected="true" />
<!-- Focused states -->
<item android:drawable="@drawable/vector_tabbar_unselected_background_sc_light" android:state_focused="true" android:state_pressed="false" android:state_selected="false" />
<item android:drawable="@drawable/vector_tabbar_selected_background_sc_light" android:state_focused="true" android:state_pressed="false" android:state_selected="true" />
<!-- Pressed -->
<!-- Non focused states -->
<item android:drawable="@drawable/vector_tabbar_unselected_background_sc_light" android:state_focused="false" android:state_pressed="true" android:state_selected="false" />
<item android:drawable="@drawable/vector_tabbar_selected_background_sc_light" android:state_focused="false" android:state_pressed="true" android:state_selected="true" />
<!-- Focused states -->
<item android:drawable="@drawable/vector_tabbar_unselected_background_sc_light" android:state_focused="true" android:state_pressed="true" android:state_selected="false" />
<item android:drawable="@drawable/vector_tabbar_selected_background_sc_light" android:state_focused="true" android:state_pressed="true" android:state_selected="true" />
</selector>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/list_divider_color_light" />
<padding android:bottom="1dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
<padding android:bottom="2dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="?colorAccent" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="?colorAccent" />
</shape>
</item>
</layer-list>

View File

@ -2,6 +2,7 @@
<resources>
<string name="settings_dark_theme">Nacht-Design</string>
<string name="sc_light_theme">SC Hell</string>
<string name="sc_theme">SC Schwarz</string>
<string name="sc_dark_theme">SC Dunkel</string>
<string name="sc_colored_theme">SC Schwarz, bunte Blasen</string>

View File

@ -49,6 +49,20 @@
<item name="android:windowSharedElementExitTransition">@transition/image_preview_transition</item>
</style>
<style name="AppTheme.SC.Light.v21" parent="AppTheme.Base.SC.Light">
<!-- Use dark color, to have enough contrast with icons color. windowLightStatusBar is only available in API 23+ -->
<item name="android:statusBarColor">@color/riotx_header_panel_background_dark</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightNavigationBar is only available in API 27+ -->
<item name="android:navigationBarColor">@color/riotx_header_panel_background_dark</item>
<!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item>
<!-- specify shared element enter and exit transitions -->
<item name="android:windowSharedElementEnterTransition">@transition/image_preview_transition</item>
<item name="android:windowSharedElementExitTransition">@transition/image_preview_transition</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.SC.v21" />
<style name="AppTheme.SC.Dark" parent="AppTheme.SC.Dark.v21" />
@ -57,4 +71,6 @@
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v21" />
<style name="AppTheme.SC.Light" parent="AppTheme.SC.Light.v21" />
</resources>

View File

@ -17,6 +17,10 @@
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC.Light.v23" parent="AppTheme.SC.Light.v21">
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.SC.v23"/>
<style name="AppTheme.SC.Dark" parent="AppTheme.SC.Dark.v23"/>
@ -25,4 +29,6 @@
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v23"/>
<style name="AppTheme.SC.Light" parent="AppTheme.SC.Light.v23"/>
</resources>

View File

@ -17,6 +17,10 @@
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC.Light.v27" parent="AppTheme.SC.Light.v23">
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.SC.v27" />
<style name="AppTheme.SC.Dark" parent="AppTheme.SC.Dark.v27" />
@ -25,4 +29,6 @@
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v27" />
<style name="AppTheme.SC.Light" parent="AppTheme.SC.Light.v27" />
</resources>

View File

@ -96,6 +96,7 @@
<item>@string/dark_theme</item>
<item>@string/black_them</item>
<item>@string/status_theme</item>
<item>@string/sc_light_theme</item>
<item>@string/sc_theme</item>
<item>@string/sc_dark_theme</item>
<item>@string/sc_colored_theme</item>
@ -107,6 +108,7 @@
<item>dark</item>
<item>black</item>
<item>status</item>
<item>sc_light</item>
<item>sc</item>
<item>sc_dark</item>
<item>sc_colored</item>

View File

@ -2,6 +2,7 @@
<resources>
<string name="settings_dark_theme">Night Theme</string>
<string name="sc_light_theme">SC Light</string>
<string name="sc_theme">SC Black</string>
<string name="sc_dark_theme">SC Dark</string>
<string name="sc_colored_theme">SC Black, colored bubbles</string>

View File

@ -10,6 +10,11 @@
<item name="colorSecondary">@color/accent_sc</item>
</style>
<style name="VectorAlertDialogStyleLight.SC">
<item name="buttonBarButtonStyle">@style/VectorAlertDialogButtonStyle.SC</item>
<item name="colorSecondary">@color/accent_sc</item>
</style>
<style name="VectorAlertDialogButtonStyle.SC">
<item name="android:textColor">?colorAccent</item>
</style>
@ -19,6 +24,11 @@
<item name="background">@drawable/vector_tabbar_background_sc</item>
</style>
<style name="Vector.TabView.Light.SC" parent="Vector.TabView.Dark">
<item name="android:background">@drawable/vector_tabbar_background_sc_light</item>
<item name="background">@drawable/vector_tabbar_background_sc_light</item>
</style>
<!-- custom action bar -->
<style name="Vector.Styled.ActionBar.SC">
<item name="android:background">@color/background_dark_sc</item>

View File

@ -251,10 +251,4 @@
<item name="android:backgroundDimEnabled">false</item>
</style>
<!-- Default AppTheme with modified accent for usage where settings don't apply -->
<style name="AppTheme.SC.Light" parent="AppTheme.Light">
<item name="colorPrimary">@color/accent_sc</item>
</style>
</resources>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- SC THEME COLORS -->
<style name="AppTheme.Base.SC.Light" parent="AppTheme.Base.Light">
<!-- Material color: Note: this block should be the same in all theme because it references only common colors and ?riotx attributes -->
<item name="colorPrimary">@color/accent_sc</item>
<item name="colorSecondary">@color/accent_sc</item>
<!-- Keep color accent for legacy widget-->
<item name="colorAccent">@color/accent_sc</item>
<item name="materialButtonStyle">@style/VectorButtonStyle.SC</item>
<item name="alertDialogTheme">@style/VectorAlertDialogStyleLight.SC</item>
<item name="vctr_tab_home">@color/accent_sc</item>
<item name="vctr_encrypting_message_text_color">@color/accent_sc</item>
<item name="vctr_highlighted_searched_message_text_color">@color/accent_sc</item>
<item name="vctr_unread_marker_line_color">@color/accent_sc</item>
<!-- tab bar colors -->
<item name="vctr_tab_bar_selected_background_color">@color/accent_sc</item>
<item name="vctr_tab_bar_unselected_background_color">@color/accent_sc</item>
<!-- icon colors -->
<item name="vctr_icon_tint_on_light_action_bar_color">@color/accent_sc</item>
<item name="vctr_tabbar_selected_background">
@drawable/vector_tabbar_selected_background_sc_light
</item>
<item name="vctr_tabbar_unselected_background">
@drawable/vector_tabbar_unselected_background_sc_light
</item>
<item name="vctr_direct_chat_circle">@drawable/direct_chat_circle_sc</item>
<!-- custom action bar -->
<item name="android:actionBarStyle">@style/Vector.Styled.ActionBar.SC</item>
<item name="actionBarStyle">@style/Vector.Styled.ActionBar.SC</item>
<!-- tabbar background -->
<item name="android:actionBarTabStyle">@style/Vector.TabView.Light.SC</item>
<item name="actionBarTabStyle">@style/Vector.TabView.Light.SC</item>
<item name="sc_message_bg_incoming">#FFEEEEEE</item>
<item name="sc_message_bg_outgoing">@color/accent_sc_alpha12</item>
<item name="riotx_positive_accent">@color/accent_sc</item>
<item name="riotx_positive_accent_alpha12">@color/accent_sc_alpha12</item>
</style>
<!-- Default AppTheme for usage where settings don't apply -->
<style name="AppTheme.SC.Light" parent="AppTheme.Base.SC.Light" />
</resources>