For #11892: Remove dynamic calls to setupNavigationToolbar
This is a speculative fix for 11892 crash. The side effect is that the back button will be visible in bookmarks root.
This commit is contained in:
parent
93247e0b2f
commit
9f5c8819d3
|
@ -367,11 +367,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
|||
* Everyone should call this instead of supportActionBar.
|
||||
*/
|
||||
fun getSupportActionBarAndInflateIfNecessary(): ActionBar {
|
||||
// Add ids to this that we don't want to have a toolbar back button
|
||||
if (!isToolbarInflated) {
|
||||
navigationToolbar = navigationToolbarStub.inflate() as Toolbar
|
||||
|
||||
setSupportActionBar(navigationToolbar)
|
||||
// Add ids to this that we don't want to have a toolbar back button
|
||||
setupNavigationToolbar()
|
||||
|
||||
isToolbarInflated = true
|
||||
|
|
|
@ -13,7 +13,6 @@ import kotlinx.android.synthetic.main.component_bookmark.view.*
|
|||
import mozilla.appservices.places.BookmarkRoot
|
||||
import mozilla.components.concept.storage.BookmarkNode
|
||||
import mozilla.components.support.base.feature.UserInteractionHandler
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.NavGraphDirections
|
||||
import org.mozilla.fenix.library.LibraryPageView
|
||||
|
@ -140,17 +139,9 @@ class BookmarkView(
|
|||
bookmarkAdapter.updateData(state.tree, mode)
|
||||
when (mode) {
|
||||
is BookmarkFragmentState.Mode.Normal -> {
|
||||
if (tree != null) {
|
||||
if (BookmarkRoot.Mobile.id == tree?.guid) {
|
||||
(activity as HomeActivity).setupNavigationToolbar(R.id.bookmarkFragment)
|
||||
} else {
|
||||
(activity as HomeActivity).setupNavigationToolbar()
|
||||
}
|
||||
}
|
||||
setUiForNormalMode(state.tree)
|
||||
}
|
||||
is BookmarkFragmentState.Mode.Selecting -> {
|
||||
(activity as HomeActivity).setupNavigationToolbar()
|
||||
setUiForSelectingMode(
|
||||
context.getString(
|
||||
R.string.bookmarks_multi_select_title,
|
||||
|
|
|
@ -13,7 +13,6 @@ import androidx.recyclerview.widget.SimpleItemAnimator
|
|||
import kotlinx.android.synthetic.main.component_history.*
|
||||
import kotlinx.android.synthetic.main.component_history.view.*
|
||||
import mozilla.components.support.base.feature.UserInteractionHandler
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.library.LibraryPageView
|
||||
import org.mozilla.fenix.library.SelectionInteractor
|
||||
|
@ -143,13 +142,11 @@ class HistoryView(
|
|||
|
||||
when (val mode = state.mode) {
|
||||
is HistoryFragmentState.Mode.Normal -> {
|
||||
(activity as HomeActivity).setupNavigationToolbar(R.id.historyFragment)
|
||||
setUiForNormalMode(
|
||||
context.getString(R.string.library_history)
|
||||
)
|
||||
}
|
||||
is HistoryFragmentState.Mode.Editing -> {
|
||||
(activity as HomeActivity).setupNavigationToolbar()
|
||||
setUiForSelectingMode(
|
||||
context.getString(R.string.history_multi_select_title, mode.selectedItems.size)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user