Remove ThumbnailsFeature. (#5127)
We currently do not use thumbnails anywhere in the app. Not using the feature means we are not taking thumbnails on every page load which means we are saving memory and CPU cycles.master
parent
231924f5eb
commit
3a35233ac0
|
@ -27,7 +27,6 @@ import kotlinx.coroutines.withContext
|
||||||
import mozilla.appservices.places.BookmarkRoot
|
import mozilla.appservices.places.BookmarkRoot
|
||||||
import mozilla.components.browser.session.Session
|
import mozilla.components.browser.session.Session
|
||||||
import mozilla.components.feature.readerview.ReaderViewFeature
|
import mozilla.components.feature.readerview.ReaderViewFeature
|
||||||
import mozilla.components.feature.session.ThumbnailsFeature
|
|
||||||
import mozilla.components.feature.sitepermissions.SitePermissions
|
import mozilla.components.feature.sitepermissions.SitePermissions
|
||||||
import mozilla.components.lib.state.ext.consumeFrom
|
import mozilla.components.lib.state.ext.consumeFrom
|
||||||
import mozilla.components.support.base.feature.BackHandler
|
import mozilla.components.support.base.feature.BackHandler
|
||||||
|
@ -62,7 +61,6 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler {
|
||||||
private var quickActionSheetSessionObserver: QuickActionSheetSessionObserver? = null
|
private var quickActionSheetSessionObserver: QuickActionSheetSessionObserver? = null
|
||||||
|
|
||||||
private val readerViewFeature = ViewBoundFeatureWrapper<ReaderViewFeature>()
|
private val readerViewFeature = ViewBoundFeatureWrapper<ReaderViewFeature>()
|
||||||
private val thumbnailsFeature = ViewBoundFeatureWrapper<ThumbnailsFeature>()
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -92,16 +90,6 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler {
|
||||||
|
|
||||||
return super.initializeUI(view)?.also {
|
return super.initializeUI(view)?.also {
|
||||||
|
|
||||||
thumbnailsFeature.set(
|
|
||||||
feature = ThumbnailsFeature(
|
|
||||||
requireContext(),
|
|
||||||
view.engineView,
|
|
||||||
requireComponents.core.sessionManager
|
|
||||||
),
|
|
||||||
owner = this,
|
|
||||||
view = view
|
|
||||||
)
|
|
||||||
|
|
||||||
readerViewFeature.set(
|
readerViewFeature.set(
|
||||||
feature = ReaderViewFeature(
|
feature = ReaderViewFeature(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
|
|
|
@ -14,7 +14,5 @@ fun Session.toTab(context: Context, selected: Boolean? = null): Tab {
|
||||||
this.url,
|
this.url,
|
||||||
this.url.urlToTrimmedHost(context),
|
this.url.urlToTrimmedHost(context),
|
||||||
this.title,
|
this.title,
|
||||||
selected,
|
selected)
|
||||||
this.thumbnail
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
package org.mozilla.fenix.home.sessioncontrol
|
package org.mozilla.fenix.home.sessioncontrol
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -53,8 +52,7 @@ data class Tab(
|
||||||
val url: String,
|
val url: String,
|
||||||
val hostname: String,
|
val hostname: String,
|
||||||
val title: String,
|
val title: String,
|
||||||
val selected: Boolean? = null,
|
val selected: Boolean? = null
|
||||||
val thumbnail: Bitmap? = null
|
|
||||||
) : Parcelable
|
) : Parcelable
|
||||||
|
|
||||||
fun List<Tab>.toSessionBundle(context: Context): MutableList<Session> {
|
fun List<Tab>.toSessionBundle(context: Context): MutableList<Session> {
|
||||||
|
|
Loading…
Reference in New Issue