From dab04d52fd3d884e22494d67617e8295c64c8b79 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Mon, 28 Jun 2021 13:44:57 +0200 Subject: [PATCH] More SC theme improvements, including a reworked light theme Change-Id: I373daedc45bee3aa9e24e09bb632b01e27754010 --- .../src/main/res/values-v23/theme_sc.xml | 2 +- .../src/main/res/values/colors_sc.xml | 24 ++++ .../main/res/values/styles_app_bar_layout.xml | 2 + .../src/main/res/values/theme_sc.xml | 2 +- .../src/main/res/values/theme_sc_light.xml | 111 +++++++++++++----- .../app/core/ui/list/GenericFooterItem.kt | 12 ++ .../roomprofile/RoomProfileController.kt | 3 + .../res/layout/item_expandable_textview.xml | 4 +- .../main/res/layout/item_generic_footer.xml | 2 +- 9 files changed, 125 insertions(+), 37 deletions(-) diff --git a/library/ui-styles/src/main/res/values-v23/theme_sc.xml b/library/ui-styles/src/main/res/values-v23/theme_sc.xml index bd2aca8466..1b0602230f 100644 --- a/library/ui-styles/src/main/res/values-v23/theme_sc.xml +++ b/library/ui-styles/src/main/res/values-v23/theme_sc.xml @@ -18,7 +18,7 @@ diff --git a/library/ui-styles/src/main/res/values/colors_sc.xml b/library/ui-styles/src/main/res/values/colors_sc.xml index 8d1accc342..97fb023ac3 100644 --- a/library/ui-styles/src/main/res/values/colors_sc.xml +++ b/library/ui-styles/src/main/res/values/colors_sc.xml @@ -1,6 +1,7 @@ + #8BC34A #3F8BC34A #1E8BC34A @@ -13,29 +14,52 @@ @color/accent_sc_300 @color/accent_sc_dark + @color/accent_sc @color/accent_sc + #ffffff #b3ffffff #80ffffff #80ffffff + #ff303030 #ff212121 #ff000000 #ff424242 #bf000000 + + #de000000 + #8a000000 + #4c000000 + #4c000000 + + + #ffffffff + #fffafafa + #ffeeeeee + #fff5f5f5 + #ffe0e0e0 + #ffffffff + #61000000 + + #1fffffff #1f000000 + #ffffff #80000000 + @color/accent_sc_50 @color/accent_sc_900 + #76cfa6 + diff --git a/library/ui-styles/src/main/res/values/styles_app_bar_layout.xml b/library/ui-styles/src/main/res/values/styles_app_bar_layout.xml index 973a2c5e4a..bca8f4a49d 100644 --- a/library/ui-styles/src/main/res/values/styles_app_bar_layout.xml +++ b/library/ui-styles/src/main/res/values/styles_app_bar_layout.xml @@ -3,7 +3,9 @@ \ No newline at end of file diff --git a/library/ui-styles/src/main/res/values/theme_sc.xml b/library/ui-styles/src/main/res/values/theme_sc.xml index f315a836f7..3905f72bb2 100644 --- a/library/ui-styles/src/main/res/values/theme_sc.xml +++ b/library/ui-styles/src/main/res/values/theme_sc.xml @@ -27,7 +27,7 @@ ?vctr_content_secondary @color/background_sc @color/sc_reaction_background_on_dark - #555555 + #55555555 @android:color/transparent ?android:colorBackground diff --git a/library/ui-styles/src/main/res/values/theme_sc_light.xml b/library/ui-styles/src/main/res/values/theme_sc_light.xml index fdc636ab36..e18106777e 100644 --- a/library/ui-styles/src/main/res/values/theme_sc_light.xml +++ b/library/ui-styles/src/main/res/values/theme_sc_light.xml @@ -3,51 +3,98 @@ diff --git a/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt b/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt index 8adad00a1a..0f197a9e48 100644 --- a/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt +++ b/vector/src/main/java/im/vector/app/core/ui/list/GenericFooterItem.kt @@ -16,6 +16,7 @@ package im.vector.app.core.ui.list import android.view.Gravity +import android.widget.LinearLayout import android.widget.TextView import androidx.annotation.ColorInt import com.airbnb.epoxy.EpoxyAttribute @@ -53,6 +54,10 @@ abstract class GenericFooterItem : VectorEpoxyModel() @ColorInt var textColor: Int? = null + @EpoxyAttribute + @ColorInt + var backgroundColor: Int? = null + override fun bind(holder: Holder) { super.bind(holder) @@ -67,10 +72,17 @@ abstract class GenericFooterItem : VectorEpoxyModel() holder.text.setTextColor(ThemeUtils.getColor(holder.view.context, R.attr.vctr_content_secondary)) } + if (backgroundColor != null) { + holder.layout.setBackgroundColor(backgroundColor!!) + } else { + holder.layout.background = null + } + holder.view.onClick(itemClickAction) } class Holder : VectorEpoxyHolder() { val text by bind(R.id.itemGenericFooterText) + val layout by bind(R.id.itemGenericFooterLayout) } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt index 45f2bc1d9e..8f945a6efa 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt @@ -22,6 +22,7 @@ import im.vector.app.R import im.vector.app.core.epoxy.expandableTextItem import im.vector.app.core.epoxy.profiles.buildProfileAction import im.vector.app.core.epoxy.profiles.buildProfileSection +import im.vector.app.core.resources.ColorProvider import im.vector.app.core.resources.StringProvider import im.vector.app.core.ui.list.genericFooterItem import im.vector.app.features.home.ShortcutCreator @@ -34,6 +35,7 @@ import javax.inject.Inject class RoomProfileController @Inject constructor( private val stringProvider: StringProvider, + private val colorProvider: ColorProvider, private val vectorPreferences: VectorPreferences, private val shortcutCreator: ShortcutCreator ) : TypedEpoxyController() { @@ -98,6 +100,7 @@ class RoomProfileController @Inject constructor( id("e2e info") centered(false) text(host.stringProvider.getString(learnMoreSubtitle)) + backgroundColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_header_background)) } // SC: Move down in the list, this one-time action is not important to enough to show this prevalent at the top //buildEncryptionAction(data.actionPermissions, roomSummary) diff --git a/vector/src/main/res/layout/item_expandable_textview.xml b/vector/src/main/res/layout/item_expandable_textview.xml index 65a04af425..71406da2ae 100644 --- a/vector/src/main/res/layout/item_expandable_textview.xml +++ b/vector/src/main/res/layout/item_expandable_textview.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?android:colorBackground" + android:background="?vctr_header_background" android:padding="16dp"> - \ No newline at end of file + diff --git a/vector/src/main/res/layout/item_generic_footer.xml b/vector/src/main/res/layout/item_generic_footer.xml index 0977fa172b..41cfead373 100644 --- a/vector/src/main/res/layout/item_generic_footer.xml +++ b/vector/src/main/res/layout/item_generic_footer.xml @@ -1,9 +1,9 @@