Skip to content

Commit

Permalink
Merge pull request #2183 from mapbox/1ec5-status-hide-2180
Browse files Browse the repository at this point in the history
Fix auto-hiding status view
  • Loading branch information
1ec5 authored Jul 23, 2019
2 parents 7ae6e4e + 55dad5f commit b1c7f6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master

* Fixed an issue where InstructionsBannerView remained the same color after switching to a day or night style. ([#2178](https://github.com/mapbox/mapbox-navigation-ios/pull/2178))
* Fixed an issue where the “iPhone Volume Low” banner would persist until replaced by another banner about simulation or rerouting. ([#2183](https://github.com/mapbox/mapbox-navigation-ios/pull/2183))
* Designables no longer crash and fail to render in Interface Builder when the application target links to this SDK via CocoaPods. ([#2179](https://github.com/mapbox/mapbox-navigation-ios/pull/2179))
* Fixed a crash that could occur when statically initializing a `Style` if the SDK was installed using CocoaPods. ([#2179](https://github.com/mapbox/mapbox-navigation-ios/pull/2179))

Expand Down
10 changes: 7 additions & 3 deletions MapboxNavigation/StatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,21 @@ public class StatusView: UIControl {
}

let animate = {
guard !self.isHidden, self.isCurrentlyVisible else { return }

let fireTime = DispatchTime.now() + delay
DispatchQueue.main.asyncAfter(deadline: fireTime, execute: {
guard !self.isHidden, self.isCurrentlyVisible else { return }

self.activityIndicatorView.stopAnimating()
UIView.defaultAnimation(0.3, delay: 0, animations: hide, completion: { _ in
self.isCurrentlyVisible = false
})
})
}

animated ? animate() : hide()
if animated {
animate()
} else {
hide()
}
}
}

0 comments on commit b1c7f6c

Please sign in to comment.