For #10393 and #10469 - browser fragment now observes collection changes

Useful for links from other apps + adding a page to multiple collections
fennec/production
Mihai Branescu 4 years ago
parent 62e68c579a
commit 750ae4a340

@ -10,6 +10,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.fragment_browser.*
@ -133,6 +134,17 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
autoPause = true
)
}
subscribeToTabCollections()
}
private fun subscribeToTabCollections() {
Observer<List<TabCollection>> {
requireComponents.core.tabCollectionStorage.cachedTabCollections = it
}.also { observer ->
requireComponents.core.tabCollectionStorage.getCollections()
.observe(viewLifecycleOwner, observer)
}
}
private fun updateEngineBottomMargin() {

Loading…
Cancel
Save