mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
update caption after deleting item
This commit is contained in:
parent
ca30a96451
commit
d805246cb7
|
@ -477,7 +477,7 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
|
|||
return
|
||||
}
|
||||
|
||||
pageViewController.currentItem = mediaGalleryItem
|
||||
pageViewController.setCurrentItem(mediaGalleryItem, direction: .forward, animated: false)
|
||||
pageViewController.willBePresentedAgain()
|
||||
|
||||
// TODO fancy zoom animation
|
||||
|
|
|
@ -44,21 +44,17 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
|||
}
|
||||
|
||||
public var currentItem: MediaGalleryItem! {
|
||||
get {
|
||||
return currentViewController.galleryItemBox.value
|
||||
}
|
||||
set {
|
||||
setCurrentItem(newValue, direction: .forward, animated: false)
|
||||
}
|
||||
return currentViewController.galleryItemBox.value
|
||||
}
|
||||
|
||||
private func setCurrentItem(_ item: MediaGalleryItem, direction: UIPageViewControllerNavigationDirection, animated isAnimated: Bool) {
|
||||
public func setCurrentItem(_ item: MediaGalleryItem, direction: UIPageViewControllerNavigationDirection, animated isAnimated: Bool) {
|
||||
guard let galleryPage = self.buildGalleryPage(galleryItem: item) else {
|
||||
owsFailDebug("unexpetedly unable to build new gallery page")
|
||||
return
|
||||
}
|
||||
|
||||
self.updateTitle(item: item)
|
||||
self.updateCaption(item: item)
|
||||
self.setViewControllers([galleryPage], direction: direction, animated: isAnimated)
|
||||
self.updateFooterBarButtonItems(isPlayingVideo: false)
|
||||
}
|
||||
|
@ -717,6 +713,10 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
|||
updateTitle(item: currentItem)
|
||||
}
|
||||
|
||||
private func updateCaption(item: MediaGalleryItem) {
|
||||
self.currentCaptionView.text = item.captionForDisplay
|
||||
}
|
||||
|
||||
private func updateTitle(item: MediaGalleryItem) {
|
||||
let name = senderName(message: item.message)
|
||||
portraitHeaderNameLabel.text = name
|
||||
|
|
Loading…
Reference in a new issue