Reset focus when returning to the app from another app or the safari view controller. Issue #1963
This commit is contained in:
parent
6f29b21ddc
commit
31f3487d7a
@ -21,6 +21,10 @@ class RootSplitViewController: UISplitViewController {
|
|||||||
return .slide
|
return .slide
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
|
coordinator.resetFocus()
|
||||||
|
}
|
||||||
|
|
||||||
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||||
self.coordinator.configurePanelMode(for: size)
|
self.coordinator.configurePanelMode(for: size)
|
||||||
super.viewWillTransition(to: size, with: coordinator)
|
super.viewWillTransition(to: size, with: coordinator)
|
||||||
|
@ -405,6 +405,14 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||||||
wasRootSplitViewControllerCollapsed = rootSplitViewController.isCollapsed
|
wasRootSplitViewControllerCollapsed = rootSplitViewController.isCollapsed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func resetFocus() {
|
||||||
|
if currentArticle != nil {
|
||||||
|
masterTimelineViewController?.focus()
|
||||||
|
} else {
|
||||||
|
masterFeedViewController?.focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func selectFirstUnreadInAllUnread() {
|
func selectFirstUnreadInAllUnread() {
|
||||||
markExpanded(SmartFeedsController.shared)
|
markExpanded(SmartFeedsController.shared)
|
||||||
self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.unreadFeed) {
|
self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.unreadFeed) {
|
||||||
|
@ -66,7 +66,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||||
appDelegate.resumeDatabaseProcessingIfNecessary()
|
appDelegate.resumeDatabaseProcessingIfNecessary()
|
||||||
appDelegate.prepareAccountsForForeground()
|
appDelegate.prepareAccountsForForeground()
|
||||||
self.coordinator.configurePanelMode(for: window!.frame.size)
|
coordinator.configurePanelMode(for: window!.frame.size)
|
||||||
|
coordinator.resetFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user