Skip to content

Commit

Permalink
For mozilla-mobile#4487 Set activity title only once in Bookmark frag…
Browse files Browse the repository at this point in the history
…ment

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
  • Loading branch information
mcarare authored and ekager committed Nov 12, 2019
1 parent 0275ca0 commit f6a6656
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), BackHandler {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
activity?.title = getString(R.string.library_bookmarks)
setHasOptionsMenu(true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@
<fragment
android:id="@+id/bookmarkFragment"
android:name="org.mozilla.fenix.library.bookmarks.BookmarkFragment"
android:label="@string/library_bookmarks"
tools:layout="@layout/fragment_bookmark">
<argument
android:name="currentRoot"
Expand Down

0 comments on commit f6a6656

Please sign in to comment.