|
| 1 | +# Color migration |
| 2 | + |
| 3 | +### Changes |
| 4 | + |
| 5 | +- use colors defined in https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 |
| 6 | +- remove unused resources and code (ex: PercentView) |
| 7 | +- split some resource files into smaller file |
| 8 | +- rework the theme files |
| 9 | +- ensure material theme is used everywhere in the theme and in the layout |
| 10 | +- add default style for some views in the theme (ex: Toolbar, etc.) |
| 11 | +- add some debug screen in the debug menu, to test the themes and the button style |
| 12 | +- rework the button style to use `materialThemeOverlay` attribute |
| 13 | +- custom tint icon for menu management has been removed |
| 14 | +- comment with `riotx` has been updated |
| 15 | + |
| 16 | +### Main change for developers |
| 17 | + |
| 18 | +- Read migration guide: https://github.com./vector-im/element-android/pull/3459/files#diff-f0e52729d5e4f6eccbcf72246807aa34ed19c4ef5625ca669df998cd1022874b |
| 19 | +- Use MaterialAlertDialogBuilder instead of AlertDialog.Builder |
| 20 | +- some Epoxy Item included a divider. This has been removed. Use a `dividerItem` or `bottomSheetDividerItem` Epoxy items to add a divider |
| 21 | +- RecyclerView.configureWith now take a divider drawable instead of a divider color |
| 22 | + |
| 23 | +### Remaining work |
| 24 | + |
| 25 | +- Cleanup some vector drawables and ensure a tint is always used instead of hard coded color. |
| 26 | + |
| 27 | +### Migration guide |
| 28 | + |
| 29 | +Some colors and color attribute has been removed, here is the list and what has to be used now. |
| 30 | + |
| 31 | +It can help Element Android forks maintainers to migrate their code. |
| 32 | + |
| 33 | +- riotx_text_primary -> ?vctr_content_primary |
| 34 | +- riotx_text_secondary -> ?vctr_content_secondary |
| 35 | +- riotx_text_tertiary -> ?vctr_content_tertiary |
| 36 | + |
| 37 | +- ?riotx_background -> ?android:colorBackground |
| 38 | +- riotx_background_light -> element_background_light |
| 39 | +- riotx_background_dark -> element_background_dark |
| 40 | +- riotx_background_black -> element_background_black |
| 41 | + |
| 42 | +- riotx_accent -> ?colorPrimary |
| 43 | +- riotx_positive_accent -> ?colorPrimary |
| 44 | +- riotx_accent_alpha25 -> color_primary_alpha25 |
| 45 | +- riotx_notice -> ?colorError |
| 46 | +- riotx_destructive_accent -> ?colorError |
| 47 | +- vector_error_color -> ?colorError |
| 48 | +- vector_warning_color -> ?colorError |
| 49 | + |
| 50 | +- riotx_bottom_sheet_background -> ?colorSurface |
| 51 | +- riotx_alerter_background -> ?colorSurface |
| 52 | + |
| 53 | +- riotx_username_1 -> element_name_01 |
| 54 | +- riotx_username_2 -> element_name_02 |
| 55 | +- riotx_username_3 -> element_name_03 |
| 56 | +- riotx_username_4 -> element_name_04 |
| 57 | +- riotx_username_5 -> element_name_05 |
| 58 | +- riotx_username_6 -> element_name_06 |
| 59 | +- riotx_username_7 -> element_name_07 |
| 60 | +- riotx_username_8 -> element_name_08 |
| 61 | + |
| 62 | +- riotx_avatar_fill_1 -> element_room_01 |
| 63 | +- riotx_avatar_fill_2 -> element_room_02 |
| 64 | +- riotx_avatar_fill_3 -> element_room_03 |
| 65 | + |
| 66 | +- white -> @android:color/white |
| 67 | +- black -> @android:color/black or emoji_color |
| 68 | + |
| 69 | +- riotx_list_header_background_color -> ?vctr_header_background |
| 70 | +- riotx_header_panel_background -> ?vctr_header_background |
| 71 | +- riotx_list_bottom_sheet_divider_color -> ?vctr_list_separator_on_surface |
| 72 | +- riotx_list_divider_color -> ?vctr_list_separator |
| 73 | +- list_divider_color -> ?vctr_list_separator |
| 74 | +- riotx_header_panel_border_mobile -> ?vctr_list_separator |
| 75 | +- riotx_bottom_nav_background_border_color -> ?vctr_list_separator |
| 76 | +- riotx_header_panel_text_secondary -> ?vctr_content_primary |
| 77 | + |
| 78 | +- link_color_light -> element_link_light |
| 79 | +- link_color_dark -> element_link_dark |
| 80 | + |
| 81 | +- riotx_toolbar_primary_text_color -> vctr_content_primary |
| 82 | +- riotx_toolbar_secondary_text_color -> vctr_content_primary |
| 83 | +- riot_primary_text_color -> vctr_content_primary |
| 84 | + |
| 85 | +- riotx_android_secondary -> vctr_content_secondary |
0 commit comments