forked from organicmaps/organicmaps-tmp
[iOS] Restore update maps red dot indicator in bottom menu button.
Signed-off-by: vng <viktor.govako@gmail.com>
This commit is contained in:
parent
c43213c24a
commit
9b10eb9d3e
3 changed files with 7 additions and 10 deletions
|
@ -313,8 +313,12 @@ using namespace osm_auth_ios;
|
|||
|
||||
- (void)updateApplicationIconBadgeNumber {
|
||||
auto const number = [self badgeNumber];
|
||||
UIApplication.sharedApplication.applicationIconBadgeNumber = number;
|
||||
BottomTabBarViewController.controller.isApplicationBadgeHidden = number == 0;
|
||||
|
||||
// Delay init because BottomTabBarViewController.controller is null here.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIApplication.sharedApplication setApplicationIconBadgeNumber:number];
|
||||
BottomTabBarViewController.controller.isApplicationBadgeHidden = (number == 0);
|
||||
});
|
||||
}
|
||||
|
||||
- (NSUInteger)badgeNumber {
|
||||
|
|
|
@ -20,7 +20,6 @@ class BottomTabBarPresenter: NSObject {
|
|||
|
||||
extension BottomTabBarPresenter: BottomTabBarPresenterProtocol {
|
||||
func configure() {
|
||||
view?.isLayersBadgeHidden = true
|
||||
}
|
||||
|
||||
func onSearchButtonPressed() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
protocol BottomTabBarViewProtocol: class {
|
||||
var presenter: BottomTabBarPresenterProtocol! { get set }
|
||||
var isHidden: Bool { get }
|
||||
var isLayersBadgeHidden: Bool { get set }
|
||||
var isApplicationBadgeHidden: Bool { get set }
|
||||
}
|
||||
|
||||
|
@ -21,11 +20,6 @@ class BottomTabBarViewController: UIViewController {
|
|||
updateFrame(animated: true)
|
||||
}
|
||||
}
|
||||
var isLayersBadgeHidden: Bool = true {
|
||||
didSet {
|
||||
updateBadge()
|
||||
}
|
||||
}
|
||||
@objc var isApplicationBadgeHidden: Bool = true {
|
||||
didSet {
|
||||
updateBadge()
|
||||
|
@ -111,7 +105,7 @@ class BottomTabBarViewController: UIViewController {
|
|||
}
|
||||
|
||||
private func updateBadge() {
|
||||
downloadBadge.isHidden = isApplicationBadgeHidden && isLayersBadgeHidden
|
||||
downloadBadge.isHidden = isApplicationBadgeHidden
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue