mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-30 10:54:58 +01:00
matching iOS max line rules for the preview description
This commit is contained in:
parent
170f34639b
commit
9094173b52
@ -125,9 +125,15 @@ class PreviewUrlView @JvmOverloads constructor(
|
|||||||
|
|
||||||
private fun renderData(previewUrlData: PreviewUrlData, imageContentRenderer: ImageContentRenderer) {
|
private fun renderData(previewUrlData: PreviewUrlData, imageContentRenderer: ImageContentRenderer) {
|
||||||
isVisible = true
|
isVisible = true
|
||||||
|
|
||||||
views.urlPreviewTitle.setTextOrHide(previewUrlData.title)
|
views.urlPreviewTitle.setTextOrHide(previewUrlData.title)
|
||||||
views.urlPreviewImage.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, views.urlPreviewImage) }.orFalse()
|
views.urlPreviewImage.isVisible = previewUrlData.mxcUrl?.let { imageContentRenderer.render(it, views.urlPreviewImage) }.orFalse()
|
||||||
views.urlPreviewDescription.setTextOrHide(previewUrlData.description)
|
views.urlPreviewDescription.setTextOrHide(previewUrlData.description)
|
||||||
|
views.urlPreviewDescription.maxLines = when {
|
||||||
|
previewUrlData.mxcUrl != null -> 2
|
||||||
|
previewUrlData.title != null -> 3
|
||||||
|
else -> 5
|
||||||
|
}
|
||||||
views.urlPreviewSite.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title })
|
views.urlPreviewSite.setTextOrHide(previewUrlData.siteName.takeIf { it != previewUrlData.title })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@
|
|||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
|
||||||
android:textColor="?vctr_content_secondary"
|
android:textColor="?vctr_content_secondary"
|
||||||
tools:text="The British perfumer says removing actor John Boyega from his own advert was “utterly despicable”." />
|
tools:text="The British perfumer says removing actor John Boyega from his own advert was “utterly despicable”." />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user