Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)

To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
This commit is contained in:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
final class BottomMenuLayerButton: VerticallyAlignedButton {
private var badgeView: UIView?
private let badgeSize = CGSize(width: 12, height: 12)
private let badgeOffset = CGPoint(x: -3, y: 3)
var isBadgeHidden: Bool = true{
didSet {
if oldValue != isBadgeHidden {
updateBadge()
}
}
}
override func layoutSubviews() {
super.layoutSubviews()
imageView.layer.masksToBounds = true
updateBadge()
}
private func updateBadge() {
if isBadgeHidden {
badgeView?.removeFromSuperview()
badgeView = nil
} else {
if badgeView == nil {
badgeView = UIView()
badgeView?.setStyle(.badge)
addSubview(badgeView!)
}
let imageFrame = imageView.frame
badgeView?.frame = CGRect(x:imageFrame.minX + imageFrame.width - badgeSize.width / 2 + badgeOffset.x,
y:imageFrame.minY - badgeSize.height/2 + badgeOffset.y,
width: badgeSize.width,
height: badgeSize.height)
}
}
}