Skip to content

Commit

Permalink
Add updateMapToolbarItems
Browse files Browse the repository at this point in the history
  • Loading branch information
nighthawk committed Aug 31, 2022
1 parent e5934c2 commit ad4eadb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/TGCardViewController/TGCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1617,13 +1617,19 @@ extension TGCardViewController {
private func deviceIsiPhoneX() -> Bool { view.window?.safeAreaInsets.bottom ?? 0 > 0 }

private func fadeMapFloatingViews(_ fade: Bool, animated: Bool) {
topFloatingViewWrapper.isHidden = false
bottomFloatingViewWrapper.isHidden = false

UIView.animate(withDuration: animated ? 0.25: 0) {
self.topFloatingViewWrapper.accessibilityElements = fade ? [] : nil
self.topFloatingViewWrapper.alpha = fade ? 0 : 1
self.topFloatingViewWrapper.isUserInteractionEnabled = !fade
self.bottomFloatingViewWrapper.accessibilityElements = fade ? [] : nil
self.bottomFloatingViewWrapper.alpha = fade ? 0 : 1
self.bottomFloatingViewWrapper.isUserInteractionEnabled = !fade
} completion: { _ in
self.topFloatingViewWrapper.isHidden = fade
self.bottomFloatingViewWrapper.isHidden = false
}
}

Expand Down Expand Up @@ -1678,6 +1684,10 @@ extension TGCardViewController {
apply(on: bottomFloatingViewWrapper)
}

public func updateMapToolbarItems() {
updateFloatingViewsContent(card: topCard)
}

private func updateFloatingViewsContent(card: TGCard?) {
var topViews: [UIView] = []
var bottomViews: [UIView] = []
Expand Down

0 comments on commit ad4eadb

Please sign in to comment.