2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

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

Useful for links from other apps + adding a page to multiple collections
This commit is contained in:
Mihai Branescu 2020-05-07 10:52:34 +03:00
parent 62e68c579a
commit 750ae4a340

View File

@ -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() {