Introduce more SC themes

This commit is contained in:
SpiritCroc 2020-05-15 10:19:09 +02:00
parent 2f659f613d
commit dc4574ded3
13 changed files with 186 additions and 47 deletions

View File

@ -26,16 +26,25 @@ import im.vector.riotx.R
sealed class ActivityOtherThemes(@StyleRes val dark: Int,
@StyleRes val black: Int,
@StyleRes val status: Int,
@StyleRes val sc: Int) {
@StyleRes val sc: Int,
@StyleRes val sc_dark: Int,
@StyleRes val sc_colored: Int,
@StyleRes val sc_dark_colored: Int) {
object Default : ActivityOtherThemes(
R.style.AppTheme_Dark,
R.style.AppTheme_Black,
R.style.AppTheme_Status,
R.style.AppTheme_SC
R.style.AppTheme_SC,
R.style.AppTheme_SC_Dark,
R.style.AppTheme_SC_Colored,
R.style.AppTheme_SC_Dark_Colored
)
object AttachmentsPreview : ActivityOtherThemes(
R.style.AppTheme_AttachmentsPreview,
R.style.AppTheme_AttachmentsPreview,
R.style.AppTheme_AttachmentsPreview,
R.style.AppTheme_AttachmentsPreview,
R.style.AppTheme_AttachmentsPreview,
R.style.AppTheme_AttachmentsPreview,

View File

@ -42,6 +42,9 @@ object ThemeUtils {
private const val THEME_BLACK_VALUE = "black"
private const val THEME_STATUS_VALUE = "status"
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"
private const val THEME_SC_DARK_COLORED_VALUE = "sc_dark_colored"
private val mColorByAttr = HashMap<Int, Int>()
@ -66,7 +69,10 @@ object ThemeUtils {
*/
fun isScTheme(context: Context?): Boolean {
if (context != null) {
mIsScTheme = THEME_SC_VALUE.equals(getApplicationTheme(context));
mIsScTheme = when (getApplicationTheme(context)) {
THEME_SC_VALUE, THEME_SC_DARK_VALUE, THEME_SC_COLORED_VALUE, THEME_SC_DARK_COLORED_VALUE -> true
else -> false
}
}
return mIsScTheme;
}
@ -82,6 +88,9 @@ object ThemeUtils {
THEME_BLACK_VALUE -> context.setTheme(R.style.AppTheme_Black)
THEME_STATUS_VALUE -> context.setTheme(R.style.AppTheme_Status)
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)
THEME_SC_DARK_COLORED_VALUE -> context.setTheme(R.style.AppTheme_SC_Dark_Colored)
else -> context.setTheme(R.style.AppTheme_Light)
}
@ -100,6 +109,9 @@ object ThemeUtils {
THEME_BLACK_VALUE -> activity.setTheme(otherThemes.black)
THEME_STATUS_VALUE -> activity.setTheme(otherThemes.status)
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)
THEME_SC_DARK_COLORED_VALUE -> activity.setTheme(otherThemes.sc_dark_colored)
}
mColorByAttr.clear()
@ -207,7 +219,7 @@ object ThemeUtils {
}
}
}
THEME_SC_VALUE -> {
THEME_SC_VALUE, THEME_SC_DARK_VALUE, THEME_SC_COLORED_VALUE, THEME_SC_DARK_COLORED_VALUE -> {
return when (resourceId) {
R.drawable.bg_search_edit_text_light -> R.drawable.bg_search_edit_text_sc
R.drawable.bg_unread_notification_light -> R.drawable.bg_unread_notification_sc

View File

@ -9,7 +9,7 @@
<item android:left="6dp" android:right="2dp">
<shape>
<corners android:bottomRightRadius="4dp" android:topRightRadius="4dp" />
<solid android:color="@color/background_sc" />
<solid android:color="?riotx_background" />
</shape>
</item>
@ -17,7 +17,7 @@
<shape>
<size android:width="4dp" />
<corners android:bottomLeftRadius="40dp" android:topLeftRadius="40dp" />
<solid android:color="@color/accent_sc" />
<solid android:color="?colorAccent" />
</shape>
</item>
@ -32,4 +32,4 @@
</item>
</selector>
</selector>

View File

@ -3,6 +3,11 @@
<string name="redacted_stub_text">(Gelöschte Nachricht)</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>
<string name="sc_dark_colored_theme">SC Dunkel, bunte Blasen</string>
<string name="bubble_style">Nachrichtblasen</string>
<string name="bubble_style_none">Keine</string>
<string name="bubble_style_start">Selbe Seite</string>

View File

@ -13,6 +13,48 @@
<item name="android:windowSharedElementExitTransition">@transition/image_preview_transition</item>
</style>
<style name="AppTheme.SC.Dark.v21" parent="AppTheme.Base.SC.Dark">
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</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.Colored.v21" parent="AppTheme.Base.SC.Colored">
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</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.Dark.Colored.v21" parent="AppTheme.Base.SC.Dark.Colored">
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</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" />
<style name="AppTheme.SC.Colored" parent="AppTheme.SC.Colored.v21" />
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v21" />
</resources>

View File

@ -5,6 +5,24 @@
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC.Dark.v23" parent="AppTheme.SC.Dark.v21">
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC.Colored.v23" parent="AppTheme.SC.Colored.v21">
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC.Dark.Colored.v23" parent="AppTheme.SC.Dark.Colored.v21">
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.SC.v23"/>
</resources>
<style name="AppTheme.SC.Dark" parent="AppTheme.SC.Dark.v23"/>
<style name="AppTheme.SC.Colored" parent="AppTheme.SC.Colored.v23"/>
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v23"/>
</resources>

View File

@ -5,6 +5,24 @@
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC.Dark.v27" parent="AppTheme.SC.Dark.v23">
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC.Colored.v27" parent="AppTheme.SC.Colored.v23">
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC.Dark.Colored.v27" parent="AppTheme.SC.Dark.Colored.v23">
<item name="android:windowLightNavigationBar">false</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.SC.v27" />
</resources>
<style name="AppTheme.SC.Dark" parent="AppTheme.SC.Dark.v27" />
<style name="AppTheme.SC.Colored" parent="AppTheme.SC.Colored.v27" />
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.SC.Dark.Colored.v27" />
</resources>

View File

@ -97,6 +97,9 @@
<item>@string/black_them</item>
<item>@string/status_theme</item>
<item>@string/sc_theme</item>
<item>@string/sc_dark_theme</item>
<item>@string/sc_colored_theme</item>
<item>@string/sc_dark_colored_theme</item>
</string-array>
<string-array name="theme_values">
@ -105,6 +108,9 @@
<item>black</item>
<item>status</item>
<item>sc</item>
<item>sc_dark</item>
<item>sc_colored</item>
<item>sc_dark_colored</item>
</string-array>
<!-- Info area -->

View File

@ -13,10 +13,10 @@
<color name="text_color_tertiary_sc">#80ffffff</color>
<color name="text_color_disabled_sc">#80ffffff</color>
<color name="background_sc">#ff000000</color>
<color name="background_sc">#ff303030</color>
<color name="background_dark_sc">#ff212121</color>
<color name="background_black_sc">#ff000000</color>
<color name="background_floating_sc">#42ffffff</color>
<color name="background_floating_sc">#ff424242</color>
<color name="list_divider_color_sc">#80ffffff</color>
</resources>

View File

@ -13,7 +13,6 @@
<string name="dark_theme">Dark Theme</string>
<string name="black_them">Black Theme</string>
<string name="status_theme">Status.im Theme</string>
<string name="sc_theme">SC Theme</string>
<!-- permanent notification subtitle -->
<string name="notification_sync_init">Initializing service</string>

View File

@ -3,6 +3,11 @@
<string name="redacted_stub_text">(Deleted message)</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>
<string name="sc_dark_colored_theme">SC Dark, colored bubbles</string>
<string name="bubble_style">Message bubbles</string>
<string name="bubble_style_none">None</string>
<string name="bubble_style_start">Same side</string>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="VectorButtonStyle.SC">
<item name="backgroundTint">@color/button_background_tint_selector_sc</item>
</style>
<style name="VectorAlertDialogStyleDark.SC">
<item name="buttonBarButtonStyle">@style/VectorAlertDialogButtonStyle.SC</item>
</style>
<style name="VectorAlertDialogButtonStyle.SC">
<item name="android:textColor">@color/accent_sc</item>
</style>
<style name="Vector.TabView.SC" parent="Vector.TabView.Dark">
<item name="android:background">@drawable/vector_tabbar_background_sc</item>
<item name="background">@drawable/vector_tabbar_background_sc</item>
</style>
<!-- custom action bar -->
<style name="Vector.Styled.ActionBar.SC">
<item name="android:background">@color/background_dark_sc</item>
<item name="background">@color/background_dark_sc</item>
</style>
<!-- BottomSheet theming -->
<style name="Vector.BottomSheet.SC" parent="Vector.BottomSheet.Dark">
<item name="android:textColorPrimary">@color/text_color_primary_sc</item>
<item name="android:textColorSecondary">@color/text_color_secondary_sc</item>
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/text_color_tertiary_sc</item>
<item name="android:textColorLink">@color/riotx_links</item>
</style>
</resources>

View File

@ -4,8 +4,8 @@
<!-- SC THEME COLORS -->
<style name="AppTheme.Base.SC" parent="AppTheme.Base.Black">
<!-- Riotx attribute for palette -->
<item name="riotx_background">@color/background_sc</item>
<item name="riotx_base">@color/background_sc</item>
<item name="riotx_background">@color/background_black_sc</item>
<item name="riotx_base">?riotx_background</item>
<item name="riotx_base_text_icon_primary">@color/text_color_primary_sc</item>
<item name="riotx_base_text_icon_secondary">@color/text_color_secondary_sc</item>
<item name="riotx_search_background_mobile">@color/background_dark_sc</item>
@ -28,7 +28,7 @@
<item name="riotx_fab_label_bg">@color/background_floating_sc</item>
<item name="riotx_fab_label_color">#ff808080</item><!-- TODO: this is used on light background for motion_fab_menu_merge / style:VectorLabel -->
<item name="riotx_touch_guard_bg">@color/background_black_sc</item>
<item name="riotx_attachment_selector_background">@color/background_sc</item>
<item name="riotx_attachment_selector_background">?riotx_background</item>
<item name="riotx_attachment_selector_border">@color/background_dark_sc</item>
<item name="riotx_keys_backup_banner_accent_color">@color/background_floating_sc</item>
@ -163,10 +163,7 @@
<item name="vctr_widget_banner_background">@color/background_floating_sc</item>
<!-- activities background -->
<item name="android:windowBackground">@color/background_sc</item>
<!-- TODO from here, also add chat colors -->
<item name="android:windowBackground">?riotx_background</item>
<!-- custom action bar -->
<item name="android:actionBarStyle">@style/Vector.Styled.ActionBar.SC</item>
@ -204,41 +201,33 @@
<!-- Style to use for message text within a SnackBar in this theme. -->
<item name="snackbarTextViewStyle">@style/VectorSnackBarText</item>
<item name="sc_message_bg_incoming">@color/background_floating_sc</item>
<item name="sc_message_bg_outgoing">@color/background_sc</item>
</style>
<style name="AppTheme.Base.SC.Dark">
<item name="riotx_background">@color/background_dark_sc</item>
<item name="riotx_header_panel_background">@color/background_sc</item>
</style>
<style name="AppTheme.Base.SC.Colored">
<item name="sc_message_bg_incoming">@color/background_floating_sc</item>
<item name="sc_message_bg_outgoing">@color/accent_sc_alpha25</item>
</style>
<style name="AppTheme.Base.SC.Dark.Colored">
<item name="sc_message_bg_incoming">@color/background_floating_sc</item>
<item name="sc_message_bg_outgoing">@color/accent_sc_alpha25</item>
</style>
<style name="AppTheme.SC" parent="AppTheme.Base.SC" />
<style name="VectorButtonStyle.SC">
<item name="backgroundTint">@color/button_background_tint_selector_sc</item>
</style>
<style name="AppTheme.SC.Dark" parent="AppTheme.Base.SC.Dark" />
<style name="VectorAlertDialogStyleDark.SC">
<item name="buttonBarButtonStyle">@style/VectorAlertDialogButtonStyle.SC</item>
</style>
<style name="AppTheme.SC.Colored" parent="AppTheme.Base.SC.Colored" />
<style name="VectorAlertDialogButtonStyle.SC">
<item name="android:textColor">@color/accent_sc</item>
</style>
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.Base.SC.Dark.Colored" />
<style name="Vector.TabView.SC" parent="Vector.TabView.Dark">
<item name="android:background">@drawable/vector_tabbar_background_sc</item>
<item name="background">@drawable/vector_tabbar_background_sc</item>
</style>
<!-- custom action bar -->
<style name="Vector.Styled.ActionBar.SC">
<item name="android:background">@color/background_dark_sc</item>
<item name="background">@color/background_dark_sc</item>
</style>
<!-- BottomSheet theming -->
<style name="Vector.BottomSheet.SC" parent="Vector.BottomSheet.Dark">
<item name="android:textColorPrimary">@color/text_color_primary_sc</item>
<item name="android:textColorSecondary">@color/text_color_secondary_sc</item>
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/text_color_tertiary_sc</item>
<item name="android:textColorLink">@color/riotx_links</item>
</style>
</resources>