mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Update footer when returning to details via Tile view
// FREEBIE
This commit is contained in:
parent
5fdadf5bde
commit
2095cbb0c6
2 changed files with 35 additions and 3 deletions
|
@ -377,11 +377,39 @@ class MediaGalleryViewController: UINavigationController, MediaGalleryDataSource
|
||||||
|
|
||||||
func mediaTileViewController(_ viewController: MediaTileViewController, didTapView tappedView: UIView, mediaGalleryItem: MediaGalleryItem) {
|
func mediaTileViewController(_ viewController: MediaTileViewController, didTapView tappedView: UIView, mediaGalleryItem: MediaGalleryItem) {
|
||||||
if self.fromNavController != nil {
|
if self.fromNavController != nil {
|
||||||
// If from conversation settings view, we've already pushed
|
// If we got to the gallery via conversation settings, present the detail view
|
||||||
|
// on top of the tile view
|
||||||
|
//
|
||||||
|
// == ViewController Schematic ==
|
||||||
|
//
|
||||||
|
// [DetailView] <--,
|
||||||
|
// [TileView] -----'
|
||||||
|
// [ConversationSettingsView]
|
||||||
|
// [ConversationView]
|
||||||
|
//
|
||||||
|
|
||||||
self.presentDetailView(fromViewController: mediaTileViewController, initialDetailItem: mediaGalleryItem, replacingView: tappedView)
|
self.presentDetailView(fromViewController: mediaTileViewController, initialDetailItem: mediaGalleryItem, replacingView: tappedView)
|
||||||
} else {
|
} else {
|
||||||
// If from conversation view
|
// If we got to the gallery via the conversation view, pop the tile view
|
||||||
self.pageViewController!.currentItem = mediaGalleryItem
|
// to return to the detail view
|
||||||
|
//
|
||||||
|
// == ViewController Schematic ==
|
||||||
|
//
|
||||||
|
// [TileView] -----,
|
||||||
|
// [DetailView] <--'
|
||||||
|
// [ConversationView]
|
||||||
|
//
|
||||||
|
|
||||||
|
guard let pageViewController = self.pageViewController else {
|
||||||
|
owsFail("\(logTag) in \(#function) pageeViewController was unexpectedly nil")
|
||||||
|
self.dismissSelf(animated: true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
pageViewController.currentItem = mediaGalleryItem
|
||||||
|
pageViewController.willBePresentedAgain()
|
||||||
|
|
||||||
|
// TODO fancy zoom animation
|
||||||
self.popViewController(animated: true)
|
self.popViewController(animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,10 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
||||||
|
|
||||||
// MARK: View Helpers
|
// MARK: View Helpers
|
||||||
|
|
||||||
|
public func willBePresentedAgain() {
|
||||||
|
updateFooterBarButtonItems(isPlayingVideo: false)
|
||||||
|
}
|
||||||
|
|
||||||
public func wasPresented() {
|
public func wasPresented() {
|
||||||
let currentViewController = self.currentViewController
|
let currentViewController = self.currentViewController
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue