From f6a66562dd4c80ab610f0077ac1d024670ef1b5a Mon Sep 17 00:00:00 2001 From: mcarare Date: Mon, 4 Nov 2019 17:12:30 +0200 Subject: [PATCH] For #4487 Set activity title only once in Bookmark fragment Removed label from nav_graph that caused label to be set for each navigation Removed title setting in onCreate() called for each navigation Changed logic for checking current root when setting UI for normal mode --- .../org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt | 1 - .../java/org/mozilla/fenix/library/bookmarks/BookmarkView.kt | 2 +- app/src/main/res/navigation/nav_graph.xml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt index 435112979ee8..c4b531786a31 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt @@ -120,7 +120,6 @@ class BookmarkFragment : LibraryPageFragment(), BackHandler { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - activity?.title = getString(R.string.library_bookmarks) setHasOptionsMenu(true) } diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkView.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkView.kt index e8ae1f0f6f47..acdbde17285e 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkView.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkView.kt @@ -150,7 +150,7 @@ class BookmarkView( private fun setUiForNormalMode(root: BookmarkNode?) { super.setUiForNormalMode( - if (BookmarkRoot.Mobile.matches(root)) context.getString(R.string.library_bookmarks) else root?.title, + if (BookmarkRoot.Mobile.id == root?.guid) context.getString(R.string.library_bookmarks) else root?.title, view.bookmark_list ) } diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index e3cc2cdc591f..3eca3854bd4f 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -255,7 +255,6 @@