forked from organicmaps/organicmaps
[iOS] Fixed styles in place page after rebase from release-96
This commit is contained in:
parent
d0e9f80a4e
commit
0fb029ad72
15 changed files with 214 additions and 340 deletions
|
@ -66,6 +66,11 @@ class GlobalStyleSheet: IStyleSheet {
|
|||
s.backgroundColor = colors.white
|
||||
}
|
||||
|
||||
theme.add(styleName: "StarRatingView") { (s) -> (Void) in
|
||||
s.onTintColor = colors.ratingYellow
|
||||
s.offTintColor = colors.blackDividers
|
||||
}
|
||||
|
||||
//MARK: Global styles
|
||||
theme.add(styleName: "Divider") { (s) -> (Void) in
|
||||
s.backgroundColor = colors.blackDividers
|
||||
|
|
|
@ -38,6 +38,11 @@ class MapStyleSheet: IStyleSheet {
|
|||
s.shadowOffset = CGSize(width: 0, height: 1)
|
||||
}
|
||||
|
||||
theme.add(styleName: "PPRatingView") { (s) -> (Void) in
|
||||
s.backgroundColor = colors.blackOpaque
|
||||
s.round = true
|
||||
}
|
||||
|
||||
theme.add(styleName: "PPRatingHorrible") { (s) -> (Void) in
|
||||
s.image = "ic_24px_rating_horrible"
|
||||
s.tintColor = colors.ratingRed
|
||||
|
@ -63,6 +68,11 @@ class MapStyleSheet: IStyleSheet {
|
|||
s.tintColor = colors.ratingGreen
|
||||
}
|
||||
|
||||
theme.add(styleName: "PPButton", from: "FlatNormalTransButtonBig") { (s) -> (Void) in
|
||||
s.borderColor = colors.linkBlue
|
||||
s.borderWidth = 1
|
||||
}
|
||||
|
||||
theme.add(styleName: "ButtonZoomIn") { (s) -> (Void) in
|
||||
s.mwmImage = "btn_zoom_in"
|
||||
}
|
||||
|
@ -123,7 +133,7 @@ class MapStyleSheet: IStyleSheet {
|
|||
|
||||
theme.add(styleName: "PPTitlePopularView") { (s) -> (Void) in
|
||||
s.backgroundColor = colors.linkBlueHighlighted
|
||||
s.round = true
|
||||
s.cornerRadius = 10
|
||||
}
|
||||
|
||||
theme.add(styleName: "RouteBasePreview") { (s) -> (Void) in
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
extension StarRatingView {
|
||||
@objc override func applyTheme() {
|
||||
if styleName.isEmpty {
|
||||
styleName = "StarRatingView"
|
||||
}
|
||||
for style in StyleManager.shared.getStyle(styleName)
|
||||
where !style.isEmpty && !style.hasExclusion(view: self) {
|
||||
StarRatingViewViewRenderer.render(self, style: style)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class StarRatingViewViewRenderer {
|
||||
class func render(_ control: StarRatingView, style: Style) {
|
||||
if let onTintColor = style.onTintColor {
|
||||
control.activeColor = onTintColor
|
||||
}
|
||||
if let offTintColor = style.offTintColor {
|
||||
control.inactiveColor = offTintColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
116616F223F597AF003CB923 /* StarRatingViewRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 116616F123F597AF003CB923 /* StarRatingViewRenderer.swift */; };
|
||||
1185C52C23BB53A7004BF349 /* UIViewControllerRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1185C52B23BB53A7004BF349 /* UIViewControllerRenderer.swift */; };
|
||||
1DA7908820762CEB008BDD6B /* libopen_location_code.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DA7908920762CEB008BDD6B /* libopen_location_code.a */; };
|
||||
1DFA2F6A20D3B57400FB2C66 /* UIColor+PartnerColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DFA2F6920D3B57400FB2C66 /* UIColor+PartnerColor.m */; };
|
||||
|
@ -869,6 +870,7 @@
|
|||
|
||||
/* Begin PBXFileReference section */
|
||||
0B07BBB5C2EFC6F60EF51BC8 /* Pods-MAPS.ME.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MAPS.ME.debug.xcconfig"; path = "Target Support Files/Pods-MAPS.ME/Pods-MAPS.ME.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
116616F123F597AF003CB923 /* StarRatingViewRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StarRatingViewRenderer.swift; sourceTree = "<group>"; };
|
||||
1185C52B23BB53A7004BF349 /* UIViewControllerRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerRenderer.swift; sourceTree = "<group>"; };
|
||||
166595280BE641CF8ADE2209 /* Pods-MAPS.ME.production full.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MAPS.ME.production full.xcconfig"; path = "Target Support Files/Pods-MAPS.ME/Pods-MAPS.ME.production full.xcconfig"; sourceTree = "<group>"; };
|
||||
1D3623240D0F684500981E51 /* MapsAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapsAppDelegate.h; sourceTree = "<group>"; };
|
||||
|
@ -3677,6 +3679,7 @@
|
|||
99169D7223D06B390006A9CA /* RatingSummaryViewRenderer.swift */,
|
||||
9974CA3923E05B9C003FE824 /* RatingViewRenderer.swift */,
|
||||
999FC12E23ABD53300B0E6F9 /* TabViewRenderer.swift */,
|
||||
116616F123F597AF003CB923 /* StarRatingViewRenderer.swift */,
|
||||
994AEBEB23AB763C0079B81F /* UIActivityIndicatorRenderer.swift */,
|
||||
994AEBEA23AB763C0079B81F /* UIButtonRenderer.swift */,
|
||||
994AEBF723AB763C0079B81F /* UIBarButtonItemRenderer.swift */,
|
||||
|
@ -5473,6 +5476,7 @@
|
|||
348A8DF81F66775A00D83026 /* RatingViewDelegate.swift in Sources */,
|
||||
4716EABA21A325310029B886 /* IPaidRouteStatistics.swift in Sources */,
|
||||
3490D2E11CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */,
|
||||
116616F223F597AF003CB923 /* StarRatingViewRenderer.swift in Sources */,
|
||||
47F4F21523A6F06F0022FD56 /* AvailableMapsDataSource.swift in Sources */,
|
||||
995739062355CAC40019AEE7 /* ImageViewCrossDisolve.swift in Sources */,
|
||||
994AEC1F23AB763C0079B81F /* UITextFieldRenderer.swift in Sources */,
|
||||
|
|
|
@ -55,8 +55,7 @@ class HotelFacilitiesViewController: UIViewController {
|
|||
private func addMoreButton() {
|
||||
let button = UIButton()
|
||||
button.setTitle(L("booking_show_more"), for: .normal)
|
||||
button.titleLabel?.font = UIFont.regular16()
|
||||
button.setTitleColor(UIColor.linkBlue(), for: .normal)
|
||||
button.styleName = "MoreButton"
|
||||
button.heightAnchor.constraint(equalToConstant: 44).isActive = true
|
||||
stackView.addArrangedSubview(button)
|
||||
button.addTarget(self, action: #selector(onMoreButton(_:)), for: .touchUpInside)
|
||||
|
|
|
@ -92,8 +92,7 @@ class HotelReviewsViewController: UIViewController {
|
|||
private func addMoreButton() {
|
||||
let button = UIButton()
|
||||
button.setTitle(L("reviews_on_bookingcom"), for: .normal)
|
||||
button.titleLabel?.font = UIFont.regular16()
|
||||
button.setTitleColor(UIColor.linkBlue(), for: .normal)
|
||||
button.styleName = "MoreButton"
|
||||
button.heightAnchor.constraint(equalToConstant: 44).isActive = true
|
||||
stackView.addArrangedSubview(button)
|
||||
button.addTarget(self, action: #selector(onMoreButton(_:)), for: .touchUpInside)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -83,4 +83,9 @@ class PlacePageBookmarkViewController: UIViewController {
|
|||
@IBAction func onEdit(_ sender: UIButton) {
|
||||
delegate?.bookmarkDidPressEdit()
|
||||
}
|
||||
|
||||
override func applyTheme() {
|
||||
super.applyTheme()
|
||||
updateViews()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@ class InfoItemViewController: UIViewController {
|
|||
didSet {
|
||||
switch style {
|
||||
case .regular:
|
||||
imageView?.mwm_coloring = .black
|
||||
infoLabel?.textColor = UIColor.blackPrimaryText()
|
||||
imageView?.styleName = "MWMBlack"
|
||||
infoLabel?.styleName = "blackPrimaryText"
|
||||
case .link:
|
||||
imageView?.mwm_coloring = .blue
|
||||
infoLabel?.textColor = UIColor.linkBlue()
|
||||
imageView?.styleName = "MWMBlue"
|
||||
infoLabel?.styleName = "linkBlueText"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ class InfoItemViewController: UIViewController {
|
|||
super.viewDidLoad()
|
||||
|
||||
if style == .link {
|
||||
imageView.mwm_coloring = .blue
|
||||
infoLabel.textColor = UIColor.linkBlue()
|
||||
imageView.styleName = "MWMBlue"
|
||||
infoLabel.styleName = "linkBlueText"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -176,8 +176,7 @@ class PlacePageInfoViewController: UIViewController {
|
|||
private func createLocalAdsButton(_ title: String) -> UIButton {
|
||||
let button = UIButton()
|
||||
button.setTitle(title, for: .normal)
|
||||
button.titleLabel?.font = UIFont.regular17()
|
||||
button.setTitleColor(UIColor.linkBlue(), for: .normal)
|
||||
button.styleName = "FlatNormalTransButtonBig"
|
||||
button.heightAnchor.constraint(equalToConstant: 44).isActive = true
|
||||
stackView.addArrangedSubview(button)
|
||||
button.addTarget(self, action: #selector(onLocalAdsButton(_:)), for: .touchUpInside)
|
||||
|
|
|
@ -99,12 +99,10 @@ class PlacePagePreviewViewController: UIViewController {
|
|||
reviewsLabel.text = String(format:L("placepage_summary_rating_description"), ugcData.ratingsCount)
|
||||
} else {
|
||||
if ugcData.isUpdateEmpty {
|
||||
ratingSummaryView.noValueImage = UIImage(named: "ic_12px_rating_normal")
|
||||
ratingSummaryView.noValueColor = UIColor.blackSecondaryText()
|
||||
ratingSummaryView.setStyleAndApply("RatingSummaryView12")
|
||||
reviewsLabel.text = ugcData.reviews.count == 0 ? L("placepage_no_reviews") : ""
|
||||
} else {
|
||||
ratingSummaryView.noValueImage = UIImage(named: "ic_12px_radio_on")
|
||||
ratingSummaryView.noValueColor = UIColor.linkBlue()
|
||||
ratingSummaryView.setStyleAndApply("RatingSummaryView12User")
|
||||
reviewsLabel.text = L("placepage_reviewed")
|
||||
addReviewButton.isHidden = true
|
||||
}
|
||||
|
|
|
@ -75,8 +75,7 @@ final class PlacePageReviewsViewController: UIViewController {
|
|||
private func createMoreReviewsButton() {
|
||||
let button = UIButton()
|
||||
button.setTitle(L("placepage_more_reviews_button"), for: .normal)
|
||||
button.titleLabel?.font = UIFont.regular17()
|
||||
button.setTitleColor(UIColor.linkBlue(), for: .normal)
|
||||
button.styleName = "MoreButton"
|
||||
button.heightAnchor.constraint(equalToConstant: 44).isActive = true
|
||||
stackView.addArrangedSubview(button)
|
||||
button.addTarget(self, action: #selector(onMoreReviewsButton), for: .touchUpInside)
|
||||
|
|
|
@ -304,7 +304,7 @@ enum PlacePageState {
|
|||
}
|
||||
|
||||
let bgView = UIView()
|
||||
bgView.backgroundColor = UIColor.white()
|
||||
bgView.styleName = "Background"
|
||||
stackView.insertSubview(bgView, at: 0)
|
||||
bgView.alignToSuperview()
|
||||
scrollView.decelerationRate = .fast
|
||||
|
|
|
@ -4,14 +4,7 @@ class RatingSummaryViewController: UIViewController {
|
|||
@IBOutlet var ratingSummaryView: RatingSummaryView!
|
||||
@IBOutlet var ratingViews: [UIView]!
|
||||
@IBOutlet var ratingLabels: [UILabel]!
|
||||
@IBOutlet var starViews: [StarRatingView]! {
|
||||
didSet {
|
||||
starViews.forEach {
|
||||
$0.activeColor = UIColor.yellow
|
||||
$0.inactiveColor = UIColor.blackDividers()
|
||||
}
|
||||
}
|
||||
}
|
||||
@IBOutlet var starViews: [StarRatingView]!
|
||||
|
||||
var ugcData: UgcData? {
|
||||
didSet {
|
||||
|
|
|
@ -23,10 +23,7 @@ final class ReviewRatingView: UIView {
|
|||
|
||||
extension ReviewRatingView {
|
||||
func defaultConfig() {
|
||||
nameLabel.font = UIFont.regular14()
|
||||
nameLabel.textColor = UIColor.blackSecondaryText()
|
||||
starRatingView.activeColor = UIColor.ratingYellow()
|
||||
starRatingView.inactiveColor = UIColor.blackDividers()
|
||||
nameLabel.styleName = "regular14:blackSecondaryText"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,4 +56,9 @@ class WikiDescriptionViewController: UIViewController {
|
|||
@IBAction func onMore(_ sender: UIButton) {
|
||||
delegate?.didPressMore()
|
||||
}
|
||||
|
||||
override func applyTheme() {
|
||||
super.applyTheme()
|
||||
updateDescription()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue