Closes #12692: Remove www. prefix in tab tray urls
Use separate imports instead of a wildcard import Use toShortUrl String extension instead of removing prefix from url host Add missing importmaster
parent
048f6a49fe
commit
579a69b477
|
@ -26,7 +26,6 @@ import mozilla.components.feature.media.ext.playIfPaused
|
||||||
import mozilla.components.support.base.observer.Observable
|
import mozilla.components.support.base.observer.Observable
|
||||||
import mozilla.components.support.images.ImageLoadRequest
|
import mozilla.components.support.images.ImageLoadRequest
|
||||||
import mozilla.components.support.images.loader.ImageLoader
|
import mozilla.components.support.images.loader.ImageLoader
|
||||||
import mozilla.components.support.ktx.kotlin.tryGetHostFromUrl
|
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
|
@ -36,6 +35,7 @@ import org.mozilla.fenix.ext.increaseTapArea
|
||||||
import org.mozilla.fenix.ext.removeAndDisable
|
import org.mozilla.fenix.ext.removeAndDisable
|
||||||
import org.mozilla.fenix.ext.removeTouchDelegate
|
import org.mozilla.fenix.ext.removeTouchDelegate
|
||||||
import org.mozilla.fenix.ext.showAndEnable
|
import org.mozilla.fenix.ext.showAndEnable
|
||||||
|
import org.mozilla.fenix.ext.toShortUrl
|
||||||
import org.mozilla.fenix.utils.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
|
@ -160,7 +160,9 @@ class TabTrayViewHolder(
|
||||||
// is done in the toolbar and awesomebar:
|
// is done in the toolbar and awesomebar:
|
||||||
// https://github.com/mozilla-mobile/fenix/issues/1824
|
// https://github.com/mozilla-mobile/fenix/issues/1824
|
||||||
// https://github.com/mozilla-mobile/android-components/issues/6985
|
// https://github.com/mozilla-mobile/android-components/issues/6985
|
||||||
urlView?.text = tab.url.tryGetHostFromUrl().take(MAX_URI_LENGTH)
|
urlView?.text = tab.url
|
||||||
|
.toShortUrl(itemView.context.components.publicSuffixList)
|
||||||
|
.take(MAX_URI_LENGTH)
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|
Loading…
Reference in New Issue