Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
123
iphone/Maps/Core/Theme/MapStyleSheet.swift
Normal file
123
iphone/Maps/Core/Theme/MapStyleSheet.swift
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
enum MapStyleSheet: String, CaseIterable {
|
||||
case mapMenuButtonDisabled = "MenuButtonDisabled"
|
||||
case mapMenuButtonEnabled = "MenuButtonEnabled"
|
||||
case mapStreetNameBackgroundView = "StreetNameBackgroundView"
|
||||
case mapButtonZoomIn = "ButtonZoomIn"
|
||||
case mapButtonZoomOut = "ButtonZoomOut"
|
||||
case mapButtonPending = "ButtonPending"
|
||||
case mapButtonGetPosition = "ButtonGetPosition"
|
||||
case mapButtonFollow = "ButtonFollow"
|
||||
case mapButtonFollowAndRotate = "ButtonFollowAndRotate"
|
||||
case mapButtonMapBookmarks = "ButtonMapBookmarks"
|
||||
case mapPromoDiscoveryButton = "PromoDiscroveryButton"
|
||||
case mapButtonBookmarksBack = "ButtonBookmarksBack"
|
||||
case mapButtonBookmarksBackOpaque = "ButtonBookmarksBackOpaque"
|
||||
case mapFirstTurnView = "FirstTurnView"
|
||||
case mapSecondTurnView = "SecondTurnView"
|
||||
case mapAutoupdateView = "MapAutoupdateView"
|
||||
case mapGuidesNavigationBar = "GuidesNavigationBar"
|
||||
}
|
||||
|
||||
extension MapStyleSheet: IStyleSheet {
|
||||
func styleResolverFor(colors: IColors, fonts: IFonts) -> Theme.StyleResolver {
|
||||
switch self {
|
||||
case .mapMenuButtonDisabled:
|
||||
return .add { s in
|
||||
s.fontColor = colors.blackSecondaryText
|
||||
s.font = fonts.regular10
|
||||
s.backgroundColor = colors.clear
|
||||
s.borderColor = colors.clear
|
||||
s.borderWidth = 0
|
||||
s.cornerRadius = .buttonDefaultSmall
|
||||
}
|
||||
case .mapMenuButtonEnabled:
|
||||
return .add { s in
|
||||
s.fontColor = colors.linkBlue
|
||||
s.font = fonts.regular10
|
||||
s.backgroundColor = colors.linkBlue
|
||||
s.borderColor = colors.linkBlue
|
||||
s.borderWidth = 2
|
||||
s.cornerRadius = .buttonDefaultSmall
|
||||
}
|
||||
case .mapStreetNameBackgroundView:
|
||||
return .add { s in
|
||||
s.backgroundColor = colors.white
|
||||
s.shadowRadius = 2
|
||||
s.shadowColor = UIColor(0, 0, 0, alpha26)
|
||||
s.shadowOpacity = 1
|
||||
s.shadowOffset = CGSize(width: 0, height: 1)
|
||||
}
|
||||
case .mapButtonZoomIn:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_zoom_in"
|
||||
}
|
||||
case .mapButtonZoomOut:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_zoom_out"
|
||||
}
|
||||
case .mapButtonPending:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_pending"
|
||||
}
|
||||
case .mapButtonGetPosition:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_get_position"
|
||||
}
|
||||
case .mapButtonFollow:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_follow"
|
||||
}
|
||||
case .mapButtonFollowAndRotate:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_follow_and_rotate"
|
||||
}
|
||||
case .mapButtonMapBookmarks:
|
||||
return .add { s in
|
||||
s.mwmImage = "ic_routing_bookmark"
|
||||
}
|
||||
case .mapPromoDiscoveryButton:
|
||||
return .add { s in
|
||||
s.mwmImage = "promo_discovery_button"
|
||||
}
|
||||
case .mapButtonBookmarksBack:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_back"
|
||||
}
|
||||
case .mapButtonBookmarksBackOpaque:
|
||||
return .add { s in
|
||||
s.mwmImage = "btn_back_opaque"
|
||||
}
|
||||
case .mapFirstTurnView:
|
||||
return .add { s in
|
||||
s.backgroundColor = colors.linkBlue
|
||||
s.cornerRadius = .buttonSmall
|
||||
s.shadowRadius = 2
|
||||
s.shadowColor = colors.shadow
|
||||
s.shadowOpacity = 0.2
|
||||
s.shadowOffset = CGSize(width: 0, height: 2)
|
||||
}
|
||||
case .mapSecondTurnView:
|
||||
return .addFrom(Self.mapFirstTurnView) { s in
|
||||
s.backgroundColor = colors.white
|
||||
s.shadowColor = colors.blackPrimaryText
|
||||
}
|
||||
case .mapAutoupdateView:
|
||||
return .add { s in
|
||||
s.shadowOffset = CGSize(width: 0, height: 3)
|
||||
s.shadowRadius = 6
|
||||
s.cornerRadius = .buttonSmall
|
||||
s.shadowOpacity = 1
|
||||
s.backgroundColor = colors.white
|
||||
}
|
||||
case .mapGuidesNavigationBar:
|
||||
return .add { s in
|
||||
s.barTintColor = colors.white
|
||||
s.tintColor = colors.linkBlue
|
||||
s.backgroundImage = UIImage()
|
||||
s.shadowImage = UIImage()
|
||||
s.font = fonts.regular18
|
||||
s.fontColor = colors.blackPrimaryText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue