From 51f5594ea0309cf03b034cd41920d28804a705e9 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 5 Jun 2019 14:31:11 +0200 Subject: [PATCH] Theme rework WIP --- .../features/home/AvatarRenderer.kt | 6 +- .../riotredesign/features/home/UserColor.kt | 18 ++-- .../main/res/layout/activity_bug_report.xml | 5 +- .../layout/activity_emoji_reaction_picker.xml | 3 +- .../layout/activity_image_media_viewer.xml | 5 +- vector/src/main/res/layout/activity_login.xml | 3 + .../res/layout/activity_vector_settings.xml | 4 +- .../layout/activity_video_media_viewer.xml | 6 +- .../res/layout/dialog_change_password.xml | 3 + .../main/res/layout/fragment_home_detail.xml | 8 +- .../main/res/layout/fragment_home_drawer.xml | 2 +- .../main/res/layout/fragment_public_rooms.xml | 9 +- .../main/res/layout/fragment_room_detail.xml | 11 +-- .../layout/fragment_room_directory_picker.xml | 1 + .../fragment_room_preview_no_preview.xml | 7 +- ...nt_settings_notifications_troubleshoot.xml | 4 +- .../src/main/res/layout/item_error_retry.xml | 1 - vector/src/main/res/layout/item_group.xml | 3 +- .../layout/item_notification_troubleshoot.xml | 2 +- .../item_timeline_event_text_message_stub.xml | 2 +- .../main/res/layout/vector_invite_view.xml | 2 +- .../src/main/res/layout/view_button_state.xml | 14 ++- .../src/main/res/values-v21/theme_light.xml | 7 +- .../src/main/res/values-v23/theme_light.xml | 15 +++ .../src/main/res/values-v27/theme_light.xml | 10 ++ vector/src/main/res/values/colors.xml | 4 +- vector/src/main/res/values/colors_riot.xml | 17 +--- vector/src/main/res/values/colors_riotx.xml | 99 +++++++++++++++++++ vector/src/main/res/values/styles_riot.xml | 43 ++++---- vector/src/main/res/values/styles_widget.xml | 12 --- vector/src/main/res/values/theme_common.xml | 11 +++ vector/src/main/res/values/theme_light.xml | 31 ++++-- vector/src/main/res/values/theme_status.xml | 2 - 33 files changed, 243 insertions(+), 127 deletions(-) create mode 100644 vector/src/main/res/values-v23/theme_light.xml create mode 100644 vector/src/main/res/values-v27/theme_light.xml create mode 100644 vector/src/main/res/values/colors_riotx.xml delete mode 100644 vector/src/main/res/values/styles_widget.xml create mode 100644 vector/src/main/res/values/theme_common.xml diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/AvatarRenderer.kt b/vector/src/main/java/im/vector/riotredesign/features/home/AvatarRenderer.kt index be16ac5c..7975206f 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/AvatarRenderer.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/AvatarRenderer.kt @@ -45,9 +45,9 @@ object AvatarRenderer { private const val THUMBNAIL_SIZE = 250 private val AVATAR_COLOR_LIST = listOf( - R.color.avatar_color_1, - R.color.avatar_color_2, - R.color.avatar_color_3 + R.color.riotx_avatar_fill_1, + R.color.riotx_avatar_fill_2, + R.color.riotx_avatar_fill_3 ) @UiThread diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/UserColor.kt b/vector/src/main/java/im/vector/riotredesign/features/home/UserColor.kt index 8e26bf30..bd3f60f4 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/UserColor.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/UserColor.kt @@ -23,7 +23,7 @@ import im.vector.riotredesign.R @ColorRes fun getColorFromUserId(userId: String?): Int { if (userId.isNullOrBlank()) { - return R.color.username_1 + return R.color.riotx_username_1 } var hash = 0 @@ -37,13 +37,13 @@ fun getColorFromUserId(userId: String?): Int { } return when (Math.abs(hash) % 8 + 1) { - 1 -> R.color.username_1 - 2 -> R.color.username_2 - 3 -> R.color.username_3 - 4 -> R.color.username_4 - 5 -> R.color.username_5 - 6 -> R.color.username_6 - 7 -> R.color.username_7 - else -> R.color.username_8 + 1 -> R.color.riotx_username_1 + 2 -> R.color.riotx_username_2 + 3 -> R.color.riotx_username_3 + 4 -> R.color.riotx_username_4 + 5 -> R.color.riotx_username_5 + 6 -> R.color.riotx_username_6 + 7 -> R.color.riotx_username_7 + else -> R.color.riotx_username_8 } } \ No newline at end of file diff --git a/vector/src/main/res/layout/activity_bug_report.xml b/vector/src/main/res/layout/activity_bug_report.xml index 4d87ced7..b7727f03 100644 --- a/vector/src/main/res/layout/activity_bug_report.xml +++ b/vector/src/main/res/layout/activity_bug_report.xml @@ -7,9 +7,9 @@ + android:layout_height="wrap_content" + android:elevation="4dp" /> + app:layout_scrollFlags="scroll|exitUntilCollapsed|snap|enterAlways" /> + android:elevation="4dp" /> + android:layout_height="wrap_content" + android:elevation="4dp" /> + android:elevation="4dp" /> @@ -50,6 +51,7 @@ @@ -64,6 +66,7 @@ diff --git a/vector/src/main/res/layout/fragment_home_detail.xml b/vector/src/main/res/layout/fragment_home_detail.xml index 1c505436..3867680f 100644 --- a/vector/src/main/res/layout/fragment_home_detail.xml +++ b/vector/src/main/res/layout/fragment_home_detail.xml @@ -8,16 +8,12 @@ + app:layout_constraintTop_toTopOf="parent"> diff --git a/vector/src/main/res/layout/fragment_home_drawer.xml b/vector/src/main/res/layout/fragment_home_drawer.xml index 8bbd52c2..7e7caf9c 100644 --- a/vector/src/main/res/layout/fragment_home_drawer.xml +++ b/vector/src/main/res/layout/fragment_home_drawer.xml @@ -11,7 +11,7 @@ android:id="@+id/homeDrawerHeader" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/colorPrimary" + android:background="@color/dark_two" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> diff --git a/vector/src/main/res/layout/fragment_public_rooms.xml b/vector/src/main/res/layout/fragment_public_rooms.xml index 6db130e8..03e78260 100644 --- a/vector/src/main/res/layout/fragment_public_rooms.xml +++ b/vector/src/main/res/layout/fragment_public_rooms.xml @@ -17,18 +17,15 @@ + android:layout_height="wrap_content" + android:elevation="4dp"> + app:layout_scrollFlags="noScroll"> + app:layout_constraintTop_toTopOf="parent"> + tools:text="@sample/matrix.json/data/roomName" /> + tools:text="@sample/matrix.json/data/roomTopic" /> diff --git a/vector/src/main/res/layout/fragment_room_directory_picker.xml b/vector/src/main/res/layout/fragment_room_directory_picker.xml index ec6e9f33..eb7af92b 100644 --- a/vector/src/main/res/layout/fragment_room_directory_picker.xml +++ b/vector/src/main/res/layout/fragment_room_directory_picker.xml @@ -16,6 +16,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" + android:elevation="4dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/vector/src/main/res/layout/fragment_room_preview_no_preview.xml b/vector/src/main/res/layout/fragment_room_preview_no_preview.xml index e18416dc..f05a9587 100644 --- a/vector/src/main/res/layout/fragment_room_preview_no_preview.xml +++ b/vector/src/main/res/layout/fragment_room_preview_no_preview.xml @@ -13,13 +13,10 @@ + android:elevation="4dp" + app:contentInsetStartWithNavigation="0dp"> - diff --git a/vector/src/main/res/layout/vector_invite_view.xml b/vector/src/main/res/layout/vector_invite_view.xml index c4660fcc..0a6a8cf6 100644 --- a/vector/src/main/res/layout/vector_invite_view.xml +++ b/vector/src/main/res/layout/vector_invite_view.xml @@ -74,12 +74,12 @@