diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt index b7af9caf15..2c4ac2d9d7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt @@ -1594,6 +1594,7 @@ class TimelineFragment @Inject constructor( timelineArgs.threadTimelineArgs?.let { val matrixItem = MatrixItem.RoomItem(it.roomId, it.displayName, it.avatarUrl) avatarRenderer.render(matrixItem, views.includeThreadToolbar.roomToolbarThreadImageView) + views.includeThreadToolbar.roomToolbarThreadShieldImageView.render(it.roomEncryptionTrustLevel) views.includeThreadToolbar.roomToolbarThreadSubtitleTextView.text = it.displayName } views.includeThreadToolbar.roomToolbarThreadTitleTextView.text = resources.getText(R.string.thread_timeline_title) @@ -2321,6 +2322,7 @@ class TimelineFragment @Inject constructor( roomId = timelineArgs.roomId, displayName = roomDetailViewModel.getRoomSummary()?.displayName, avatarUrl = roomDetailViewModel.getRoomSummary()?.avatarUrl, + roomEncryptionTrustLevel = roomDetailViewModel.getRoomSummary()?.roomEncryptionTrustLevel, rootThreadEventId = rootThreadEventId) navigator.openThread(it, roomThreadDetailArgs) } @@ -2336,6 +2338,7 @@ class TimelineFragment @Inject constructor( val roomThreadDetailArgs = ThreadTimelineArgs( roomId = timelineArgs.roomId, displayName = roomDetailViewModel.getRoomSummary()?.displayName, + roomEncryptionTrustLevel = roomDetailViewModel.getRoomSummary()?.roomEncryptionTrustLevel, avatarUrl = roomDetailViewModel.getRoomSummary()?.avatarUrl) navigator.openThreadList(it, roomThreadDetailArgs) } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt index aba5c65ae8..62c142238e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchFragment.kt @@ -126,7 +126,12 @@ class SearchFragment @Inject constructor( private fun navigateToEvent(event: Event) { val roomId = event.roomId ?: return event.getRootThreadEventId()?.let { - val threadTimelineArgs = ThreadTimelineArgs(roomId, displayName = fragmentArgs.roomDisplayName, fragmentArgs.roomAvatarUrl, it) + val threadTimelineArgs = ThreadTimelineArgs( + roomId = roomId, + displayName = fragmentArgs.roomDisplayName, + avatarUrl = fragmentArgs.roomAvatarUrl, + roomEncryptionTrustLevel = null, + rootThreadEventId = it) navigator.openThread(requireContext(), threadTimelineArgs, event.eventId) } ?: navigator.openRoom(requireContext(), roomId, event.eventId) } diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/ThreadsActivity.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/ThreadsActivity.kt index fe3c32ae65..b9d77a323a 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/ThreadsActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/ThreadsActivity.kt @@ -100,6 +100,7 @@ class ThreadsActivity : VectorBaseActivity(), ToolbarCon roomId = timelineEvent.roomId, displayName = timelineEvent.senderInfo.displayName, avatarUrl = timelineEvent.senderInfo.avatarUrl, + roomEncryptionTrustLevel = null, rootThreadEventId = timelineEvent.eventId) val commonOption: (FragmentTransaction) -> Unit = { it.setCustomAnimations( diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadListArgs.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadListArgs.kt index 50819a3017..aa3746ea41 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadListArgs.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadListArgs.kt @@ -18,10 +18,12 @@ package im.vector.app.features.home.room.threads.arguments import android.os.Parcelable import kotlinx.parcelize.Parcelize +import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel @Parcelize data class ThreadListArgs( val roomId: String, val displayName: String?, val avatarUrl: String?, + val roomEncryptionTrustLevel: RoomEncryptionTrustLevel? ) : Parcelable diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadTimelineArgs.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadTimelineArgs.kt index 2ebed2f745..aadad3d97c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadTimelineArgs.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/arguments/ThreadTimelineArgs.kt @@ -18,11 +18,13 @@ package im.vector.app.features.home.room.threads.arguments import android.os.Parcelable import kotlinx.parcelize.Parcelize +import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel @Parcelize data class ThreadTimelineArgs( val roomId: String, val displayName: String?, val avatarUrl: String?, + val roomEncryptionTrustLevel: RoomEncryptionTrustLevel?, val rootThreadEventId: String? = null ) : Parcelable diff --git a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListBottomSheet.kt b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListBottomSheet.kt index bd62f65897..7ad4804e5b 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/threads/list/views/ThreadListBottomSheet.kt @@ -16,17 +16,21 @@ package im.vector.app.features.home.room.threads.list.views +import android.graphics.drawable.Drawable import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.annotation.AttrRes import androidx.core.content.ContextCompat +import androidx.core.graphics.drawable.DrawableCompat import com.airbnb.mvrx.parentFragmentViewModel import im.vector.app.R import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment import im.vector.app.databinding.BottomSheetThreadListBinding import im.vector.app.features.home.room.threads.list.viewmodel.ThreadListViewModel import im.vector.app.features.home.room.threads.list.viewmodel.ThreadListViewState +import im.vector.app.features.themes.ThemeUtils class ThreadListBottomSheet : VectorBaseBottomSheetDialogFragment() { @@ -53,8 +57,29 @@ class ThreadListBottomSheet : VectorBaseBottomSheetDialogFragment - + android:pathData="M10.9996,18H12.9996C13.5496,18 13.9996,17.55 13.9996,17C13.9996,16.45 13.5496,16 12.9996,16H10.9996C10.4496,16 9.9996,16.45 9.9996,17C9.9996,17.55 10.4496,18 10.9996,18ZM2.9996,7C2.9996,7.55 3.4496,8 3.9996,8H19.9996C20.5496,8 20.9996,7.55 20.9996,7C20.9996,6.45 20.5496,6 19.9996,6H3.9996C3.4496,6 2.9996,6.45 2.9996,7ZM6.9996,13H16.9996C17.5496,13 17.9996,12.55 17.9996,12C17.9996,11.45 17.5496,11 16.9996,11H6.9996C6.4496,11 5.9996,11.45 5.9996,12C5.9996,12.55 6.4496,13 6.9996,13Z" + android:fillColor="#737D8C"/> diff --git a/vector/src/main/res/layout/bottom_sheet_thread_list.xml b/vector/src/main/res/layout/bottom_sheet_thread_list.xml index 3fd75e1823..e736f30edc 100644 --- a/vector/src/main/res/layout/bottom_sheet_thread_list.xml +++ b/vector/src/main/res/layout/bottom_sheet_thread_list.xml @@ -1,7 +1,6 @@ + +