From 047c59eba0661fe3841289eff05b42eaadf69928 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 9 Jun 2021 11:51:04 +0200 Subject: [PATCH] Rework colors management --- .idea/dictionaries/bmarty.xml | 1 + CONTRIBUTING.md | 2 +- docs/color_migration_guide.md | 85 +++++ .../api/session/identity/IdentityService.kt | 2 +- .../internal/crypto/DefaultCryptoService.kt | 2 +- .../algorithms/megolm/MXMegolmDecryption.kt | 2 +- .../legacy/DefaultLegacySessionImporter.kt | 6 +- .../sdk/internal/network/UserAgentHolder.kt | 2 +- newsfragment/3459.feature | 2 + tools/check/forbidden_strings_in_code.txt | 3 +- .../check/forbidden_strings_in_resources.txt | 19 + vector/src/debug/AndroidManifest.xml | 19 +- .../app/features/debug/DebugBottomSheet.kt | 32 ++ .../debug/DebugMaterialThemeActivity.kt | 8 +- .../DebugMaterialThemeDarkDefaultActivity.kt | 19 + ... => DebugMaterialThemeDarkTestActivity.kt} | 2 +- .../DebugMaterialThemeDarkVectorActivity.kt | 19 + .../DebugMaterialThemeLightDefaultActivity.kt | 19 + ...=> DebugMaterialThemeLightTestActivity.kt} | 2 +- .../DebugMaterialThemeLightVectorActivity.kt | 19 + .../app/features/debug/DebugMenuActivity.kt | 31 +- .../debug/DebugVectorButtonStylesActivity.kt | 24 ++ .../layout/activity_debug_button_styles.xml | 131 +++++++ .../debug/res/layout/activity_debug_menu.xml | 91 ++++- .../layout/activity_test_material_theme.xml | 305 ++++++++++++++- vector/src/debug/res/layout/demo_themes.xml | 3 +- .../src/debug/res/layout/item_sas_emoji.xml | 2 +- .../debug/res/layout/item_test_linkify.xml | 4 +- vector/src/debug/res/values/styles.xml | 34 +- .../behavior/PercentViewBehavior.kt | 222 ----------- .../core/dialogs/ConfirmationDialogBuilder.kt | 4 +- .../vector/app/core/dialogs/DialogLocker.kt | 3 +- .../app/core/dialogs/ExportKeysDialog.kt | 4 +- .../im/vector/app/core/dialogs/Extensions.kt | 8 +- .../dialogs/GalleryOrCameraDialogHelper.kt | 5 +- .../app/core/dialogs/ManuallyVerifyDialog.kt | 4 +- .../app/core/dialogs/PhotoOrVideoDialog.kt | 6 +- .../app/core/dialogs/PromptPasswordDialog.kt | 3 +- .../dialogs/UnrecognizedCertificateDialog.kt | 4 +- .../app/core/epoxy/BottomSheetDividerItem.kt | 24 ++ .../im/vector/app/core/epoxy/DividerItem.kt | 15 - .../bottomsheet/BottomSheetActionItem.kt | 8 +- .../bottomsheet/BottomSheetRoomPreviewItem.kt | 11 +- .../core/epoxy/profiles/ProfileActionItem.kt | 11 +- .../epoxy/profiles/ProfileItemExtensions.kt | 2 - .../app/core/extensions/RecyclerView.kt | 9 +- .../im/vector/app/core/extensions/TextView.kt | 9 +- .../platform/BadgeFloatingActionButton.kt | 4 + .../app/core/platform/VectorBaseActivity.kt | 5 - .../app/core/platform/VectorBaseFragment.kt | 4 +- .../app/core/preference/VectorPreference.kt | 4 +- .../preference/VectorPreferenceCategory.kt | 2 +- .../BottomSheetGenericController.kt | 2 +- .../app/core/ui/list/GenericButtonItem.kt | 2 +- .../app/core/ui/list/GenericFooterItem.kt | 2 +- .../app/core/ui/list/GenericPillItem.kt | 2 +- .../app/core/ui/list/GenericWithValueItem.kt | 2 +- .../core/ui/views/BottomSheetActionButton.kt | 3 +- .../app/core/ui/views/KnownCallsViewHolder.kt | 9 +- .../app/core/ui/views/NotificationAreaView.kt | 2 +- .../app/core/ui/views/SendStateImageView.kt | 4 +- .../java/im/vector/app/core/utils/Dialogs.kt | 4 +- .../core/utils/ExternalApplicationsUtil.kt | 5 +- .../vector/app/core/utils/JsonViewerStyler.kt | 6 +- .../vector/app/core/utils/PermissionsTools.kt | 6 +- .../im/vector/app/features/MainActivity.kt | 4 +- .../features/call/CallControlsBottomSheet.kt | 4 +- .../app/features/call/VectorCallActivity.kt | 5 +- .../call/conference/VectorJitsiActivity.kt | 4 +- .../features/call/dialpad/DialPadFragment.kt | 4 +- .../features/consent/ConsentNotGivenHelper.kt | 4 +- .../contactsbook/ContactsBookFragment.kt | 4 +- .../createdirect/CreateDirectRoomActivity.kt | 6 +- .../restore/KeysBackupRestoreActivity.kt | 6 +- .../settings/KeysBackupManageActivity.kt | 4 +- .../settings/KeysBackupSettingsFragment.kt | 4 +- .../setup/KeysBackupSetupActivity.kt | 10 +- .../setup/KeysBackupSetupStep3Fragment.kt | 6 +- .../crypto/keysrequest/KeyRequestHandler.kt | 2 +- .../quads/SharedSecureStorageActivity.kt | 4 +- .../crypto/recover/BootstrapBottomSheet.kt | 6 +- .../crypto/recover/KeepItSafeDialog.kt | 4 +- .../SupportedVerificationMethodsProvider.kt | 8 +- .../verification/VerificationBottomSheet.kt | 4 +- .../cancel/VerificationCancelController.kt | 14 +- .../cancel/VerificationNotMeController.kt | 14 +- .../VerificationChooseMethodController.kt | 24 +- .../VerificationConclusionController.kt | 14 +- .../emoji/VerificationEmojiCodeController.kt | 14 +- .../VerificationQrScannedByOtherController.kt | 14 +- .../request/VerificationRequestController.kt | 26 +- .../features/devtools/RoomDevToolActivity.kt | 4 +- .../features/devtools/RoomDevToolFragment.kt | 3 +- .../devtools/RoomDevToolSendFormController.kt | 3 - .../devtools/RoomDevToolSendFormFragment.kt | 2 +- .../RoomDevToolStateEventListFragment.kt | 3 +- .../devtools/RoomStateListController.kt | 4 +- .../features/disclaimer/DisclaimerDialog.kt | 4 +- .../discovery/DiscoverySettingsController.kt | 8 +- .../discovery/DiscoverySettingsFragment.kt | 8 +- .../features/discovery/SettingsButtonItem.kt | 4 +- .../discovery/SettingsInformationItem.kt | 12 +- .../SettingsTextButtonSingleLineItem.kt | 6 +- .../change/SetIdentityServerFragment.kt | 8 +- .../features/form/FormAdvancedToggleItem.kt | 4 +- .../app/features/form/FormEditTextItem.kt | 7 - .../form/FormEditTextWithButtonItem.kt | 4 +- .../form/FormMultiLineEditTextItem.kt | 7 - .../app/features/form/FormSwitchItem.kt | 8 - .../grouplist/HomeSpaceSummaryItem.kt | 2 +- .../vector/app/features/home/HomeActivity.kt | 9 +- .../app/features/home/HomeDetailFragment.kt | 25 +- .../home/room/detail/AutoCompleter.kt | 5 +- .../home/room/detail/RoomDetailFragment.kt | 42 +-- .../detail/RoomMessageTouchHelperCallback.kt | 2 +- .../room/detail/StartCallActionsHandler.kt | 6 +- .../home/room/detail/search/SearchFragment.kt | 2 +- .../action/MessageActionsEpoxyController.kt | 8 +- .../edithistory/ViewEditHistoryBottomSheet.kt | 2 +- .../ViewEditHistoryEpoxyController.kt | 4 +- .../timeline/factory/EncryptedItemFactory.kt | 4 +- .../timeline/factory/MessageItemFactory.kt | 4 +- .../format/DisplayableEventFormatter.kt | 2 +- .../helper/MatrixItemColorProvider.kt | 22 +- .../timeline/item/CallTileTimelineItem.kt | 8 +- .../reactions/ViewReactionsBottomSheet.kt | 6 +- .../detail/widget/RoomWidgetsBottomSheet.kt | 2 +- .../detail/widget/RoomWidgetsController.kt | 2 +- .../home/room/list/RoomCategoryItem.kt | 4 +- .../home/room/list/RoomListFragment.kt | 4 +- .../home/room/list/RoomSummaryItem.kt | 4 +- .../home/room/list/SectionHeaderAdapter.kt | 4 +- .../home/room/list/SpaceChildInfoItem.kt | 2 +- .../RoomListQuickActionsEpoxyController.kt | 7 +- .../vector/app/features/html/SpoilerSpan.kt | 2 +- .../invite/InviteUsersToRoomActivity.kt | 4 +- .../app/features/link/LinkHandlerActivity.kt | 6 +- .../features/login/AbstractLoginFragment.kt | 8 +- .../vector/app/features/login/LoginAction.kt | 2 +- .../app/features/login/LoginActivity.kt | 10 +- .../features/login/LoginCaptchaFragment.kt | 4 +- .../vector/app/features/login/LoginConfig.kt | 2 +- .../login/LoginResetPasswordFragment.kt | 4 +- ...inResetPasswordMailConfirmationFragment.kt | 4 +- .../app/features/login/LoginWebFragment.kt | 4 +- .../features/login2/AbstractLoginFragment2.kt | 6 +- .../app/features/login2/LoginAction2.kt | 2 +- .../app/features/login2/LoginActivity2.kt | 10 +- .../features/login2/LoginCaptchaFragment2.kt | 4 +- .../login2/LoginResetPasswordFragment2.kt | 4 +- ...nResetPasswordMailConfirmationFragment2.kt | 4 +- .../app/features/login2/LoginWebFragment2.kt | 4 +- .../login2/created/AccountCreatedFragment.kt | 4 +- .../features/matrixto/MatrixToBottomSheet.kt | 4 +- .../vector/app/features/media/UCropHelper.kt | 12 +- .../features/navigation/DefaultNavigator.kt | 4 +- .../notifications/NotificationUtils.kt | 26 +- .../im/vector/app/features/pin/PinFragment.kt | 4 +- .../app/features/popup/IncomingCallAlert.kt | 2 +- .../app/features/rageshake/BugReporter.kt | 2 +- .../app/features/rageshake/RageShake.kt | 4 +- .../reactions/EmojiSearchResultFragment.kt | 3 +- .../createroom/CreateRoomController.kt | 10 +- .../createroom/CreateRoomFragment.kt | 4 +- .../createroom/RoomAliasEditItem.kt | 7 - .../picker/RoomDirectoryPickerController.kt | 9 +- .../RoomMemberProfileController.kt | 19 - .../RoomMemberProfileFragment.kt | 6 +- .../devices/DeviceListEpoxyController.kt | 12 +- .../devices/DeviceListFragment.kt | 4 +- .../devices/DeviceTrustInfoActionFragment.kt | 4 +- .../devices/DeviceTrustInfoEpoxyController.kt | 10 +- .../powerlevel/EditPowerLevelDialogs.kt | 8 +- .../roomprofile/RoomProfileController.kt | 22 +- .../roomprofile/RoomProfileFragment.kt | 6 +- .../roomprofile/alias/RoomAliasController.kt | 3 - .../roomprofile/alias/RoomAliasFragment.kt | 6 +- .../detail/RoomAliasBottomSheetController.kt | 11 +- .../banned/RoomBannedMemberListController.kt | 7 +- .../banned/RoomBannedMemberListFragment.kt | 4 +- .../members/RoomMemberListController.kt | 10 +- .../members/RoomMemberListFragment.kt | 4 +- .../permissions/RoomPermissionsController.kt | 7 +- .../settings/RoomSettingsController.kt | 27 +- .../settings/RoomSettingsFragment.kt | 4 +- .../uploads/files/RoomUploadsFilesFragment.kt | 2 +- .../BackgroundSyncModeChooserDialog.kt | 4 +- .../settings/VectorSettingsGeneralFragment.kt | 3 +- .../VectorSettingsPreferencesFragment.kt | 6 +- .../VectorSettingsSecurityPrivacyFragment.kt | 12 +- .../CrossSigningSettingsController.kt | 6 +- .../CrossSigningSettingsFragment.kt | 4 +- .../features/settings/devices/DeviceItem.kt | 2 +- .../DeviceVerificationInfoBottomSheet.kt | 4 +- ...ceVerificationInfoBottomSheetController.kt | 38 +- .../devices/VectorSettingsDevicesFragment.kt | 6 +- .../settings/devtools/AccountDataFragment.kt | 6 +- .../GossipingEventsPaperTrailFragment.kt | 3 +- .../GossipingTrailPagedEpoxyController.kt | 4 +- .../IncomingKeyRequestListFragment.kt | 3 +- .../OutgoingKeyRequestListFragment.kt | 3 +- .../VectorSettingsIgnoredUsersFragment.kt | 4 +- .../settings/push/PushGatewaysFragment.kt | 2 +- .../features/settings/push/PushRuleItem.kt | 3 +- .../settings/push/PushRulesFragment.kt | 2 +- .../threepids/ThreePidsSettingsController.kt | 8 +- .../threepids/ThreePidsSettingsFragment.kt | 4 +- ...ficationTroubleshootRecyclerViewAdapter.kt | 10 +- .../features/share/IncomingShareFragment.kt | 4 +- .../signout/soft/SoftLogoutActivity.kt | 4 +- .../signout/soft/SoftLogoutActivity2.kt | 4 +- .../signout/soft/SoftLogoutFragment.kt | 4 +- .../features/spaces/SpaceCreationActivity.kt | 4 +- .../spaces/SpaceSettingsMenuBottomSheet.kt | 10 +- .../features/spaces/SpaceSummaryController.kt | 2 +- .../create/SpaceDefaultRoomEpoxyController.kt | 7 +- .../create/SpaceDetailEpoxyController.kt | 2 - .../explore/SpaceDirectoryController.kt | 6 +- .../spaces/explore/SpaceDirectoryFragment.kt | 8 +- .../spaces/manage/SpaceAddRoomFragment.kt | 4 +- .../spaces/manage/SpaceManageRoomsFragment.kt | 2 +- .../spaces/manage/SpaceSettingsController.kt | 16 +- .../spaces/manage/SpaceSettingsFragment.kt | 4 +- .../spaces/people/SpacePeopleFragment.kt | 2 +- .../people/SpacePeopleListController.kt | 10 +- .../app/features/terms/ReviewTermsActivity.kt | 4 +- .../vector/app/features/themes/ThemeUtils.kt | 20 - .../userdirectory/UserDirectoryUserItem.kt | 4 +- .../webview/ConsentWebViewEventListener.kt | 2 +- .../app/features/widgets/WidgetFragment.kt | 4 +- .../widgets/webview/WebviewPermissionUtils.kt | 4 +- .../features/widgets/webview/WidgetWebView.kt | 2 +- .../signout/SignOutBottomSheetActionButton.kt | 4 +- .../SignOutBottomSheetDialogFragment.kt | 4 +- .../workers/signout/SignOutUiWorker.kt | 4 +- .../bottom_navigation_icon_tint_selector.xml | 4 +- .../color/button_background_tint_selector.xml | 4 +- .../color/button_bot_background_selector.xml | 5 - .../color/button_bot_text_color_selector.xml | 5 - ...button_destructive_background_selector.xml | 5 - ...button_destructive_text_color_selector.xml | 5 - .../button_positive_background_selector.xml | 5 - .../button_positive_text_color_selector.xml | 5 - ...social_google_background_selector_dark.xml | 2 +- ...ocial_google_background_selector_light.xml | 6 +- .../res/color/button_text_color_selector.xml | 5 - .../color/checked_accent_color_selector.xml | 2 +- ...iew_tint.xml => color_primary_alpha25.xml} | 5 +- .../src/main/res/color/login_button_tint.xml | 7 - .../res/color/primary_text_color_selector.xml | 5 - .../src/main/res/drawable-anydpi-v26/snow.png | Bin 1986 -> 0 bytes .../main/res/drawable-hdpi/chevron_down.png | Bin 303 -> 0 bytes .../main/res/drawable-hdpi/ic_clear_white.png | Bin 276 -> 0 bytes .../drawable-hdpi/ic_expand_less_white.png | Bin 185 -> 0 bytes .../drawable-hdpi/ic_expand_more_white.png | Bin 203 -> 0 bytes .../res/drawable-hdpi/ic_search_white.png | Bin 492 -> 0 bytes .../main/res/drawable-hdpi/ic_small_close.png | Bin 363 -> 0 bytes .../main/res/drawable-mdpi/chevron_down.png | Bin 231 -> 0 bytes .../main/res/drawable-mdpi/ic_clear_white.png | Bin 209 -> 0 bytes .../drawable-mdpi/ic_expand_less_white.png | Bin 153 -> 0 bytes .../drawable-mdpi/ic_expand_more_white.png | Bin 158 -> 0 bytes .../res/drawable-mdpi/ic_search_white.png | Bin 306 -> 0 bytes .../main/res/drawable-mdpi/ic_small_close.png | Bin 234 -> 0 bytes .../main/res/drawable-xhdpi/chevron_down.png | Bin 391 -> 0 bytes .../res/drawable-xhdpi/ic_clear_white.png | Bin 329 -> 0 bytes .../drawable-xhdpi/ic_expand_less_white.png | Bin 216 -> 0 bytes .../drawable-xhdpi/ic_expand_more_white.png | Bin 248 -> 0 bytes .../res/drawable-xhdpi/ic_search_white.png | Bin 574 -> 0 bytes .../res/drawable-xhdpi/ic_small_close.png | Bin 412 -> 0 bytes .../main/res/drawable-xxhdpi/chevron_down.png | Bin 454 -> 0 bytes .../main/res/drawable-xxhdpi/e2e_blocked.png | Bin 1560 -> 0 bytes .../res/drawable-xxhdpi/e2e_unencrypted.png | Bin 612 -> 0 bytes .../res/drawable-xxhdpi/filetype_audio.png | Bin 6985 -> 0 bytes .../main/res/drawable-xxhdpi/ic_add_black.png | Bin 114 -> 0 bytes .../res/drawable-xxhdpi/ic_clear_white.png | Bin 462 -> 0 bytes .../drawable-xxhdpi/ic_expand_less_white.png | Bin 297 -> 0 bytes .../drawable-xxhdpi/ic_expand_more_white.png | Bin 347 -> 0 bytes .../ic_material_chevron_right_black.png | Bin 172 -> 0 bytes .../res/drawable-xxhdpi/ic_material_copy.png | Bin 319 -> 0 bytes .../ic_material_create_white.png | Bin 302 -> 0 bytes .../drawable-xxhdpi/ic_material_delete.png | Bin 348 -> 0 bytes .../ic_material_delete_white.png | Bin 194 -> 0 bytes .../ic_material_expand_less_black.png | Bin 213 -> 0 bytes .../ic_material_expand_more_black.png | Bin 215 -> 0 bytes .../ic_material_send_black.png | Bin 543 -> 0 bytes .../res/drawable-xxhdpi/ic_search_white.png | Bin 899 -> 0 bytes .../res/drawable-xxhdpi/ic_small_close.png | Bin 557 -> 0 bytes .../res/drawable-xxhdpi/main_alias_icon.png | Bin 1792 -> 0 bytes .../res/drawable-xxhdpi/vector_typing.png | Bin 2722 -> 0 bytes .../res/drawable-xxxhdpi/chevron_down.png | Bin 584 -> 0 bytes .../res/drawable-xxxhdpi/ic_clear_white.png | Bin 601 -> 0 bytes .../drawable-xxxhdpi/ic_expand_less_white.png | Bin 375 -> 0 bytes .../drawable-xxxhdpi/ic_expand_more_white.png | Bin 447 -> 0 bytes .../ic_material_folder_green_vector.png | Bin 921 -> 0 bytes .../res/drawable-xxxhdpi/ic_search_white.png | Bin 1143 -> 0 bytes .../res/drawable-xxxhdpi/ic_small_close.png | Bin 661 -> 0 bytes .../main/res/drawable/background_circle.xml | 2 +- .../res/drawable/bg_active_widgets_banner.xml | 2 +- .../drawable/bg_attachment_type_selector.xml | 4 +- .../res/drawable/bg_breadcrumbs_typing.xml | 8 - .../main/res/drawable/bg_button_secondary.xml | 2 +- .../src/main/res/drawable/bg_group_item.xml | 2 +- .../src/main/res/drawable/bg_login_server.xml | 2 +- .../res/drawable/bg_login_server_checked.xml | 4 +- vector/src/main/res/drawable/bg_send.xml | 2 +- .../src/main/res/drawable/bg_space_item.xml | 2 +- .../main/res/drawable/bg_unread_highlight.xml | 2 +- .../res/drawable/bg_unread_notification.xml | 2 +- vector/src/main/res/drawable/circle.xml | 5 +- .../main/res/drawable/divider_horizontal.xml | 2 +- .../divider_horizontal_on_secondary.xml | 5 + .../main/res/drawable/file_progress_bar.xml | 4 +- .../header_panel_round_background.xml | 2 +- .../highlighted_message_background.xml | 4 +- .../ic_baseline_perm_contact_calendar_24.xml | 5 +- vector/src/main/res/drawable/ic_pause.xml | 5 +- .../src/main/res/drawable/ic_play_arrow.xml | 5 +- .../main/res/drawable/ic_radio_button_off.xml | 2 +- .../drawable/ic_settings_root_advanced.xml | 14 +- .../res/drawable/ic_settings_root_call.xml | 4 +- .../res/drawable/ic_settings_root_flair.xml | 2 +- .../res/drawable/ic_settings_root_general.xml | 2 +- .../drawable/ic_settings_root_help_about.xml | 2 +- .../ic_settings_root_ignored_users.xml | 2 +- .../res/drawable/ic_settings_root_labs.xml | 4 +- .../ic_settings_root_notification.xml | 2 +- .../drawable/ic_settings_root_preferences.xml | 2 +- .../ic_settings_root_security_privacy.xml | 2 +- vector/src/main/res/drawable/ic_trash_24.xml | 10 +- vector/src/main/res/drawable/line_divider.xml | 11 - vector/src/main/res/drawable/pill_receipt.xml | 2 +- .../main/res/drawable/pin_code_dot_empty.xml | 2 +- .../drawable/placeholder_round_background.xml | 2 +- .../main/res/drawable/placeholder_shape_8.xml | 2 +- .../drawable/reaction_rounded_rect_shape.xml | 4 +- .../reaction_rounded_rect_shape_off.xml | 2 +- vector/src/main/res/drawable/red_dot.xml | 2 +- .../res/drawable/rounded_rect_shape_16.xml | 2 +- .../res/drawable/rounded_rect_shape_8.xml | 2 +- .../res/drawable/rounded_rect_stroke_8.xml | 2 +- .../res/drawable/space_home_background.xml | 4 +- vector/src/main/res/drawable/splash.xml | 5 +- .../res/drawable/vector_label_background.xml | 4 +- .../res/drawable/vector_tabbar_background.xml | 21 -- .../vector_tabbar_selected_background.xml | 14 - .../vector_tabbar_unselected_background.xml | 8 - vector/src/main/res/layout/activity.xml | 1 - .../main/res/layout/activity_bug_report.xml | 12 +- vector/src/main/res/layout/activity_call.xml | 8 +- .../res/layout/activity_call_transfer.xml | 27 +- .../layout/activity_emoji_reaction_picker.xml | 1 - .../res/layout/activity_filtered_rooms.xml | 1 - .../res/layout/activity_incoming_share.xml | 1 - vector/src/main/res/layout/activity_login.xml | 2 +- vector/src/main/res/layout/activity_main.xml | 2 +- .../src/main/res/layout/activity_progress.xml | 2 +- .../src/main/res/layout/activity_search.xml | 1 - .../main/res/layout/activity_signed_out.xml | 4 +- .../res/layout/activity_vector_settings.xml | 4 +- .../res/layout/activity_vector_web_view.xml | 1 - .../src/main/res/layout/activity_widget.xml | 1 - .../layout/alerter_incoming_call_layout.xml | 13 +- .../res/layout/bottom_sheet_bootstrap.xml | 6 +- .../res/layout/bottom_sheet_call_controls.xml | 26 +- .../res/layout/bottom_sheet_call_dial_pad.xml | 6 +- .../bottom_sheet_call_dialer_choice.xml | 10 +- .../res/layout/bottom_sheet_generic_list.xml | 2 +- .../bottom_sheet_generic_list_with_title.xml | 4 +- .../layout/bottom_sheet_invited_to_space.xml | 8 +- .../layout/bottom_sheet_logout_and_backup.xml | 28 +- .../bottom_sheet_room_widget_permission.xml | 24 +- .../layout/bottom_sheet_save_recovery_key.xml | 6 +- .../res/layout/bottom_sheet_space_invite.xml | 16 +- .../bottom_sheet_space_invite_chooser.xml | 8 +- .../layout/bottom_sheet_space_settings.xml | 34 +- .../res/layout/bottom_sheet_verification.xml | 5 +- .../layout/bottom_sheet_with_fragments.xml | 2 +- .../src/main/res/layout/composer_layout.xml | 10 +- ...composer_layout_constraint_set_compact.xml | 10 +- ...omposer_layout_constraint_set_expanded.xml | 10 +- .../custom_action_item_layout_badge.xml | 4 +- .../layout/dialog_background_sync_mode.xml | 12 +- .../res/layout/dialog_change_password.xml | 5 +- .../dialog_confirmation_with_reason.xml | 3 +- .../res/layout/dialog_disclaimer_content.xml | 6 +- .../res/layout/dialog_edit_power_level.xml | 9 +- .../res/layout/dialog_export_e2e_keys.xml | 16 +- .../res/layout/dialog_import_e2e_keys.xml | 11 +- .../main/res/layout/dialog_photo_or_video.xml | 8 +- .../res/layout/dialog_prompt_password.xml | 3 +- .../layout/dialog_recovery_key_saved_info.xml | 6 +- .../main/res/layout/dialog_report_content.xml | 1 - .../layout/fragment_attachments_preview.xml | 9 +- .../layout/fragment_bootstrap_conclusion.xml | 17 +- ...gment_bootstrap_enter_account_password.xml | 10 +- .../fragment_bootstrap_enter_passphrase.xml | 12 +- .../fragment_bootstrap_migrate_backup.xml | 17 +- .../res/layout/fragment_bootstrap_reauth.xml | 6 +- .../layout/fragment_bootstrap_save_key.xml | 16 +- .../fragment_bootstrap_setup_recovery.xml | 16 +- .../res/layout/fragment_bootstrap_waiting.xml | 4 +- .../main/res/layout/fragment_breadcrumbs.xml | 2 +- .../res/layout/fragment_contacts_book.xml | 10 +- ...ent_create_direct_room_directory_users.xml | 6 +- .../main/res/layout/fragment_create_room.xml | 3 +- .../layout/fragment_deactivate_account.xml | 10 +- .../res/layout/fragment_generic_recycler.xml | 2 +- .../main/res/layout/fragment_home_detail.xml | 20 +- .../main/res/layout/fragment_home_drawer.xml | 31 +- .../res/layout/fragment_incoming_share.xml | 1 - .../fragment_keys_backup_restore_from_key.xml | 17 +- ...nt_keys_backup_restore_from_passphrase.xml | 17 +- .../fragment_keys_backup_restore_success.xml | 13 +- .../layout/fragment_keys_backup_settings.xml | 2 +- .../fragment_keys_backup_setup_step1.xml | 16 +- .../fragment_keys_backup_setup_step2.xml | 30 +- .../fragment_keys_backup_setup_step3.xml | 21 +- .../res/layout/fragment_locale_picker.xml | 2 +- vector/src/main/res/layout/fragment_login.xml | 12 +- .../layout/fragment_login_account_created.xml | 12 +- .../res/layout/fragment_login_captcha.xml | 2 +- ...fragment_login_generic_text_input_form.xml | 7 +- ...agment_login_generic_text_input_form_2.xml | 9 +- .../layout/fragment_login_reset_password.xml | 8 +- .../fragment_login_reset_password_2.xml | 8 +- ...login_reset_password_mail_confirmation.xml | 4 +- ...gin_reset_password_mail_confirmation_2.xml | 4 +- .../fragment_login_reset_password_success.xml | 4 +- ...ragment_login_reset_password_success_2.xml | 4 +- .../fragment_login_server_selection.xml | 12 +- .../fragment_login_server_selection_2.xml | 6 +- .../layout/fragment_login_server_url_form.xml | 10 +- .../fragment_login_server_url_form_2.xml | 6 +- .../fragment_login_signin_password_2.xml | 9 +- .../layout/fragment_login_signin_to_any_2.xml | 10 +- .../fragment_login_signin_username_2.xml | 7 +- .../fragment_login_signup_password_2.xml | 7 +- ...fragment_login_signup_signin_selection.xml | 8 +- .../fragment_login_signup_username_2.xml | 5 +- .../main/res/layout/fragment_login_splash.xml | 14 +- .../res/layout/fragment_login_splash_2.xml | 16 +- .../res/layout/fragment_login_sso_only_2.xml | 4 +- .../main/res/layout/fragment_login_terms.xml | 4 +- .../res/layout/fragment_login_terms_2.xml | 4 +- .../layout/fragment_login_wait_for_email.xml | 2 +- .../fragment_login_wait_for_email_2.xml | 2 +- .../main/res/layout/fragment_login_web.xml | 3 +- .../res/layout/fragment_matrix_profile.xml | 9 +- .../fragment_matrix_to_room_space_card.xml | 22 +- .../layout/fragment_matrix_to_user_card.xml | 7 +- .../main/res/layout/fragment_public_rooms.xml | 8 +- .../res/layout/fragment_qr_code_scanner.xml | 6 +- .../fragment_qr_code_scanner_with_button.xml | 8 +- .../res/layout/fragment_reauth_confirm.xml | 12 +- .../fragment_recyclerview_with_search.xml | 10 +- .../main/res/layout/fragment_review_terms.xml | 3 +- .../main/res/layout/fragment_room_detail.xml | 25 +- .../layout/fragment_room_directory_picker.xml | 7 +- .../main/res/layout/fragment_room_list.xml | 2 +- .../fragment_room_preview_no_preview.xml | 6 +- .../layout/fragment_room_setting_generic.xml | 6 +- .../main/res/layout/fragment_room_uploads.xml | 3 +- .../main/res/layout/fragment_room_widget.xml | 4 +- .../layout/fragment_set_identity_server.xml | 13 +- ...nt_settings_notifications_troubleshoot.xml | 14 +- .../res/layout/fragment_space_add_rooms.xml | 12 +- ...ment_space_create_choose_private_model.xml | 8 +- .../fragment_space_create_choose_type.xml | 10 +- ...agment_space_create_generic_epoxy_form.xml | 7 +- .../res/layout/fragment_space_preview.xml | 16 +- .../layout/fragment_ssss_access_from_key.xml | 20 +- .../fragment_ssss_access_from_passphrase.xml | 24 +- .../res/layout/fragment_ssss_reset_all.xml | 31 +- .../res/layout/fragment_user_code_show.xml | 23 +- .../res/layout/fragment_user_directory.xml | 6 +- .../main/res/layout/fragment_user_list.xml | 7 +- .../src/main/res/layout/grid_item_emoji.xml | 4 +- .../layout/item_attachment_big_preview.xml | 2 +- .../item_attachment_miniature_preview.xml | 6 +- .../res/layout/item_autocomplete_command.xml | 8 +- .../res/layout/item_autocomplete_emoji.xml | 8 +- .../layout/item_autocomplete_matrix_item.xml | 6 +- .../layout/item_autocomplete_more_result.xml | 4 +- .../res/layout/item_bottom_sheet_action.xml | 9 +- .../item_bottom_sheet_message_preview.xml | 8 +- .../item_bottom_sheet_message_status.xml | 2 +- .../item_bottom_sheet_quick_reaction.xml | 16 +- .../res/layout/item_bottom_sheet_radio.xml | 4 +- .../layout/item_bottom_sheet_room_preview.xml | 8 +- .../res/layout/item_bottom_sheet_title.xml | 4 +- .../src/main/res/layout/item_breadcrumbs.xml | 11 +- vector/src/main/res/layout/item_checkbox.xml | 2 +- .../main/res/layout/item_contact_action.xml | 4 +- .../main/res/layout/item_contact_detail.xml | 6 +- .../src/main/res/layout/item_contact_main.xml | 4 +- .../item_create_direct_room_letter_header.xml | 2 +- .../layout/item_create_direct_room_user.xml | 6 +- vector/src/main/res/layout/item_device.xml | 16 +- vector/src/main/res/layout/item_divider.xml | 2 +- .../res/layout/item_divider_on_surface.xml | 7 + .../main/res/layout/item_editable_avatar.xml | 4 +- .../layout/item_editable_square_avatar.xml | 7 +- .../src/main/res/layout/item_emoji_result.xml | 8 +- .../src/main/res/layout/item_emoji_verif.xml | 4 +- .../src/main/res/layout/item_error_retry.xml | 6 +- .../res/layout/item_expandable_textview.xml | 3 +- .../res/layout/item_form_advanced_toggle.xml | 6 +- .../layout/item_form_multiline_text_input.xml | 14 +- .../res/layout/item_form_submit_button.xml | 5 +- .../src/main/res/layout/item_form_switch.xml | 19 +- .../main/res/layout/item_form_text_input.xml | 14 +- .../item_form_text_input_with_button.xml | 17 +- .../main/res/layout/item_generic_button.xml | 4 +- .../res/layout/item_generic_empty_state.xml | 8 +- .../src/main/res/layout/item_generic_list.xml | 11 +- .../res/layout/item_generic_pill_footer.xml | 4 +- .../res/layout/item_generic_with_value.xml | 7 +- vector/src/main/res/layout/item_group.xml | 6 +- .../src/main/res/layout/item_help_footer.xml | 4 +- ...tem_keys_backup_settings_button_footer.xml | 9 +- .../src/main/res/layout/item_known_user.xml | 6 +- vector/src/main/res/layout/item_loading.xml | 4 +- vector/src/main/res/layout/item_locale.xml | 4 +- .../res/layout/item_login_centered_button.xml | 2 +- .../res/layout/item_login_error_retry.xml | 6 +- .../res/layout/item_login_password_form.xml | 7 +- .../main/res/layout/item_login_red_button.xml | 4 +- vector/src/main/res/layout/item_no_result.xml | 2 +- .../layout/item_notification_troubleshoot.xml | 9 +- vector/src/main/res/layout/item_policy.xml | 7 +- .../main/res/layout/item_positive_button.xml | 11 +- .../main/res/layout/item_profile_action.xml | 8 +- .../res/layout/item_profile_matrix_item.xml | 8 +- .../item_profile_matrix_item_progress.xml | 8 +- .../main/res/layout/item_profile_section.xml | 5 +- .../src/main/res/layout/item_public_room.xml | 14 +- vector/src/main/res/layout/item_room.xml | 19 +- .../res/layout/item_room_alias_text_input.xml | 14 +- .../main/res/layout/item_room_category.xml | 12 +- .../main/res/layout/item_room_directory.xml | 6 +- .../res/layout/item_room_directory_server.xml | 8 +- .../res/layout/item_room_filter_footer.xml | 10 +- .../main/res/layout/item_room_invitation.xml | 9 +- .../main/res/layout/item_room_placeholder.xml | 6 +- .../res/layout/item_room_to_add_in_space.xml | 4 +- .../item_room_to_add_in_space_placeholder.xml | 2 +- .../layout/item_room_to_manage_in_space.xml | 6 +- .../src/main/res/layout/item_room_widget.xml | 2 +- .../main/res/layout/item_search_result.xml | 4 +- .../main/res/layout/item_settings_button.xml | 2 +- .../item_settings_button_single_line.xml | 6 +- .../layout/item_settings_centered_image.xml | 2 +- .../layout/item_settings_continue_cancel.xml | 4 +- .../res/layout/item_settings_edit_text.xml | 6 +- .../res/layout/item_settings_helper_info.xml | 2 +- .../res/layout/item_settings_information.xml | 2 +- .../res/layout/item_settings_progress.xml | 2 +- .../layout/item_settings_section_title.xml | 4 +- .../res/layout/item_settings_simple_item.xml | 4 +- .../res/layout/item_settings_three_pid.xml | 8 +- .../res/layout/item_simple_reaction_info.xml | 2 +- vector/src/main/res/layout/item_space.xml | 17 +- vector/src/main/res/layout/item_space_add.xml | 9 - .../res/layout/item_space_beta_header.xml | 4 +- .../main/res/layout/item_space_roomchild.xml | 8 +- .../main/res/layout/item_space_subspace.xml | 6 +- vector/src/main/res/layout/item_space_tab.xml | 2 +- .../res/layout/item_space_top_summary.xml | 6 +- vector/src/main/res/layout/item_sub_space.xml | 22 +- .../main/res/layout/item_suggested_room.xml | 11 +- .../res/layout/item_timeline_event_base.xml | 10 +- .../item_timeline_event_call_tile_stub.xml | 16 +- .../res/layout/item_timeline_event_create.xml | 2 +- .../item_timeline_event_day_separator.xml | 6 +- .../item_timeline_event_default_stub.xml | 2 +- ...item_timeline_event_merged_header_stub.xml | 7 +- ...meline_event_merged_room_creation_stub.xml | 24 +- .../item_timeline_event_merged_utd_stub.xml | 10 +- .../item_timeline_event_notice_stub.xml | 2 +- ...tem_timeline_event_option_buttons_stub.xml | 6 +- .../layout/item_timeline_event_poll_stub.xml | 26 +- .../item_timeline_event_redacted_stub.xml | 6 +- .../item_timeline_event_status_tile_stub.xml | 4 +- .../item_timeline_event_text_message_stub.xml | 2 +- .../item_timeline_event_verification_stub.xml | 26 +- .../item_timeline_event_widget_stub.xml | 4 +- vector/src/main/res/layout/item_tos.xml | 8 +- .../src/main/res/layout/item_unknown_room.xml | 6 +- .../src/main/res/layout/item_uploads_file.xml | 10 +- vector/src/main/res/layout/item_user.xml | 6 +- .../item_user_directory_letter_header.xml | 2 +- .../main/res/layout/item_user_list_header.xml | 2 +- .../res/layout/item_verification_action.xml | 10 +- .../layout/item_verification_decimal_code.xml | 2 +- .../res/layout/item_verification_notice.xml | 2 +- .../res/layout/item_verification_wait.xml | 8 +- .../res/layout/item_verification_waiting.xml | 2 +- .../layout/merge_image_attachment_overlay.xml | 16 +- .../res/layout/merge_overlay_waiting_view.xml | 4 +- .../layout/motion_notifs_fab_menu_merge.xml | 6 +- vector/src/main/res/layout/option_buttons.xml | 4 +- .../src/main/res/layout/reaction_button.xml | 4 +- .../vector_home_badge_unread_layout.xml | 2 +- .../layout/vector_preference_push_rule.xml | 4 +- .../layout/view_active_conference_view.xml | 16 +- .../layout/view_attachment_type_selector.xml | 12 +- .../view_bottom_sheet_action_button.xml | 10 +- .../src/main/res/layout/view_button_state.xml | 8 +- .../main/res/layout/view_call_controls.xml | 18 +- .../main/res/layout/view_current_calls.xml | 13 +- .../layout/view_failed_messages_warning.xml | 7 +- .../res/layout/view_jump_to_read_marker.xml | 5 +- .../res/layout/view_keys_backup_banner.xml | 15 +- .../res/layout/view_notification_area.xml | 6 +- .../main/res/layout/view_poll_result_line.xml | 6 +- .../res/layout/view_room_widgets_banner.xml | 4 +- ...ew_sign_out_bottom_sheet_action_button.xml | 4 +- .../res/layout/view_space_type_button.xml | 13 +- vector/src/main/res/layout/view_state.xml | 8 +- .../view_stub_room_member_profile_header.xml | 2 +- .../layout/view_stub_room_profile_header.xml | 2 +- .../src/main/res/layout/view_sync_state.xml | 9 +- .../src/main/res/layout/view_url_preview.xml | 10 +- vector/src/main/res/menu/bug_report.xml | 2 +- vector/src/main/res/menu/home.xml | 2 +- .../res/menu/menu_emoji_reaction_picker.xml | 4 +- .../src/main/res/menu/menu_space_add_room.xml | 2 +- .../main/res/menu/menu_space_directory.xml | 2 +- vector/src/main/res/menu/menu_submit.xml | 2 +- vector/src/main/res/menu/menu_timeline.xml | 6 +- .../res/menu/vector_attachments_preview.xml | 4 +- .../src/main/res/menu/vector_media_viewer.xml | 2 +- .../res/menu/vector_room_member_profile.xml | 2 +- .../src/main/res/menu/vector_room_profile.xml | 2 +- .../main/res/menu/vector_room_settings.xml | 2 +- .../src/main/res/values-v23/theme_light.xml | 2 +- .../src/main/res/values-v27/theme_light.xml | 2 +- vector/src/main/res/values/attr_behavior.xml | 23 -- vector/src/main/res/values/attrs.xml | 81 ---- .../res/values/attrs_room_message_colors.xml | 14 + .../res/values/attrs_social_login_button.xml | 11 + vector/src/main/res/values/colors.xml | 353 +++++------------- .../res/values/colors_password_strength.xml | 11 + vector/src/main/res/values/palette.xml | 41 ++ vector/src/main/res/values/palette_mobile.xml | 58 +++ ...stylable_badge_floating_action_button.xml} | 0 .../values/stylable_bottom_sheet_action.xml | 14 + ...ton.xml => stylable_button_state_view.xml} | 3 - ...ml => stylable_max_height_scroll_view.xml} | 0 .../res/values/stylable_pool_result_line.xml | 11 + ...utton.xml => stylable_reaction_button.xml} | 0 ...le_sign_out_bottom_sheet_action_button.xml | 11 + .../stylable_social_login_button_view.xml | 12 + .../values/stylable_wizard_button_view.xml | 11 + vector/src/main/res/values/style_snackbar.xml | 2 +- vector/src/main/res/values/styles_buttons.xml | 78 ++++ .../src/main/res/values/styles_dial_pad.xml | 2 +- .../src/main/res/values/styles_pin_code.xml | 14 +- vector/src/main/res/values/styles_riot.xml | 179 +++------ .../main/res/values/styles_social_login.xml | 40 +- .../src/main/res/values/text_appearances.xml | 12 +- vector/src/main/res/values/theme_black.xml | 87 +---- vector/src/main/res/values/theme_common.xml | 7 +- vector/src/main/res/values/theme_dark.xml | 173 ++++----- vector/src/main/res/values/theme_light.xml | 174 ++++----- .../res/xml/motion_scene_notifs_fab_menu.xml | 12 +- .../vector/app/features/home/UserColorTest.kt | 12 +- 667 files changed, 3224 insertions(+), 3263 deletions(-) create mode 100644 docs/color_migration_guide.md create mode 100644 newsfragment/3459.feature create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt rename vector/src/debug/java/im/vector/app/features/debug/{DebugMaterialThemeDarkActivity.kt => DebugMaterialThemeDarkTestActivity.kt} (89%) create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt rename vector/src/debug/java/im/vector/app/features/debug/{DebugMaterialThemeLightActivity.kt => DebugMaterialThemeLightTestActivity.kt} (89%) create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt create mode 100644 vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt create mode 100644 vector/src/debug/res/layout/activity_debug_button_styles.xml delete mode 100644 vector/src/main/java/im/vector/app/core/animations/behavior/PercentViewBehavior.kt create mode 100644 vector/src/main/java/im/vector/app/core/epoxy/BottomSheetDividerItem.kt delete mode 100644 vector/src/main/res/color/button_bot_background_selector.xml delete mode 100644 vector/src/main/res/color/button_bot_text_color_selector.xml delete mode 100644 vector/src/main/res/color/button_destructive_background_selector.xml delete mode 100644 vector/src/main/res/color/button_destructive_text_color_selector.xml delete mode 100644 vector/src/main/res/color/button_positive_background_selector.xml delete mode 100644 vector/src/main/res/color/button_positive_text_color_selector.xml delete mode 100644 vector/src/main/res/color/button_text_color_selector.xml rename vector/src/main/res/color/{home_bottom_nav_view_tint.xml => color_primary_alpha25.xml} (51%) delete mode 100644 vector/src/main/res/color/login_button_tint.xml delete mode 100644 vector/src/main/res/color/primary_text_color_selector.xml delete mode 100644 vector/src/main/res/drawable-anydpi-v26/snow.png delete mode 100755 vector/src/main/res/drawable-hdpi/chevron_down.png delete mode 100644 vector/src/main/res/drawable-hdpi/ic_clear_white.png delete mode 100644 vector/src/main/res/drawable-hdpi/ic_expand_less_white.png delete mode 100644 vector/src/main/res/drawable-hdpi/ic_expand_more_white.png delete mode 100644 vector/src/main/res/drawable-hdpi/ic_search_white.png delete mode 100644 vector/src/main/res/drawable-hdpi/ic_small_close.png delete mode 100755 vector/src/main/res/drawable-mdpi/chevron_down.png delete mode 100644 vector/src/main/res/drawable-mdpi/ic_clear_white.png delete mode 100644 vector/src/main/res/drawable-mdpi/ic_expand_less_white.png delete mode 100644 vector/src/main/res/drawable-mdpi/ic_expand_more_white.png delete mode 100644 vector/src/main/res/drawable-mdpi/ic_search_white.png delete mode 100644 vector/src/main/res/drawable-mdpi/ic_small_close.png delete mode 100755 vector/src/main/res/drawable-xhdpi/chevron_down.png delete mode 100644 vector/src/main/res/drawable-xhdpi/ic_clear_white.png delete mode 100644 vector/src/main/res/drawable-xhdpi/ic_expand_less_white.png delete mode 100644 vector/src/main/res/drawable-xhdpi/ic_expand_more_white.png delete mode 100644 vector/src/main/res/drawable-xhdpi/ic_search_white.png delete mode 100644 vector/src/main/res/drawable-xhdpi/ic_small_close.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/chevron_down.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/e2e_blocked.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/e2e_unencrypted.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/filetype_audio.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_add_black.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/ic_clear_white.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/ic_expand_less_white.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/ic_expand_more_white.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_chevron_right_black.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_copy.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_create_white.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_delete.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_delete_white.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_expand_less_black.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_expand_more_black.png delete mode 100755 vector/src/main/res/drawable-xxhdpi/ic_material_send_black.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/ic_search_white.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/ic_small_close.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/main_alias_icon.png delete mode 100644 vector/src/main/res/drawable-xxhdpi/vector_typing.png delete mode 100755 vector/src/main/res/drawable-xxxhdpi/chevron_down.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_clear_white.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_expand_less_white.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_expand_more_white.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_material_folder_green_vector.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_search_white.png delete mode 100644 vector/src/main/res/drawable-xxxhdpi/ic_small_close.png delete mode 100644 vector/src/main/res/drawable/bg_breadcrumbs_typing.xml create mode 100644 vector/src/main/res/drawable/divider_horizontal_on_secondary.xml delete mode 100644 vector/src/main/res/drawable/line_divider.xml delete mode 100644 vector/src/main/res/drawable/vector_tabbar_background.xml delete mode 100644 vector/src/main/res/drawable/vector_tabbar_selected_background.xml delete mode 100644 vector/src/main/res/drawable/vector_tabbar_unselected_background.xml create mode 100644 vector/src/main/res/layout/item_divider_on_surface.xml delete mode 100644 vector/src/main/res/values/attr_behavior.xml delete mode 100644 vector/src/main/res/values/attrs.xml create mode 100644 vector/src/main/res/values/attrs_room_message_colors.xml create mode 100644 vector/src/main/res/values/attrs_social_login_button.xml create mode 100644 vector/src/main/res/values/colors_password_strength.xml create mode 100644 vector/src/main/res/values/palette.xml create mode 100644 vector/src/main/res/values/palette_mobile.xml rename vector/src/main/res/values/{attrs_badge_fab.xml => stylable_badge_floating_action_button.xml} (100%) create mode 100644 vector/src/main/res/values/stylable_bottom_sheet_action.xml rename vector/src/main/res/values/{attrs_state_button.xml => stylable_button_state_view.xml} (99%) rename vector/src/main/res/values/{attrs_max_height_scroll_view.xml => stylable_max_height_scroll_view.xml} (100%) create mode 100644 vector/src/main/res/values/stylable_pool_result_line.xml rename vector/src/main/res/values/{attrs_reaction_button.xml => stylable_reaction_button.xml} (100%) create mode 100644 vector/src/main/res/values/stylable_sign_out_bottom_sheet_action_button.xml create mode 100644 vector/src/main/res/values/stylable_social_login_button_view.xml create mode 100644 vector/src/main/res/values/stylable_wizard_button_view.xml create mode 100644 vector/src/main/res/values/styles_buttons.xml diff --git a/.idea/dictionaries/bmarty.xml b/.idea/dictionaries/bmarty.xml index 4585842153..8299f1c4de 100644 --- a/.idea/dictionaries/bmarty.xml +++ b/.idea/dictionaries/bmarty.xml @@ -37,6 +37,7 @@ threepid unpublish unwedging + vctr \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b61777d3f..7e1758077b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ To install the template (to be done only once): To create a new screen: - First create a new package in your code. -- Then right click on the package, and select `New/New Vector/RiotX Feature`. +- Then right click on the package, and select `New/New Vector/Element Feature`. - Follow the Wizard, especially replace `Main` by something more relevant to your feature. - Click on `Finish`. - Remaining steps are described as TODO in the generated files, or will be pointed out by the compiler, or at runtime :) diff --git a/docs/color_migration_guide.md b/docs/color_migration_guide.md new file mode 100644 index 0000000000..31a531d124 --- /dev/null +++ b/docs/color_migration_guide.md @@ -0,0 +1,85 @@ +# Color migration + +### Changes + +- use colors defined in https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 +- remove unused resources and code (ex: PercentView) +- split some resource files into smaller file +- rework the theme files +- ensure material theme is used everywhere in the theme and in the layout +- add default style for some views in the theme (ex: Toolbar, etc.) +- add some debug screen in the debug menu, to test the themes and the button style +- rework the button style to use `materialThemeOverlay` attribute +- custom tint icon for menu management has been removed +- comment with `riotx` has been updated + +### Main change for developers + +- Read migration guide: https://github.com/vector-im/element-android/pull/3459/files#diff-f0e52729d5e4f6eccbcf72246807aa34ed19c4ef5625ca669df998cd1022874b +- Use MaterialAlertDialogBuilder instead of AlertDialog.Builder +- some Epoxy Item included a divider. This has been removed. Use a `dividerItem` or `bottomSheetDividerItem` Epoxy items to add a divider +- RecyclerView.configureWith now take a divider drawable instead of a divider color + +### Remaining work + +- Cleanup some vector drawables and ensure a tint is always used instead of hard coded color. + +### Migration guide + +Some colors and color attribute has been removed, here is the list and what has to be used now. + +It can help Element Android forks maintainers to migrate their code. + +- riotx_text_primary -> ?vctr_content_primary +- riotx_text_secondary -> ?vctr_content_secondary +- riotx_text_tertiary -> ?vctr_content_tertiary + +- ?riotx_background -> ?android:colorBackground +- riotx_background_light -> element_background_light +- riotx_background_dark -> element_background_dark +- riotx_background_black -> element_background_black + +- riotx_accent -> ?colorPrimary +- riotx_positive_accent -> ?colorPrimary +- riotx_accent_alpha25 -> color_primary_alpha25 +- riotx_notice -> ?colorError +- riotx_destructive_accent -> ?colorError +- vector_error_color -> ?colorError +- vector_warning_color -> ?colorError + +- riotx_bottom_sheet_background -> ?colorSurface +- riotx_alerter_background -> ?colorSurface + +- riotx_username_1 -> element_name_01 +- riotx_username_2 -> element_name_02 +- riotx_username_3 -> element_name_03 +- riotx_username_4 -> element_name_04 +- riotx_username_5 -> element_name_05 +- riotx_username_6 -> element_name_06 +- riotx_username_7 -> element_name_07 +- riotx_username_8 -> element_name_08 + +- riotx_avatar_fill_1 -> element_room_01 +- riotx_avatar_fill_2 -> element_room_02 +- riotx_avatar_fill_3 -> element_room_03 + +- white -> @android:color/white +- black -> @android:color/black or emoji_color + +- riotx_list_header_background_color -> ?vctr_header_background +- riotx_header_panel_background -> ?vctr_header_background +- riotx_list_bottom_sheet_divider_color -> ?vctr_list_separator_on_surface +- riotx_list_divider_color -> ?vctr_list_separator +- list_divider_color -> ?vctr_list_separator +- riotx_header_panel_border_mobile -> ?vctr_list_separator +- riotx_bottom_nav_background_border_color -> ?vctr_list_separator +- riotx_header_panel_text_secondary -> ?vctr_content_primary + +- link_color_light -> element_link_light +- link_color_dark -> element_link_dark + +- riotx_toolbar_primary_text_color -> vctr_content_primary +- riotx_toolbar_secondary_text_color -> vctr_content_primary +- riot_primary_text_color -> vctr_content_primary + +- riotx_android_secondary -> vctr_content_secondary diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt index 8f8967e8fb..ae546b6cec 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt @@ -35,7 +35,7 @@ interface IdentityService { /** * Check if the identity server is valid * See https://matrix.org/docs/spec/identity_service/latest#status-check - * RiotX SDK only supports identity server API v2 + * Matrix Android SDK2 only supports identity server API v2 */ suspend fun isValidIdentityServer(url: String) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index 7f5cfe8df1..cbd1ee00a9 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -388,7 +388,7 @@ internal class DefaultCryptoService @Inject constructor( cryptoStore.close() } - // Aways enabled on RiotX + // Always enabled on Matrix Android SDK2 override fun isCryptoEnabled() = true /** diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt index a29ac457fb..70d2022299 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt @@ -155,7 +155,7 @@ internal class MXMegolmDecryption(private val userId: String, withHeldInfo.code?.value ?: "", withHeldInfo.reason) } else { - // This is un-used in riotX SDK, not sure if needed + // This is un-used in Matrix Android SDK2, not sure if needed // addEventToPendingList(event, timeline) if (requestKeysOnFail) { requestKeysForEvent(event, false) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt index e0e2f96fa9..4586cfea1e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt @@ -153,7 +153,7 @@ internal class DefaultLegacySessionImporter @Inject constructor( } private fun importCryptoDb(legacyConfig: LegacyHomeServerConnectionConfig) { - // Here we migrate the DB, we copy the crypto DB to the location specific to RiotX, and we encrypt it. + // Here we migrate the DB, we copy the crypto DB to the location specific to Matrix SDK2, and we encrypt it. val userMd5 = legacyConfig.credentials.userId.md5() val sessionId = legacyConfig.credentials.let { (if (it.deviceId.isNullOrBlank()) it.userId else "${it.userId}|${it.deviceId}").md5() } @@ -177,12 +177,12 @@ internal class DefaultLegacySessionImporter @Inject constructor( Timber.d("Migration: copy DB to encrypted DB") Realm.getInstance(realmConfiguration).use { - // Move the DB to the new location, handled by RiotX + // Move the DB to the new location, handled by Matrix SDK2 it.writeEncryptedCopyTo(File(newLocation, realmConfiguration.realmFileName), realmKeysUtils.getRealmEncryptionKey(keyAlias)) } } - // Delete all the files created by Riot Android which will not be used anymore by RiotX + // Delete all the files created by Riot Android which will not be used anymore by Element private fun clearFileSystem(legacyConfig: LegacyHomeServerConnectionConfig) { val cryptoFolder = legacyConfig.credentials.userId.md5() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt index 973c120f59..1a88404128 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt @@ -36,7 +36,7 @@ internal class UserAgentHolder @Inject constructor(private val context: Context, /** * Create an user agent with the application version. - * Ex: RiotX/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0) + * Ex: Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0) * * @param flavorDescription the flavor description */ diff --git a/newsfragment/3459.feature b/newsfragment/3459.feature new file mode 100644 index 0000000000..eedec1dfda --- /dev/null +++ b/newsfragment/3459.feature @@ -0,0 +1,2 @@ +Migrate to new colors and cleanup the style and theme +Ref: https://material.io/blog/migrate-android-material-components \ No newline at end of file diff --git a/tools/check/forbidden_strings_in_code.txt b/tools/check/forbidden_strings_in_code.txt index 9770ed0d4d..e0645e00b3 100644 --- a/tools/check/forbidden_strings_in_code.txt +++ b/tools/check/forbidden_strings_in_code.txt @@ -136,8 +136,9 @@ android\.R\.id\.home===2 ### Kotlin conversion tools introduce this, but is can be replace by trim() trim \{ it \<\= \' \' \} -### Use AlertDialog form v7 compat lib +### Use MaterialAlertDialogBuilder android\.app\.AlertDialog +androidx\.appcompat\.app\.AlertDialog===4 ### Put the operator at the beginning of next line &&$ diff --git a/tools/check/forbidden_strings_in_resources.txt b/tools/check/forbidden_strings_in_resources.txt index cefeeb6351..92eec6cdfd 100644 --- a/tools/check/forbidden_strings_in_resources.txt +++ b/tools/check/forbidden_strings_in_resources.txt @@ -84,3 +84,22 @@ layout_constraintLeft_ ### Use androidx.recyclerview.widget.RecyclerView because EpoxyRecyclerViews add behavior we do not want to + + + + + diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt new file mode 100644 index 0000000000..0ac9a894ae --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import im.vector.app.databinding.ActivityTestMaterialThemeBinding + +class DebugBottomSheet : BottomSheetDialogFragment() { + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + // Reuse tha Activity layout + val binding = ActivityTestMaterialThemeBinding.inflate(inflater, container, false) + return binding.root + } +} diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt index 8df1feab1e..de6b981c02 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt @@ -18,9 +18,8 @@ package im.vector.app.features.debug import android.os.Bundle import android.view.Menu -import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity -import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import im.vector.app.R import im.vector.app.core.utils.toast @@ -45,7 +44,8 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } views.debugShowDialog.setOnClickListener { - AlertDialog.Builder(this) + MaterialAlertDialogBuilder(this) + .setTitle("Dialog title") .setMessage("Dialog content") .setIcon(R.drawable.ic_settings_x) .setPositiveButton("Positive", null) @@ -55,7 +55,7 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } views.debugShowBottomSheet.setOnClickListener { - BottomSheetDialogFragment().show(supportFragmentManager, "TAG") + DebugBottomSheet().show(supportFragmentManager, "TAG") } } diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt new file mode 100644 index 0000000000..7e014577de --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +class DebugMaterialThemeDarkDefaultActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt similarity index 89% rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt rename to vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt index e6e1bf04ee..4a1ed04f6a 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt @@ -16,4 +16,4 @@ package im.vector.app.features.debug -class DebugMaterialThemeDarkActivity : DebugMaterialThemeActivity() +class DebugMaterialThemeDarkTestActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt new file mode 100644 index 0000000000..6ac27aed45 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +class DebugMaterialThemeDarkVectorActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt new file mode 100644 index 0000000000..f6327e363b --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +class DebugMaterialThemeLightDefaultActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt similarity index 89% rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt rename to vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt index d1d3061cad..ae6c1dd68c 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt @@ -16,4 +16,4 @@ package im.vector.app.features.debug -class DebugMaterialThemeLightActivity : DebugMaterialThemeActivity() +class DebugMaterialThemeLightTestActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt new file mode 100644 index 0000000000..b4fb3c1cc8 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +class DebugMaterialThemeLightVectorActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt index 8699b238ec..65a24c9aeb 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt @@ -71,10 +71,29 @@ class DebugMenuActivity : VectorBaseActivity() { private fun setupViews() { views.debugTestTextViewLink.setOnClickListener { testTextViewLink() } + views.debugOpenButtonStyles.setOnClickListener { + startActivity(Intent(this, DebugVectorButtonStylesActivity::class.java)) + } views.debugShowSasEmoji.setOnClickListener { showSasEmoji() } views.debugTestNotification.setOnClickListener { testNotification() } - views.debugTestMaterialThemeLight.setOnClickListener { testMaterialThemeLight() } - views.debugTestMaterialThemeDark.setOnClickListener { testMaterialThemeDark() } + views.debugTestMaterialThemeLightDefault.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightDefaultActivity::class.java)) + } + views.debugTestMaterialThemeLightTest.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightTestActivity::class.java)) + } + views.debugTestMaterialThemeLightVector.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightVectorActivity::class.java)) + } + views.debugTestMaterialThemeDarkDefault.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkDefaultActivity::class.java)) + } + views.debugTestMaterialThemeDarkTest.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkTestActivity::class.java)) + } + views.debugTestMaterialThemeDarkVector.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkVectorActivity::class.java)) + } views.debugTestCrash.setOnClickListener { testCrash() } views.debugScanQrCode.setOnClickListener { scanQRCode() } } @@ -174,14 +193,6 @@ class DebugMenuActivity : VectorBaseActivity() { ) } - private fun testMaterialThemeLight() { - startActivity(Intent(this, DebugMaterialThemeLightActivity::class.java)) - } - - private fun testMaterialThemeDark() { - startActivity(Intent(this, DebugMaterialThemeDarkActivity::class.java)) - } - private fun testCrash() { throw RuntimeException("Application crashed from user demand") } diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt new file mode 100644 index 0000000000..783a2a3eb5 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.debug + +import im.vector.app.core.platform.VectorBaseActivity +import im.vector.app.databinding.ActivityDebugButtonStylesBinding + +class DebugVectorButtonStylesActivity : VectorBaseActivity() { + override fun getBinding() = ActivityDebugButtonStylesBinding.inflate(layoutInflater) +} diff --git a/vector/src/debug/res/layout/activity_debug_button_styles.xml b/vector/src/debug/res/layout/activity_debug_button_styles.xml new file mode 100644 index 0000000000..3973f7cbb6 --- /dev/null +++ b/vector/src/debug/res/layout/activity_debug_button_styles.xml @@ -0,0 +1,131 @@ + + + + + +