Fixes #10674: Add SignInView only once
parent
96b015771b
commit
03284e2da0
|
@ -57,6 +57,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
|
||||||
|
|
||||||
private lateinit var bookmarkStore: BookmarkFragmentStore
|
private lateinit var bookmarkStore: BookmarkFragmentStore
|
||||||
private lateinit var bookmarkView: BookmarkView
|
private lateinit var bookmarkView: BookmarkView
|
||||||
|
private lateinit var signInView: SignInView
|
||||||
private var _bookmarkInteractor: BookmarkFragmentInteractor? = null
|
private var _bookmarkInteractor: BookmarkFragmentInteractor? = null
|
||||||
protected val bookmarkInteractor: BookmarkFragmentInteractor
|
protected val bookmarkInteractor: BookmarkFragmentInteractor
|
||||||
get() = _bookmarkInteractor!!
|
get() = _bookmarkInteractor!!
|
||||||
|
@ -97,6 +98,8 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
|
||||||
)
|
)
|
||||||
|
|
||||||
bookmarkView = BookmarkView(view.bookmarkLayout, bookmarkInteractor)
|
bookmarkView = BookmarkView(view.bookmarkLayout, bookmarkInteractor)
|
||||||
|
signInView = SignInView(view.bookmarkLayout, findNavController())
|
||||||
|
signInView.view.visibility = View.GONE
|
||||||
|
|
||||||
viewLifecycleOwner.lifecycle.addObserver(
|
viewLifecycleOwner.lifecycle.addObserver(
|
||||||
BookmarkDeselectNavigationListener(
|
BookmarkDeselectNavigationListener(
|
||||||
|
@ -147,7 +150,9 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
|
||||||
if (currentGuid == BookmarkRoot.Root.id &&
|
if (currentGuid == BookmarkRoot.Root.id &&
|
||||||
requireComponents.backgroundServices.accountManager.authenticatedAccount() == null
|
requireComponents.backgroundServices.accountManager.authenticatedAccount() == null
|
||||||
) {
|
) {
|
||||||
view?.let { SignInView(it.bookmarkLayout, findNavController()) }
|
signInView.view.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
signInView.view.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
initialJob = loadInitialBookmarkFolder(currentGuid)
|
initialJob = loadInitialBookmarkFolder(currentGuid)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class SignInView(
|
||||||
override val containerView: View?
|
override val containerView: View?
|
||||||
get() = container
|
get() = container
|
||||||
|
|
||||||
private val view: MaterialButton = LayoutInflater.from(container.context)
|
val view: MaterialButton = LayoutInflater.from(container.context)
|
||||||
.inflate(R.layout.component_sign_in, container, true)
|
.inflate(R.layout.component_sign_in, container, true)
|
||||||
.findViewById(R.id.bookmark_folders_sign_in)
|
.findViewById(R.id.bookmark_folders_sign_in)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue