Merge pull request #2828 from vector-im/feature/bma/color_step_1

First step about color cleanup
This commit is contained in:
Benoit Marty 2021-02-17 18:27:44 +01:00 committed by GitHub
commit fc1c2bc2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 157 additions and 165 deletions

View File

@ -30,6 +30,7 @@ Test:
Other changes:
- New Dev Tools panel for developers
- Fix typos in CHANGES.md (#2811)
- Colors rework: first step: merge file `colors_riot.xml` to file `colors_riotx.xml` and rename the file to `colors.xml`
Changes in Element 1.0.17 (2021-02-09)
===================================================

View File

@ -83,12 +83,12 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
fun setAudioDevice(device: Device) {
runInAudioThread(Runnable {
if (!_availableDevices.contains(device)) {
Timber.w(" Audio device not available: $device")
Timber.w("Audio device not available: $device")
userSelectedDevice = null
return@Runnable
}
if (mode != Mode.DEFAULT) {
Timber.i(" User selected device set to: $device")
Timber.i("User selected device set to: $device")
userSelectedDevice = device
updateAudioRoute(mode, false)
}
@ -108,7 +108,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
success = updateAudioRoute(mode, false)
} catch (e: Throwable) {
success = false
Timber.e(e, " Failed to update audio route for mode: " + mode)
Timber.e(e, "Failed to update audio route for mode: $mode")
}
if (success) {
this@CallAudioManager.mode = mode
@ -124,7 +124,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
* `false`, otherwise.
*/
private fun updateAudioRoute(mode: Mode, force: Boolean): Boolean {
Timber.i(" Update audio route for mode: " + mode)
Timber.i("Update audio route for mode: $mode")
if (!audioDeviceRouter?.setMode(mode).orFalse()) {
return false
}
@ -158,7 +158,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
return true
}
selectedDevice = audioDevice
Timber.i(" Selected audio device: " + audioDevice)
Timber.i("Selected audio device: $audioDevice")
audioDeviceRouter?.setAudioRoute(audioDevice)
configChange?.invoke()
return true

View File

@ -1,55 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="VectorStyles">
<!-- application bar text color -->
<attr name="vctr_toolbar_primary_text_color" format="color" />
<attr name="vctr_toolbar_secondary_text_color" format="color" />
<attr name="vctr_toolbar_link_text_color" format="color" />
<!-- application bar text color -->
<attr name="vctr_toolbar_primary_text_color" format="color" />
<attr name="vctr_toolbar_secondary_text_color" format="color" />
<attr name="vctr_toolbar_link_text_color" format="color" />
<!-- default text colors -->
<attr name="vctr_default_text_hint_color" format="color" />
<!-- default text colors -->
<attr name="vctr_default_text_hint_color" format="color" />
<!-- room message colors -->
<attr name="vctr_unsent_message_text_color" format="color" />
<attr name="vctr_message_text_color" format="color" />
<attr name="vctr_notice_text_color" format="color" />
<attr name="vctr_notice_secondary" format="color" />
<attr name="vctr_encrypting_message_text_color" format="color" />
<attr name="vctr_sending_message_text_color" format="color" />
<attr name="vctr_markdown_block_background_color" format="color" />
<attr name="vctr_spoiler_background_color" format="color" />
<!-- room message colors -->
<attr name="vctr_unsent_message_text_color" format="color" />
<attr name="vctr_message_text_color" format="color" />
<attr name="vctr_notice_text_color" format="color" />
<attr name="vctr_notice_secondary" format="color" />
<attr name="vctr_encrypting_message_text_color" format="color" />
<attr name="vctr_sending_message_text_color" format="color" />
<attr name="vctr_markdown_block_background_color" format="color" />
<attr name="vctr_spoiler_background_color" format="color" />
<!-- tab bar colors -->
<attr name="vctr_tab_bar_inverted_background_color" format="color" />
<!-- tab bar colors -->
<attr name="vctr_tab_bar_inverted_background_color" format="color" />
<!-- list colors -->
<attr name="vctr_list_header_background_color" format="color" />
<attr name="vctr_list_header_primary_text_color" format="color" />
<attr name="vctr_list_header_secondary_text_color" format="color" />
<!-- list colors -->
<attr name="vctr_list_header_background_color" format="color" />
<attr name="vctr_list_header_primary_text_color" format="color" />
<attr name="vctr_list_header_secondary_text_color" format="color" />
<attr name="vctr_list_divider_color" format="color" />
<attr name="vctr_list_divider_color" format="color" />
<!-- outgoing call background color -->
<attr name="vctr_pending_outgoing_view_background_color" format="color" />
<!-- outgoing call background color -->
<attr name="vctr_pending_outgoing_view_background_color" format="color" />
<!-- room notification text color (typing, unsent...) -->
<attr name="vctr_room_notification_text_color" format="color" />
<!-- room notification text color (typing, unsent...) -->
<attr name="vctr_room_notification_text_color" format="color" />
<!-- icon colors -->
<attr name="vctr_icon_tint_on_light_action_bar_color" format="color" />
<attr name="vctr_settings_icon_tint_color" format="color" />
<!-- icon colors -->
<attr name="vctr_icon_tint_on_light_action_bar_color" format="color" />
<attr name="vctr_settings_icon_tint_color" format="color" />
<attr name="vctr_social_login_button_google_style" format="reference" />
<attr name="vctr_social_login_button_github_style" format="reference" />
<attr name="vctr_social_login_button_facebook_style" format="reference" />
<attr name="vctr_social_login_button_twitter_style" format="reference" />
<attr name="vctr_social_login_button_apple_style" format="reference" />
<attr name="vctr_social_login_button_gitlab_style" format="reference" />
<attr name="vctr_social_login_button_google_style" format="reference" />
<attr name="vctr_social_login_button_github_style" format="reference" />
<attr name="vctr_social_login_button_facebook_style" format="reference" />
<attr name="vctr_social_login_button_twitter_style" format="reference" />
<attr name="vctr_social_login_button_apple_style" format="reference" />
<attr name="vctr_social_login_button_gitlab_style" format="reference" />
<attr name="vctr_chat_effect_snow_background" format="color" />
</declare-styleable>
<attr name="vctr_chat_effect_snow_background" format="color" />
<declare-styleable name="PollResultLineView">
<attr name="optionName" format="string" localization="suggested" />
@ -70,16 +67,16 @@
<declare-styleable name="SignOutBottomSheetActionButton">
<attr name="iconTint" format="color" />
<attr name="actionTitle"/>
<attr name="actionTitle" />
<attr name="leftIcon" />
<attr name="textColor" format="color" />
</declare-styleable>
<declare-styleable name="SocialLoginButtonsView">
<attr name="signMode" format="enum">
<enum name="signin" value="0"/>
<enum name="signup" value="1"/>
<enum name="continue_with" value="2"/>
<enum name="signin" value="0" />
<enum name="signup" value="1" />
<enum name="continue_with" value="2" />
</attr>
</declare-styleable>
</resources>

View File

@ -1,7 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Source: https://zpl.io/aBKw9Mk -->
<!-- Error colors -->
<color name="vector_success_color">#70BF56</color>
<color name="vector_warning_color">#ff4b55</color>
<color name="vector_error_color">#ff4b55</color>
<color name="vector_info_color">#2f9edb</color>
<!-- main app colors -->
<color name="vector_fuchsia_color">#ff4b55</color>
<color name="vector_silver_color">#FFC7C7C7</color>
<color name="vector_dark_grey_color">#FF999999</color>
<!-- theses colours are requested a background cannot be set by an ?attr on android < 5 -->
<!-- dedicated drawables are created for each theme -->
<!-- Default/Background-->
<color name="riot_primary_background_color_light">#FFFFFFFF</color>
<!-- Dark/Background-->
<color name="riot_primary_background_color_dark">#FF181B21</color>
<!-- Black/Background-->
<color name="riot_primary_background_color_black">#F000</color>
<!--Default/Android Status Bar-->
<color name="primary_color_dark_light">#FF1A2027</color>
<!--Default/Base-->
<color name="primary_color_light">#03b381</color>
<!--Default/Accent-->
<color name="accent_color_light">#03b381</color>
<!--Dark/Android Status Bar-->
<color name="primary_color_dark_dark">#FF0D0E10</color>
<!--Dark/Base-->
<color name="primary_color_dark">#FF15171B</color>
<!--Dark/Accent-->
<color name="accent_color_dark">#03b381</color>
<!--Black/Android Status Bar-->
<color name="primary_color_dark_black">#000</color>
<!--Black/Base-->
<color name="primary_color_black">#FF060708</color>
<!--Default/Line break mobile-->
<attr name="list_divider_color" format="color" />
<color name="list_divider_color_light">#EEEFEF</color>
<!--Dark/Line break mobile-->
<color name="list_divider_color_dark">#FF61708B</color>
<!--Black/Line break mobile-->
<color name="list_divider_color_black">#FF22262E</color>
<attr name="tab_bar_selected_background_color" format="color" />
<color name="tab_bar_selected_background_color_light">@color/riotx_android_secondary_light</color>
<color name="tab_bar_selected_background_color_dark">@color/riotx_android_secondary_dark</color>
<attr name="tab_bar_unselected_background_color" format="color" />
<color name="tab_bar_unselected_background_color_light">@color/riotx_background_light</color>
<color name="tab_bar_unselected_background_color_dark">@color/riotx_background_dark</color>
<!-- Hint Colors -->
<color name="primary_hint_text_color_light">#FFFFFF</color>
<color name="primary_hint_text_color_dark">#FFFFFF</color>
<color name="default_text_hint_color_light">#903C3C3C</color>
<color name="default_text_hint_color_dark">#CCDDDDDD</color>
<!-- Text Colors -->
<attr name="riot_primary_text_color" format="color" />
<attr name="riot_primary_text_color_disabled" format="color" />
<!--Default/Text Primary-->
<color name="riot_primary_text_color_light">#FF2E2F32</color>
<color name="riot_primary_text_color_disabled_light">#FF9E9E9E</color>
<!--Default/Text Secondary-->
<color name="riot_secondary_text_color_light">#FF9E9E9E</color>
<color name="riot_tertiary_text_color_light">@color/riot_primary_text_color_light</color>
<!--Dark /Text Primary-->
<color name="riot_primary_text_color_dark">#FFEDF3FF</color>
<color name="riot_primary_text_color_disabled_dark">#FFA1B2D1</color>
<!--Dark /Text Secondary-->
<color name="riot_secondary_text_color_dark">#FFA1B2D1</color>
<color name="riot_tertiary_text_color_dark">@color/riot_primary_text_color_dark</color>
<!-- Notification view colors -->
<color name="soft_resource_limit_exceeded">#2f9edb</color>
<color name="hard_resource_limit_exceeded">@color/vector_fuchsia_color</color>
<!-- Password Strength bar colors -->
<color name="password_strength_bar_weak">#FFF56679</color>
<color name="password_strength_bar_low">#FFFFC666</color>
<color name="password_strength_bar_ok">#FFF8E71C</color>
<color name="password_strength_bar_strong">#FF7AC9A1</color>
<color name="password_strength_bar_undefined">#FF9E9E9E</color>
<!-- Button color -->
<color name="button_enabled_text_color">#FFFFFFFF</color>
<color name="button_disabled_text_color">#FFFFFFFF</color>
<color name="button_destructive_enabled_text_color">#FF4B55</color>
<color name="button_destructive_disabled_text_color">#FF4B55</color>
<color name="button_bot_enabled_text_color">#FF368BD6</color>
<color name="button_bot_disabled_text_color">#61708B</color>
<!-- Link color -->
<color name="link_color_light">#368BD6</color>
<color name="link_color_dark">#368BD6</color>
<!-- Notification (do not depends on theme) -->
<color name="notification_accent_color">#368BD6</color>
<color name="key_share_req_accent_color">#ff812d</color>
<!-- Source: https://zpl.io/aBKw9Mk -->
<!-- Accents -->
<color name="riotx_accent">#FF0DBD8B</color>
@ -38,7 +146,7 @@
<color name="riotx_username_7">#5c56f5</color>
<color name="riotx_username_8">#74d12c</color>
<!-- Other usefull color -->
<!-- Other useful color -->
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="black_alpha">#55000000</color>
@ -256,6 +364,4 @@
<color name="riotx_keys_backup_banner_accent_color_light">#FFF8E3</color>
<color name="riotx_keys_backup_banner_accent_color_dark">#22262E</color>
</resources>
</resources>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Error colors -->
<color name="vector_success_color">#70BF56</color>
<color name="vector_warning_color">#ff4b55</color>
<color name="vector_error_color">#ff4b55</color>
<color name="vector_info_color">#2f9edb</color>
<!-- main app colors -->
<color name="vector_fuchsia_color">#ff4b55</color>
<color name="vector_silver_color">#FFC7C7C7</color>
<color name="vector_dark_grey_color">#FF999999</color>
<!-- theses colours are requested a background cannot be set by an ?attr on android < 5 -->
<!-- dedicated drawables are created for each theme -->
<!-- Default/Background-->
<color name="riot_primary_background_color_light">#FFFFFFFF</color>
<!-- Dark/Background-->
<color name="riot_primary_background_color_dark">#FF181B21</color>
<!-- Black/Background-->
<color name="riot_primary_background_color_black">#F000</color>
<!--Default/Android Status Bar-->
<color name="primary_color_dark_light">#FF1A2027</color>
<!--Default/Base-->
<color name="primary_color_light">#03b381</color>
<!--Default/Accent-->
<color name="accent_color_light">#03b381</color>
<!--Dark/Android Status Bar-->
<color name="primary_color_dark_dark">#FF0D0E10</color>
<!--Dark/Base-->
<color name="primary_color_dark">#FF15171B</color>
<!--Dark/Accent-->
<color name="accent_color_dark">#03b381</color>
<!--Black/Android Status Bar-->
<color name="primary_color_dark_black">#000</color>
<!--Black/Base-->
<color name="primary_color_black">#FF060708</color>
<!--Default/Line break mobile-->
<attr name="list_divider_color" format="color" />
<color name="list_divider_color_light">#EEEFEF</color>
<!--Dark/Line break mobile-->
<color name="list_divider_color_dark">#FF61708B</color>
<!--Black/Line break mobile-->
<color name="list_divider_color_black">#FF22262E</color>
<attr name="tab_bar_selected_background_color" format="color" />
<color name="tab_bar_selected_background_color_light">@color/riotx_android_secondary_light</color>
<color name="tab_bar_selected_background_color_dark">@color/riotx_android_secondary_dark</color>
<attr name="tab_bar_unselected_background_color" format="color" />
<color name="tab_bar_unselected_background_color_light">@color/riotx_background_light</color>
<color name="tab_bar_unselected_background_color_dark">@color/riotx_background_dark</color>
<!-- Hint Colors -->
<color name="primary_hint_text_color_light">#FFFFFF</color>
<color name="primary_hint_text_color_dark">#FFFFFF</color>
<color name="default_text_hint_color_light">#903C3C3C</color>
<color name="default_text_hint_color_dark">#CCDDDDDD</color>
<!-- Text Colors -->
<attr name="riot_primary_text_color" format="color" />
<attr name="riot_primary_text_color_disabled" format="color" />
<!--Default/Text Primary-->
<color name="riot_primary_text_color_light">#FF2E2F32</color>
<color name="riot_primary_text_color_disabled_light">#FF9E9E9E</color>
<!--Default/Text Secondary-->
<color name="riot_secondary_text_color_light">#FF9E9E9E</color>
<color name="riot_tertiary_text_color_light">@color/riot_primary_text_color_light</color>
<!--Dark /Text Primary-->
<color name="riot_primary_text_color_dark">#FFEDF3FF</color>
<color name="riot_primary_text_color_disabled_dark">#FFA1B2D1</color>
<!--Dark /Text Secondary-->
<color name="riot_secondary_text_color_dark">#FFA1B2D1</color>
<color name="riot_tertiary_text_color_dark">@color/riot_primary_text_color_dark</color>
<!-- Notification view colors -->
<color name="soft_resource_limit_exceeded">#2f9edb</color>
<color name="hard_resource_limit_exceeded">@color/vector_fuchsia_color</color>
<!-- Password Strength bar colors -->
<color name="password_strength_bar_weak">#FFF56679</color>
<color name="password_strength_bar_low">#FFFFC666</color>
<color name="password_strength_bar_ok">#FFF8E71C</color>
<color name="password_strength_bar_strong">#FF7AC9A1</color>
<color name="password_strength_bar_undefined">#FF9E9E9E</color>
<!-- Button color -->
<color name="button_enabled_text_color">#FFFFFFFF</color>
<color name="button_disabled_text_color">#FFFFFFFF</color>
<color name="button_destructive_enabled_text_color">#FF4B55</color>
<color name="button_destructive_disabled_text_color">#FF4B55</color>
<color name="button_bot_enabled_text_color">#FF368BD6</color>
<color name="button_bot_disabled_text_color">#61708B</color>
<!-- Link color -->
<color name="link_color_light">#368BD6</color>
<color name="link_color_dark">#368BD6</color>
<!-- Notification (do not depends on theme) -->
<color name="notification_accent_color">#368BD6</color>
<color name="key_share_req_accent_color">#ff812d</color>
</resources>