[iOS] Fixed RatingView style in place page

https://jira.mail.ru/browse/MAPSME-13180
This commit is contained in:
Alexander Boriskov 2020-02-18 16:56:26 +03:00 committed by Aleksandr Zatsepin
parent 91cac68f57
commit af509d41bf
3 changed files with 18 additions and 6 deletions

View file

@ -168,12 +168,26 @@ class GlobalStyleSheet: IStyleSheet {
s.shadowOffset = CGSize(width: 0, height: 0)
}
theme.add(styleName: "RatingView") { (s) -> (Void) in
theme.add(styleName: "RatingView12") { (s) -> (Void) in
var settings = RatingViewSettings()
settings.filledColor = colors.ratingYellow
settings.emptyColor = colors.blackDividers
settings.textFonts[.right] = fonts.regular10
settings.textColors[.right] = colors.blackSecondaryText
settings.textFonts[.top] = fonts.regular10
settings.textColors[.top] = colors.blackSecondaryText
settings.starSize = 12
settings.starsCount = 5
s.ratingViewSettings = settings
s.borderWidth = 0
}
theme.add(styleName: "RatingView20") { (s) -> (Void) in
var settings = RatingViewSettings()
settings.filledColor = colors.ratingYellow
settings.emptyColor = colors.blackDividers
settings.textFonts[.top] = fonts.regular10
settings.textColors[.top] = colors.blackSecondaryText
settings.starSize = 20
settings.starsCount = 5
s.ratingViewSettings = settings
s.borderWidth = 0
}

View file

@ -1,9 +1,6 @@
import Foundation
extension RatingView {
@objc override func applyTheme() {
if styleName.isEmpty {
styleName = "RatingView"
}
for style in StyleManager.shared.getStyle(styleName)
where !style.isEmpty && !style.hasExclusion(view: self) {
RatingViewRenderer.render(self, style: style)

View file

@ -36,6 +36,7 @@
<userDefinedRuntimeAttribute type="number" keyPath="minTouchRating">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="RatingView20"/>
</userDefinedRuntimeAttributes>
</view>
</subviews>