[fenix] Bug 1815306 - Truncate tabs tray title to mitigate scroll performance

We truncate the URL as well if we use that, but unlike the url TextView,
we do not need to shorten it first.

Co-authored-by: Matt Tighe <mtighe@mozilla.com>
Co-authored-by: Noah Bond <nbond@mozilla.com>
pull/600/head
Jonathan Almeida 1 year ago committed by mergify[bot]
parent 92edc83ddf
commit 75f31d534e

@ -42,6 +42,7 @@ import org.mozilla.fenix.selection.SelectionHolder
import org.mozilla.fenix.tabstray.TabsTrayInteractor
import org.mozilla.fenix.tabstray.TabsTrayState
import org.mozilla.fenix.tabstray.TabsTrayStore
import org.mozilla.fenix.tabstray.ext.toDisplayTitle
/**
* A RecyclerView ViewHolder implementation for "tab" items.
@ -128,9 +129,8 @@ abstract class AbstractBrowserTabViewHolder(
}
private fun updateTitle(tab: TabSessionState) {
val title = tab.content.title.ifEmpty {
tab.content.url
}
// We can use the max URI length for titles as well.
val title = tab.toDisplayTitle().take(MAX_URI_LENGTH)
titleView.text = title
}

Loading…
Cancel
Save