Benoit code review fixes.

This commit is contained in:
Onuray Sahin 2020-10-12 14:26:06 +03:00
parent beeb840436
commit f8f091fa28
4 changed files with 20 additions and 11 deletions

View File

@ -56,6 +56,7 @@ abstract class ExpandableTextItem : VectorEpoxyModel<ExpandableTextItem.Holder>(
expand(holder) expand(holder)
} }
} }
holder.arrow.isVisible = true
} else { } else {
holder.arrow.isVisible = false holder.arrow.isVisible = false
} }
@ -63,22 +64,26 @@ abstract class ExpandableTextItem : VectorEpoxyModel<ExpandableTextItem.Holder>(
} }
private fun expand(holder: Holder) { private fun expand(holder: Holder) {
ObjectAnimator.ofInt(holder.content, "maxLines", expandedLines) ObjectAnimator
.apply { duration = 200 } .ofInt(holder.content, "maxLines", expandedLines)
.also { it.start() } .setDuration(200)
.start()
holder.content.ellipsize = null holder.content.ellipsize = null
holder.arrow.setImageResource(R.drawable.ic_expand_less) holder.arrow.setImageResource(R.drawable.ic_expand_less)
holder.arrow.contentDescription = holder.view.context.getString(R.string.merged_events_collapse)
isExpanded = true isExpanded = true
} }
private fun collapse(holder: Holder) { private fun collapse(holder: Holder) {
ObjectAnimator.ofInt(holder.content, "maxLines", maxLines) ObjectAnimator
.apply { duration = 200 } .ofInt(holder.content, "maxLines", maxLines)
.also { it.start() } .setDuration(200)
.start()
holder.content.ellipsize = TextUtils.TruncateAt.END 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 isExpanded = false
} }

View File

@ -62,12 +62,12 @@ class RoomProfileController @Inject constructor(
// Topic // Topic
roomSummary roomSummary
.topic .topic
.takeIf { it.isNotBlank() } .takeIf { it.isNotEmpty() }
?.let { ?.let {
buildProfileSection(stringProvider.getString(R.string.room_profile_section_topic)) buildProfileSection(stringProvider.getString(R.string.room_settings_topic))
expandableTextItem { expandableTextItem {
id("topic") id("topic")
content(roomSummary.topic) content(it)
maxLines(2) maxLines(2)
} }
} }

View File

@ -23,7 +23,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:autoLink="web"
android:fontFamily="sans-serif"
android:gravity="center"
android:src="@drawable/ic_expand_more" android:src="@drawable/ic_expand_more"
android:textSize="14sp"
android:textStyle="normal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/expandableContent" app:layout_constraintTop_toBottomOf="@+id/expandableContent"

View File

@ -2124,7 +2124,6 @@
<string name="direct_room_profile_not_encrypted_subtitle">Messages here are not end-to-end encrypted.</string> <string name="direct_room_profile_not_encrypted_subtitle">Messages here are not end-to-end encrypted.</string>
<string name="room_profile_encrypted_subtitle">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.</string> <string name="room_profile_encrypted_subtitle">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.</string>
<string name="direct_room_profile_encrypted_subtitle">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.</string> <string name="direct_room_profile_encrypted_subtitle">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.</string>
<string name="room_profile_section_topic">Topic</string>
<string name="room_profile_section_security">Security</string> <string name="room_profile_section_security">Security</string>
<string name="room_profile_section_security_learn_more">Learn more</string> <string name="room_profile_section_security_learn_more">Learn more</string>
<string name="room_profile_section_more">More</string> <string name="room_profile_section_more">More</string>