Fix long text overlapping

This commit is contained in:
Florian Renaud 2023-01-24 08:48:45 +01:00
parent fea3441bbf
commit f0eae523d5
2 changed files with 69 additions and 55 deletions

View File

@ -40,41 +40,47 @@
<TextView <TextView
android:id="@+id/titleText" android:id="@+id/titleText"
style="@style/Widget.Vector.TextView.Body.Medium" style="@style/Widget.Vector.TextView.Body.Medium"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:contentDescription="@string/avatar" android:contentDescription="@string/avatar"
android:ellipsize="end"
android:maxLines="1"
app:layout_constraintEnd_toStartOf="@id/liveIndicator"
app:layout_constraintStart_toEndOf="@id/avatarRightBarrier" app:layout_constraintStart_toEndOf="@id/avatarRightBarrier"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/rooms.json/data/name" /> tools:text="@sample/rooms.json/data/name" />
<androidx.constraintlayout.helper.widget.Flow <LinearLayout
android:id="@+id/metadataFlow" android:id="@+id/metadataGroup"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:orientation="vertical" android:orientation="vertical"
app:constraint_referenced_ids="broadcasterNameMetadata,bufferingMetadata,voiceBroadcastMetadata,listenersCountMetadata" app:layout_constraintEnd_toStartOf="@id/liveIndicator"
app:flow_horizontalAlign="start"
app:flow_verticalGap="4dp"
app:layout_constraintStart_toEndOf="@id/avatarRightBarrier" app:layout_constraintStart_toEndOf="@id/avatarRightBarrier"
app:layout_constraintTop_toBottomOf="@id/titleText" /> app:layout_constraintTop_toBottomOf="@id/titleText">
<im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView <im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView
android:id="@+id/broadcasterNameMetadata" android:id="@+id/broadcasterNameMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
app:metadataIcon="@drawable/ic_voice_broadcast_mic" app:metadataIcon="@drawable/ic_voice_broadcast_mic"
tools:metadataValue="@sample/users.json/data/displayName" /> tools:metadataValue="@sample/users.json/data/displayName" />
<im.vector.app.features.voicebroadcast.views.VoiceBroadcastBufferingView <im.vector.app.features.voicebroadcast.views.VoiceBroadcastBufferingView
android:id="@+id/bufferingMetadata" android:id="@+id/bufferingMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginBottom="4dp" />
<im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView <im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView
android:id="@+id/voiceBroadcastMetadata" android:id="@+id/voiceBroadcastMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
app:metadataIcon="@drawable/ic_voice_broadcast" app:metadataIcon="@drawable/ic_voice_broadcast"
app:metadataValue="@string/attachment_type_voice_broadcast" /> app:metadataValue="@string/attachment_type_voice_broadcast" />
@ -82,9 +88,11 @@
android:id="@+id/listenersCountMetadata" android:id="@+id/listenersCountMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
app:metadataIcon="@drawable/ic_member_small" app:metadataIcon="@drawable/ic_member_small"
app:metadataValue="@string/no_value_placeholder" app:metadataValue="@string/no_value_placeholder"
tools:metadataValue="5 listeners" /> tools:metadataValue="5 listeners" />
</LinearLayout>
<androidx.constraintlayout.widget.Barrier <androidx.constraintlayout.widget.Barrier
android:id="@+id/headerBottomBarrier" android:id="@+id/headerBottomBarrier"
@ -92,7 +100,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:barrierMargin="10dp" app:barrierMargin="10dp"
app:constraint_referenced_ids="roomAvatarImageView,titleText,metadataFlow" /> app:constraint_referenced_ids="roomAvatarImageView,titleText,metadataGroup" />
<androidx.constraintlayout.helper.widget.Flow <androidx.constraintlayout.helper.widget.Flow
android:id="@+id/controllerButtonsFlow" android:id="@+id/controllerButtonsFlow"

View File

@ -38,29 +38,33 @@
<TextView <TextView
android:id="@+id/titleText" android:id="@+id/titleText"
style="@style/Widget.Vector.TextView.Body.Medium" style="@style/Widget.Vector.TextView.Body.Medium"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:contentDescription="@string/avatar" android:contentDescription="@string/avatar"
android:ellipsize="end"
android:maxLines="1"
app:layout_constraintEnd_toStartOf="@id/liveIndicator"
app:layout_constraintStart_toEndOf="@id/avatarRightBarrier" app:layout_constraintStart_toEndOf="@id/avatarRightBarrier"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/users.json/data/displayName" /> tools:text="@sample/rooms.json/data/name" />
<androidx.constraintlayout.helper.widget.Flow <LinearLayout
android:id="@+id/metadataFlow" android:id="@+id/metadataGroup"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:orientation="vertical" android:orientation="vertical"
app:constraint_referenced_ids="listenersCountMetadata,remainingTimeMetadata" app:layout_constraintEnd_toStartOf="@id/liveIndicator"
app:flow_horizontalAlign="start"
app:flow_verticalGap="4dp"
app:layout_constraintStart_toEndOf="@id/avatarRightBarrier" app:layout_constraintStart_toEndOf="@id/avatarRightBarrier"
app:layout_constraintTop_toBottomOf="@id/titleText" /> app:layout_constraintTop_toBottomOf="@id/titleText">
<im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView <im.vector.app.features.voicebroadcast.views.VoiceBroadcastMetadataView
android:id="@+id/listenersCountMetadata" android:id="@+id/listenersCountMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
app:metadataIcon="@drawable/ic_member_small" app:metadataIcon="@drawable/ic_member_small"
app:metadataValue="@string/no_value_placeholder" app:metadataValue="@string/no_value_placeholder"
tools:metadataValue="5 listening" /> tools:metadataValue="5 listening" />
@ -69,8 +73,10 @@
android:id="@+id/remainingTimeMetadata" android:id="@+id/remainingTimeMetadata"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
app:metadataIcon="@drawable/ic_timer" app:metadataIcon="@drawable/ic_timer"
tools:metadataValue="3h 2m 50s left" /> tools:metadataValue="3h 2m 50s left" />
</LinearLayout>
<androidx.constraintlayout.widget.Barrier <androidx.constraintlayout.widget.Barrier
android:id="@+id/headerBottomBarrier" android:id="@+id/headerBottomBarrier"
@ -78,7 +84,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:barrierMargin="12dp" app:barrierMargin="12dp"
app:constraint_referenced_ids="roomAvatarImageView,titleText,metadataFlow" /> app:constraint_referenced_ids="roomAvatarImageView,titleText,metadataGroup" />
<androidx.constraintlayout.helper.widget.Flow <androidx.constraintlayout.helper.widget.Flow
android:id="@+id/controllerButtonsFlow" android:id="@+id/controllerButtonsFlow"