diff --git a/vector/sampledata/matrix.json b/vector/sampledata/matrix.json index b9c55b91ba..5328ec81b7 100644 --- a/vector/sampledata/matrix.json +++ b/vector/sampledata/matrix.json @@ -6,7 +6,7 @@ "message": "William Shakespeare (bapt. 26 April 1564 – 23 April 1616) was an English poet, playwright and actor, widely regarded as the greatest writer in the English language and the world's greatest dramatist. He is often called England's national poet and the \"Bard of Avon\". His extant works, including collaborations, consist of approximately 39 plays, 154 sonnets, two long narrative poems, and a few other verses, some of uncertain authorship. His plays have been translated into every major living language and are performed more often than those of any other playwright.\n\nShakespeare was born and raised in Stratford-upon-Avon, Warwickshire. At the age of 18, he married Anne Hathaway, with whom he had three children: Susanna and twins Hamnet and Judith. Sometime between 1585 and 1592, he began a successful career in London as an actor, writer, and part-owner of a playing company called the Lord Chamberlain's Men, later known as the King's Men. At age 49 (around 1613), he appears to have retired to Stratford, where he died three years later. Few records of Shakespeare's private life survive; this has stimulated considerable speculation about such matters as his physical appearance, his sexuality, his religious beliefs, and whether the works attributed to him were written by others. Such theories are often criticised for failing to adequately note that few records survive of most commoners of the period.\n\nShakespeare produced most of his known works between 1589 and 1613. His early plays were primarily comedies and histories and are regarded as some of the best work produced in these genres. Until about 1608, he wrote mainly tragedies, among them Hamlet, Othello, King Lear, and Macbeth, all considered to be among the finest works in the English language. In the last phase of his life, he wrote tragicomedies (also known as romances) and collaborated with other playwrights.\n\nMany of Shakespeare's plays were published in editions of varying quality and accuracy in his lifetime. However, in 1623, two fellow actors and friends of Shakespeare's, John Heminges and Henry Condell, published a more definitive text known as the First Folio, a posthumous collected edition of Shakespeare's dramatic works that included all but two of his plays. The volume was prefaced with a poem by Ben Jonson, in which Jonson presciently hails Shakespeare in a now-famous quote as \"not of an age, but for all time\".\n\nThroughout the 20th and 21st centuries, Shakespeare's works have been continually adapted and rediscovered by new movements in scholarship and performance. His plays remain popular and are studied, performed, and reinterpreted through various cultural and political contexts around the world.", "roomName": "Matrix HQ", "roomAlias": "#matrix:matrix.org", - "roomTopic": "Welcome to Matrix HQ! Here is the rest of the room topic…" + "roomTopic": "Welcome to Matrix HQ! Here is the rest of the room topic, with a https://www.example.org url and a phone number: 0102030405 which should not be clickable." }, { "displayName": "benoit", diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/DividerItem.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/DividerItem.kt index ab849a6909..379eb33a9c 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/DividerItem.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/DividerItem.kt @@ -15,11 +15,24 @@ */ package im.vector.riotx.core.epoxy +import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.riotx.R +/** + * Default background color is for the bottom sheets (R.attr.vctr_list_bottom_sheet_divider_color). + * To use in fragment, set color using R.attr.vctr_list_divider_color + */ @EpoxyModelClass(layout = R.layout.item_divider) abstract class DividerItem : VectorEpoxyModel() { + @EpoxyAttribute var color: Int = -1 + + override fun bind(holder: Holder) { + if (color != -1) { + holder.view.setBackgroundColor(color) + } + } + class Holder : VectorEpoxyHolder() } diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/Listener.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/Listener.kt new file mode 100644 index 0000000000..c85f186abb --- /dev/null +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/Listener.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2020 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.riotx.core.epoxy + +import android.view.View + +/** + * Generally we do not care about the View parameter in [View.OnClickListener.onClick()], so create facility to remove it. + */ +typealias ClickListener = () -> Unit + +fun View.onClick(listener: ClickListener?) { + setOnClickListener { listener?.invoke() } +} diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt index e5ffd5f350..4c86fdc53c 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetMessagePreviewItem.kt @@ -45,9 +45,12 @@ abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel Unit)? = null override fun bind(holder: Holder) { avatarRenderer.render(matrixItem, holder.avatar) + holder.avatar.setOnClickListener { userClicked?.invoke() } holder.sender.setTextOrHide(matrixItem.displayName) holder.body.movementMethod = movementMethod holder.body.text = body diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt index 44c8a4ed6c..b9c0fbdc35 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/bottomsheet/BottomSheetRoomPreviewItem.kt @@ -23,8 +23,10 @@ import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.matrix.android.api.util.MatrixItem import im.vector.riotx.R +import im.vector.riotx.core.epoxy.ClickListener import im.vector.riotx.core.epoxy.VectorEpoxyHolder import im.vector.riotx.core.epoxy.VectorEpoxyModel +import im.vector.riotx.core.epoxy.onClick import im.vector.riotx.core.extensions.setTextOrHide import im.vector.riotx.features.home.AvatarRenderer @@ -38,12 +40,13 @@ abstract class BottomSheetRoomPreviewItem : VectorEpoxyModel> Iterable.lastMinBy(selector: (T) -> R): T? { +inline fun > Iterable.lastMinBy(selector: (T) -> R): T? { val iterator = iterator() if (!iterator.hasNext()) return null var minElem = iterator.next() @@ -34,3 +34,17 @@ public inline fun > Iterable.lastMinBy(selector: (T) -> } return minElem } + +/** + * Call each for each item, and between between each items + */ +inline fun Collection.join(each: (T) -> Unit, between: (T) -> Unit) { + val lastIndex = size - 1 + forEachIndexed { idx, t -> + each(t) + + if (idx != lastIndex) { + between(t) + } + } +} diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index f4ec90f8a0..27983aa487 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -860,7 +860,7 @@ class RoomDetailFragment @Inject constructor( } override fun navToMemberProfile(userId: String): Boolean { - navigator.openRoomMemberProfile(userId, roomDetailArgs.roomId, vectorBaseActivity) + openRoomMemberProfile(userId) return true } }) @@ -997,7 +997,11 @@ class RoomDetailFragment @Inject constructor( } override fun onAvatarClicked(informationData: MessageInformationData) { - navigator.openRoomMemberProfile(userId = informationData.senderId, roomId = roomDetailArgs.roomId, context = requireActivity()) + openRoomMemberProfile(informationData.senderId) + } + + private fun openRoomMemberProfile(userId: String) { + navigator.openRoomMemberProfile(userId = userId, roomId = roomDetailArgs.roomId, context = requireActivity()) } override fun onMemberNameClicked(informationData: MessageInformationData) { @@ -1048,6 +1052,9 @@ class RoomDetailFragment @Inject constructor( private fun handleActions(action: EventSharedAction) { when (action) { + is EventSharedAction.OpenUserProfile -> { + openRoomMemberProfile(action.senderId) + } is EventSharedAction.AddReaction -> { startActivityForResult(EmojiReactionPickerActivity.intent(requireContext(), action.eventId), REACTION_SELECT_REQUEST_CODE) } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt index 8077786d06..91922611dd 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt @@ -26,6 +26,9 @@ sealed class EventSharedAction(@StringRes val titleRes: Int, @DrawableRes val ic object Separator : EventSharedAction(0, 0) + data class OpenUserProfile(val senderId: String) : + EventSharedAction(0, 0) + data class AddReaction(val eventId: String) : EventSharedAction(R.string.message_add_reaction, R.drawable.ic_add_reaction) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt index ac77e5de3d..f90dbed95e 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt @@ -20,7 +20,11 @@ import com.airbnb.epoxy.TypedEpoxyController import com.airbnb.mvrx.Success import im.vector.riotx.EmojiCompatFontProvider import im.vector.riotx.R -import im.vector.riotx.core.epoxy.bottomsheet.* +import im.vector.riotx.core.epoxy.bottomsheet.BottomSheetQuickReactionsItem +import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetActionItem +import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetMessagePreviewItem +import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetQuickReactionsItem +import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetSendStateItem import im.vector.riotx.core.epoxy.dividerItem import im.vector.riotx.core.resources.StringProvider import im.vector.riotx.features.home.AvatarRenderer @@ -32,9 +36,11 @@ import javax.inject.Inject /** * Epoxy controller for message action list */ -class MessageActionsEpoxyController @Inject constructor(private val stringProvider: StringProvider, - private val avatarRenderer: AvatarRenderer, - private val fontProvider: EmojiCompatFontProvider) : TypedEpoxyController() { +class MessageActionsEpoxyController @Inject constructor( + private val stringProvider: StringProvider, + private val avatarRenderer: AvatarRenderer, + private val fontProvider: EmojiCompatFontProvider +) : TypedEpoxyController() { var listener: MessageActionsEpoxyControllerListener? = null @@ -47,6 +53,7 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid avatarRenderer(avatarRenderer) matrixItem(state.informationData.matrixItem) movementMethod(createLinkMovementMethod(listener)) + userClicked { listener?.didSelectMenuAction(EventSharedAction.OpenUserProfile(state.informationData.senderId)) } body(body.linkify(listener)) time(state.time()) } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt index 0948490d12..132da9341b 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt @@ -43,7 +43,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar id("room_preview") avatarRenderer(avatarRenderer) matrixItem(roomSummary.toMatrixItem()) - settingsClickListener(View.OnClickListener { listener?.didSelectMenuAction(RoomListQuickActionsSharedAction.Settings(roomSummary.roomId)) }) + settingsClickListener { listener?.didSelectMenuAction(RoomListQuickActionsSharedAction.Settings(roomSummary.roomId)) } } // Notifications diff --git a/vector/src/main/java/im/vector/riotx/features/roommemberprofile/RoomMemberProfileController.kt b/vector/src/main/java/im/vector/riotx/features/roommemberprofile/RoomMemberProfileController.kt index a77b34b7ab..23c713068a 100644 --- a/vector/src/main/java/im/vector/riotx/features/roommemberprofile/RoomMemberProfileController.kt +++ b/vector/src/main/java/im/vector/riotx/features/roommemberprofile/RoomMemberProfileController.kt @@ -21,11 +21,16 @@ import com.airbnb.epoxy.TypedEpoxyController import im.vector.riotx.R import im.vector.riotx.core.epoxy.profiles.buildProfileAction import im.vector.riotx.core.epoxy.profiles.buildProfileSection +import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.resources.StringProvider import javax.inject.Inject -class RoomMemberProfileController @Inject constructor(private val stringProvider: StringProvider) - : TypedEpoxyController() { +class RoomMemberProfileController @Inject constructor( + private val stringProvider: StringProvider, + colorProvider: ColorProvider +) : TypedEpoxyController() { + + private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color) var callback: Callback? = null @@ -54,6 +59,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider buildProfileAction( id = "ignore", title = ignoreActionTitle, + dividerColor = dividerColor, destructive = true, editable = false, divider = false, @@ -72,7 +78,9 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider buildProfileAction( id = "learn_more", title = stringProvider.getString(R.string.room_profile_section_security_learn_more), + dividerColor = dividerColor, editable = false, + divider = false, subtitle = stringProvider.getString(learnMoreSubtitle), action = { callback?.onLearnMoreClicked() } ) @@ -84,6 +92,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider id = "read_receipt", editable = false, title = stringProvider.getString(R.string.room_member_jump_to_read_receipt), + dividerColor = dividerColor, action = { callback?.onJumpToReadReceiptClicked() } ) @@ -92,6 +101,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider buildProfileAction( id = "mention", title = stringProvider.getString(R.string.room_participants_action_mention), + dividerColor = dividerColor, editable = false, divider = ignoreActionTitle != null, action = { callback?.onMentionClicked() } @@ -100,6 +110,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider buildProfileAction( id = "ignore", title = ignoreActionTitle, + dividerColor = dividerColor, destructive = true, editable = false, divider = false, diff --git a/vector/src/main/java/im/vector/riotx/features/roomprofile/RoomProfileController.kt b/vector/src/main/java/im/vector/riotx/features/roomprofile/RoomProfileController.kt index 37a36fbcf1..44a50ee5e6 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomprofile/RoomProfileController.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomprofile/RoomProfileController.kt @@ -21,11 +21,16 @@ import com.airbnb.epoxy.TypedEpoxyController import im.vector.riotx.R import im.vector.riotx.core.epoxy.profiles.buildProfileAction import im.vector.riotx.core.epoxy.profiles.buildProfileSection +import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.resources.StringProvider import javax.inject.Inject -class RoomProfileController @Inject constructor(private val stringProvider: StringProvider) - : TypedEpoxyController() { +class RoomProfileController @Inject constructor( + private val stringProvider: StringProvider, + colorProvider: ColorProvider +) : TypedEpoxyController() { + + private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color) var callback: Callback? = null @@ -53,6 +58,7 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri buildProfileAction( id = "learn_more", title = stringProvider.getString(R.string.room_profile_section_security_learn_more), + dividerColor = dividerColor, subtitle = stringProvider.getString(learnMoreSubtitle), action = { callback?.onLearnMoreClicked() } ) @@ -62,12 +68,14 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri buildProfileAction( id = "settings", title = stringProvider.getString(R.string.room_profile_section_more_settings), + dividerColor = dividerColor, icon = R.drawable.ic_room_profile_settings, action = { callback?.onSettingsClicked() } ) buildProfileAction( id = "notifications", title = stringProvider.getString(R.string.room_profile_section_more_notifications), + dividerColor = dividerColor, icon = R.drawable.ic_room_profile_notification, action = { callback?.onNotificationsClicked() } ) @@ -75,18 +83,21 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri buildProfileAction( id = "member_list", title = stringProvider.getQuantityString(R.plurals.room_profile_section_more_member_list, numberOfMembers, numberOfMembers), + dividerColor = dividerColor, icon = R.drawable.ic_room_profile_member_list, action = { callback?.onMemberListClicked() } ) buildProfileAction( id = "uploads", title = stringProvider.getString(R.string.room_profile_section_more_uploads), + dividerColor = dividerColor, icon = R.drawable.ic_room_profile_uploads, action = { callback?.onUploadsClicked() } ) buildProfileAction( id = "leave", title = stringProvider.getString(R.string.room_profile_section_more_leave), + dividerColor = dividerColor, divider = false, destructive = true, editable = false, diff --git a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListController.kt b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListController.kt index 6b7ef74806..0d838e9c72 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListController.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListController.kt @@ -19,20 +19,28 @@ package im.vector.riotx.features.roomprofile.members import com.airbnb.epoxy.TypedEpoxyController import im.vector.matrix.android.api.session.room.model.RoomMemberSummary import im.vector.matrix.android.api.util.toMatrixItem +import im.vector.riotx.R import im.vector.riotx.core.epoxy.dividerItem import im.vector.riotx.core.epoxy.profiles.buildProfileSection import im.vector.riotx.core.epoxy.profiles.profileMatrixItem +import im.vector.riotx.core.extensions.join +import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.resources.StringProvider import im.vector.riotx.features.home.AvatarRenderer import javax.inject.Inject -class RoomMemberListController @Inject constructor(private val avatarRenderer: AvatarRenderer, - private val stringProvider: StringProvider) : TypedEpoxyController() { +class RoomMemberListController @Inject constructor( + private val avatarRenderer: AvatarRenderer, + private val stringProvider: StringProvider, + colorProvider: ColorProvider +) : TypedEpoxyController() { interface Callback { fun onRoomMemberClicked(roomMember: RoomMemberSummary) } + private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color) + var callback: Callback? = null init { @@ -48,20 +56,24 @@ class RoomMemberListController @Inject constructor(private val avatarRenderer: A buildProfileSection( stringProvider.getString(powerLevelCategory.titleRes) ) - roomMemberList.forEach { roomMember -> - profileMatrixItem { - id(roomMember.userId) - matrixItem(roomMember.toMatrixItem()) - avatarRenderer(avatarRenderer) - clickListener { _ -> - callback?.onRoomMemberClicked(roomMember) + roomMemberList.join( + each = { roomMember -> + profileMatrixItem { + id(roomMember.userId) + matrixItem(roomMember.toMatrixItem()) + avatarRenderer(avatarRenderer) + clickListener { _ -> + callback?.onRoomMemberClicked(roomMember) + } + } + }, + between = { roomMemberBefore -> + dividerItem { + id("divider_${roomMemberBefore.userId}") + color(dividerColor) + } } - } - - dividerItem { - id("divider_${roomMember.userId}") - } - } + ) } } } diff --git a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewModel.kt b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewModel.kt index c3db239047..42ef8f285d 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewModel.kt @@ -111,7 +111,7 @@ class RoomMemberListViewModel @AssistedInject constructor(@Assisted initialState } } - return mapOf( + return listOf( PowerLevelCategory.ADMIN to admins, PowerLevelCategory.MODERATOR to moderators, PowerLevelCategory.CUSTOM to customs, diff --git a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewState.kt b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewState.kt index 767de9a854..467f194597 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewState.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomprofile/members/RoomMemberListViewState.kt @@ -34,7 +34,7 @@ data class RoomMemberListViewState( constructor(args: RoomProfileArgs) : this(roomId = args.roomId) } -typealias RoomMemberSummaries = Map> +typealias RoomMemberSummaries = List>> enum class PowerLevelCategory(@StringRes val titleRes: Int) { ADMIN(R.string.room_member_power_level_admins), diff --git a/vector/src/main/res/drawable/ic_room_profile_member_list.xml b/vector/src/main/res/drawable/ic_room_profile_member_list.xml index a80a0d4811..75ae1944d9 100644 --- a/vector/src/main/res/drawable/ic_room_profile_member_list.xml +++ b/vector/src/main/res/drawable/ic_room_profile_member_list.xml @@ -1,19 +1,3 @@ - - diff --git a/vector/src/main/res/drawable/ic_room_profile_notification.xml b/vector/src/main/res/drawable/ic_room_profile_notification.xml index f2b500815d..8aa04d7b82 100644 --- a/vector/src/main/res/drawable/ic_room_profile_notification.xml +++ b/vector/src/main/res/drawable/ic_room_profile_notification.xml @@ -1,19 +1,3 @@ - - + android:fillColor="#000000"/> diff --git a/vector/src/main/res/drawable/ic_room_profile_settings.xml b/vector/src/main/res/drawable/ic_room_profile_settings.xml index 494ba69f14..438d4b4bf2 100644 --- a/vector/src/main/res/drawable/ic_room_profile_settings.xml +++ b/vector/src/main/res/drawable/ic_room_profile_settings.xml @@ -1,30 +1,22 @@ - - + diff --git a/vector/src/main/res/drawable/ic_room_profile_uploads.xml b/vector/src/main/res/drawable/ic_room_profile_uploads.xml index 914a70f7fb..039484e308 100644 --- a/vector/src/main/res/drawable/ic_room_profile_uploads.xml +++ b/vector/src/main/res/drawable/ic_room_profile_uploads.xml @@ -1,19 +1,3 @@ - - diff --git a/vector/src/main/res/drawable/redacted_background.xml b/vector/src/main/res/drawable/redacted_background.xml index 8538e15988..f253a9eaf7 100644 --- a/vector/src/main/res/drawable/redacted_background.xml +++ b/vector/src/main/res/drawable/redacted_background.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/vector/src/main/res/layout/item_divider.xml b/vector/src/main/res/layout/item_divider.xml index d130465e7d..f4fbf87b39 100644 --- a/vector/src/main/res/layout/item_divider.xml +++ b/vector/src/main/res/layout/item_divider.xml @@ -1,6 +1,7 @@ + android:background="?attr/vctr_list_bottom_sheet_divider_color" + tools:layout_height="100dp" /> diff --git a/vector/src/main/res/layout/item_profile_action.xml b/vector/src/main/res/layout/item_profile_action.xml index d063025379..2e32b4b444 100644 --- a/vector/src/main/res/layout/item_profile_action.xml +++ b/vector/src/main/res/layout/item_profile_action.xml @@ -1,5 +1,4 @@ - + tools:src="@drawable/ic_room_profile_notification" + tools:visibility="visible" /> + tools:text="@string/room_profile_section_security_learn_more" /> - + tools:text="@string/room_profile_encrypted_subtitle" /> - diff --git a/vector/src/main/res/layout/view_stub_room_member_profile_header.xml b/vector/src/main/res/layout/view_stub_room_member_profile_header.xml index 82bf0e7d7b..dcaa4bd553 100644 --- a/vector/src/main/res/layout/view_stub_room_member_profile_header.xml +++ b/vector/src/main/res/layout/view_stub_room_member_profile_header.xml @@ -1,10 +1,9 @@ - @@ -28,7 +27,6 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center_vertical" - android:singleLine="true" android:textAppearance="@style/Vector.Toolbar.Title" android:textSize="20sp" android:textStyle="bold" @@ -41,7 +39,6 @@ android:layout_gravity="center_horizontal" android:layout_marginTop="8dp" android:layout_marginBottom="16dp" - android:singleLine="true" android:textAppearance="@style/Vector.Toolbar.Title" android:textSize="14sp" android:textStyle="bold" @@ -69,7 +66,9 @@ android:gravity="center" android:textSize="14sp" android:visibility="gone" - tools:text="Here is a room topic, it can be multi-line but should always be displayed in full 🍱" /> + tools:text="Here is a profile status" + tools:visibility="visible" /> + \ No newline at end of file diff --git a/vector/src/main/res/layout/view_stub_room_profile_header.xml b/vector/src/main/res/layout/view_stub_room_profile_header.xml index 6a0d0fc5de..76dfef4aa5 100644 --- a/vector/src/main/res/layout/view_stub_room_profile_header.xml +++ b/vector/src/main/res/layout/view_stub_room_profile_header.xml @@ -1,12 +1,11 @@ - + android:orientation="vertical" + android:padding="16dp"> + tools:text="@sample/matrix.json/data/roomName" /> + tools:text="@sample/matrix.json/data/roomAlias" /> + tools:text="@sample/matrix.json/data/roomTopic" /> diff --git a/vector/src/main/res/values/attrs.xml b/vector/src/main/res/values/attrs.xml index aca2a7fa5f..15a3fd3981 100644 --- a/vector/src/main/res/values/attrs.xml +++ b/vector/src/main/res/values/attrs.xml @@ -46,8 +46,11 @@ + + + diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 3986d06f55..7fff839e7e 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -34,5 +34,11 @@ Unignore + + Timeline + + + Message editor + diff --git a/vector/src/main/res/values/theme_black.xml b/vector/src/main/res/values/theme_black.xml index 7bce009429..b2ddfd5b81 100644 --- a/vector/src/main/res/values/theme_black.xml +++ b/vector/src/main/res/values/theme_black.xml @@ -70,7 +70,11 @@ @color/primary_color_black @color/primary_color_dark_black - @color/list_divider_color_black + + @color/list_divider_color_black + @color/riotx_header_panel_background_black + + @color/list_divider_color_black #FF4D4D4D diff --git a/vector/src/main/res/values/theme_dark.xml b/vector/src/main/res/values/theme_dark.xml index 528a4ed2f1..9bfdcc8231 100644 --- a/vector/src/main/res/values/theme_dark.xml +++ b/vector/src/main/res/values/theme_dark.xml @@ -121,7 +121,10 @@ #FFC8C8CD - @color/list_divider_color_dark + @color/list_divider_color_dark + @color/riotx_header_panel_background_dark + + @color/list_divider_color_dark #80000000 diff --git a/vector/src/main/res/values/theme_light.xml b/vector/src/main/res/values/theme_light.xml index e9e22d4113..3a479c9368 100644 --- a/vector/src/main/res/values/theme_light.xml +++ b/vector/src/main/res/values/theme_light.xml @@ -121,7 +121,10 @@ #FFC8C8CD - @color/list_divider_color_light + @color/list_divider_color_light + @color/riotx_header_panel_background_light + + @color/list_divider_color_light #80ffffff diff --git a/vector/src/main/res/values/theme_status.xml b/vector/src/main/res/values/theme_status.xml index 421632e64c..7607ce30e9 100644 --- a/vector/src/main/res/values/theme_status.xml +++ b/vector/src/main/res/values/theme_status.xml @@ -71,8 +71,6 @@ #7F3C3C3C #4D3C3C3C - @color/list_divider_color_light - #80ffffff diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml index ead6a30fa6..e7217b7394 100644 --- a/vector/src/main/res/xml/vector_settings_preferences.xml +++ b/vector/src/main/res/xml/vector_settings_preferences.xml @@ -2,7 +2,6 @@ - @@ -26,12 +25,15 @@ android:key="SETTINGS_INTERFACE_TEXT_SIZE_KEY" android:title="@string/font_size" /> + + + + + android:defaultValue="false" + android:key="SETTINGS_ENABLE_MARKDOWN_KEY" + android:summary="@string/settings_send_markdown_summary" + android:title="@string/settings_send_markdown" /> + + + + + android:defaultValue="true" + android:key="SETTINGS_SHOW_URL_PREVIEW_KEY" + android:summary="@string/settings_inline_url_preview_summary" + android:title="@string/settings_inline_url_preview" + app:isPreferenceVisible="@bool/false_not_implemented" /> + android:title="@string/settings_show_read_receipts" />