diff --git a/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt index 7e1114660f..3dceec48ef 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/ExpandableTextItem.kt @@ -56,6 +56,7 @@ abstract class ExpandableTextItem : VectorEpoxyModel( expand(holder) } } + holder.arrow.isVisible = true } else { holder.arrow.isVisible = false } @@ -63,22 +64,26 @@ abstract class ExpandableTextItem : VectorEpoxyModel( } private fun expand(holder: Holder) { - ObjectAnimator.ofInt(holder.content, "maxLines", expandedLines) - .apply { duration = 200 } - .also { it.start() } + ObjectAnimator + .ofInt(holder.content, "maxLines", expandedLines) + .setDuration(200) + .start() holder.content.ellipsize = null holder.arrow.setImageResource(R.drawable.ic_expand_less) + holder.arrow.contentDescription = holder.view.context.getString(R.string.merged_events_collapse) isExpanded = true } private fun collapse(holder: Holder) { - ObjectAnimator.ofInt(holder.content, "maxLines", maxLines) - .apply { duration = 200 } - .also { it.start() } + ObjectAnimator + .ofInt(holder.content, "maxLines", maxLines) + .setDuration(200) + .start() holder.content.ellipsize = TextUtils.TruncateAt.END - holder.arrow.setImageResource(R.drawable.ic_expand_more) + holder.arrow.setImageResource(R.drawable.ic_expand_more) + holder.arrow.contentDescription = holder.view.context.getString(R.string.merged_events_expand) isExpanded = false } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt index ad774fbeef..7dc744da31 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt @@ -62,12 +62,12 @@ class RoomProfileController @Inject constructor( // Topic roomSummary .topic - .takeIf { it.isNotBlank() } + .takeIf { it.isNotEmpty() } ?.let { - buildProfileSection(stringProvider.getString(R.string.room_profile_section_topic)) + buildProfileSection(stringProvider.getString(R.string.room_settings_topic)) expandableTextItem { id("topic") - content(roomSummary.topic) + content(it) maxLines(2) } } diff --git a/vector/src/main/res/layout/item_expandable_textview.xml b/vector/src/main/res/layout/item_expandable_textview.xml index 34fbaf7ec0..b0c232d77e 100644 --- a/vector/src/main/res/layout/item_expandable_textview.xml +++ b/vector/src/main/res/layout/item_expandable_textview.xml @@ -23,7 +23,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dp" + android:autoLink="web" + android:fontFamily="sans-serif" + android:gravity="center" android:src="@drawable/ic_expand_more" + android:textSize="14sp" + android:textStyle="normal" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/expandableContent" diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 709bf4f4a1..d48162de29 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2124,7 +2124,6 @@ Messages here are not end-to-end encrypted. Messages in this room are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them. Messages here are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them. - Topic Security Learn more More