diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt index f739fe9e1b..9b73136fc3 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt @@ -16,7 +16,6 @@ package org.matrix.android.sdk.api.session.room.sender -import org.matrix.android.sdk.api.util.MatrixItem import org.matrix.android.sdk.internal.util.replaceSpaceChars data class SenderInfo( @@ -36,5 +35,3 @@ data class SenderInfo( else -> "$displayName ($userId)" } } - -fun SenderInfo.toMatrixItem() = MatrixItem.UserItem(userId, displayName, avatarUrl) diff --git a/tools/check/check_code_quality.sh b/tools/check/check_code_quality.sh index 7decb985bb..9535ff9efb 100755 --- a/tools/check/check_code_quality.sh +++ b/tools/check/check_code_quality.sh @@ -124,7 +124,7 @@ else chmod u+x ${checkLongFilesScript} fi -maxLines=2500 +maxLines=2800 echo echo "Search for kotlin files with more than ${maxLines} lines..." diff --git a/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageAvatar.kt b/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageAvatar.kt index 9e7c4d3580..22312f36fa 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageAvatar.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageAvatar.kt @@ -38,7 +38,7 @@ class TypingMessageAvatar @JvmOverloads constructor( const val OVERLAP_FACT0R = -3 // =~ 30% to left } - fun render(typingUsers: List, avatarRender: AvatarRenderer) { + fun render(typingUsers: List, avatarRenderer: AvatarRenderer) { removeAllViews() for ((index, value) in typingUsers.withIndex()) { val avatar = ImageView(context) @@ -48,7 +48,7 @@ class TypingMessageAvatar @JvmOverloads constructor( layoutParams.width = DimensionConverter(resources).dpToPx(AVATAR_SIZE_DP) layoutParams.height = DimensionConverter(resources).dpToPx(AVATAR_SIZE_DP) avatar.layoutParams = layoutParams - avatarRender.render(value.toMatrixItem(), avatar) + avatarRenderer.render(value.toMatrixItem(), avatar) addView(avatar) } } diff --git a/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageView.kt b/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageView.kt index 11248bde74..2dc9eedd99 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageView.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/TypingMessageView.kt @@ -43,9 +43,9 @@ class TypingMessageView @JvmOverloads constructor( views = TypingMessageLayoutBinding.bind(this) } - fun render(typingUsers: List, avatarRender: AvatarRenderer) { + fun render(typingUsers: List, avatarRenderer: AvatarRenderer) { views.usersName.text = typingHelper.getNotificationTypingMessage(typingUsers) - views.avatars.render(typingUsers, avatarRender) + views.avatars.render(typingUsers, avatarRenderer) } override fun onDetachedFromWindow() { 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 8fbe8e9afa..1a40018526 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 @@ -1608,9 +1608,9 @@ class TimelineFragment @Inject constructor( private fun renderTypingMessageNotification(roomSummary: RoomSummary?, state: RoomDetailViewState) { if (!isThreadTimeLine() && roomSummary != null) { views.typingMessageView.isInvisible = state.typingUsers.isNullOrEmpty() - state.typingUsers?.let { senders -> - views.typingMessageView.render(senders.take(MAX_TYPING_MESSAGE_USERS_COUNT), avatarRenderer) - } + state.typingUsers + ?.take(MAX_TYPING_MESSAGE_USERS_COUNT) + ?.let { senders -> views.typingMessageView.render(senders, avatarRenderer) } } else { views.typingMessageView.isInvisible = true } diff --git a/vector/src/main/res/layout/fragment_timeline.xml b/vector/src/main/res/layout/fragment_timeline.xml index 0affba8bdc..6ba326bcc4 100644 --- a/vector/src/main/res/layout/fragment_timeline.xml +++ b/vector/src/main/res/layout/fragment_timeline.xml @@ -97,7 +97,7 @@ android:layout_width="0dp" android:paddingStart="20dp" android:paddingEnd="20dp" - android:visibility="invisible" + tools:visibility="visible" android:layout_height="20dp"/> + app:layout_constraintStart_toStartOf="parent" + tools:visibility="visible"/> %s is typing… %1$s & %2$s are typing… %1$s & %2$s & others are typing… - %1$s and %2$s %1$s, %2$s and others Send an encrypted message…