1
0
Fork 0

For #1951: Bookmarks library pane displays everything from root down (#2135)

master
Colin Lee 2019-04-29 16:54:48 -05:00 committed by GitHub
parent 3734d08f17
commit f1050eaff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -54,10 +54,12 @@ class LibraryFragment : Fragment() {
)
)
libraryBookmarks.setOnClickListener(Navigation.createNavigateOnClickListener(
LibraryFragmentDirections.actionLibraryFragmentToBookmarksFragment(BookmarkRoot.Root.id).actionId,
BookmarkFragmentArgs(BookmarkRoot.Root.id).toBundle()
))
libraryBookmarks.setOnClickListener(
Navigation.createNavigateOnClickListener(
LibraryFragmentDirections.actionLibraryFragmentToBookmarksFragment(BookmarkRoot.Mobile.id).actionId,
BookmarkFragmentArgs(BookmarkRoot.Mobile.id).toBundle()
)
)
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {

View File

@ -89,7 +89,7 @@ class BookmarkFragment : Fragment(), CoroutineScope, BackHandler, AccountObserve
checkIfSignedIn()
navigation.addOnDestinationChangedListener(onDestinationChangedListener)
val currentGuid = BookmarkFragmentArgs.fromBundle(arguments!!).currentRoot.ifEmpty { BookmarkRoot.Root.id }
val currentGuid = BookmarkFragmentArgs.fromBundle(arguments!!).currentRoot.ifEmpty { BookmarkRoot.Mobile.id }
launch(IO) {
currentRoot = requireComponents.core.bookmarksStorage.getTree(currentGuid) as BookmarkNode

View File

@ -111,8 +111,9 @@ class BookmarkUIView(
private fun setTitle(root: BookmarkNode?) {
(activity as? AppCompatActivity)?.title =
if (root?.title in setOf(
"root",
if (root?.guid in setOf(
BookmarkRoot.Mobile.id,
BookmarkRoot.Root.id,
null
)
) context.getString(R.string.library_bookmarks) else root!!.title