kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add description to story link previews.
rodzic
dabea5169b
commit
6054285ddb
|
@ -34,6 +34,7 @@ class StoryLinkPreviewView @JvmOverloads constructor(
|
|||
private val image: OutlinedThumbnailView = findViewById(R.id.link_preview_image)
|
||||
private val title: TextView = findViewById(R.id.link_preview_title)
|
||||
private val url: TextView = findViewById(R.id.link_preview_url)
|
||||
private val description: TextView = findViewById(R.id.link_preview_description)
|
||||
|
||||
fun bind(linkPreview: LinkPreview?, hiddenVisibility: Int = View.INVISIBLE): ListenableFuture<Boolean> {
|
||||
var listenableFuture: ListenableFuture<Boolean>? = null
|
||||
|
@ -54,6 +55,8 @@ class StoryLinkPreviewView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
title.text = linkPreview.title
|
||||
description.text = linkPreview.description
|
||||
description.visible = linkPreview.description.isNotEmpty()
|
||||
|
||||
formatUrl(linkPreview)
|
||||
} else {
|
||||
|
|
|
@ -55,15 +55,30 @@
|
|||
app:layout_goneMarginStart="0dp"
|
||||
tools:text="ASDF dot com, the resource of your asdf dreams and whatnot. This needs to be 3 lines for testing." />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/link_preview_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/core_white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/link_preview_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/link_preview_title"
|
||||
tools:text="Blah blah blah" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/link_preview_url"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/transparent_white_60"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/link_preview_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/link_preview_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/link_preview_description"
|
||||
tools:text="www.asdf.com" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
Ładowanie…
Reference in New Issue