mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 21:33:59 +00:00
[ios] Update design of existence and opening hour confirmation for place page
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
d1f9806901
commit
c616e235a1
@@ -3,7 +3,7 @@ protocol PlacePageHeaderViewProtocol: AnyObject {
|
||||
var isExpandViewHidden: Bool { get set }
|
||||
var isShadowViewHidden: Bool { get set }
|
||||
|
||||
func setTitle(_ title: String?, secondaryTitle: String?, existenceConfirmation: String?)
|
||||
func setTitle(_ title: String?, secondaryTitle: String?)
|
||||
func showShareTrackMenu()
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func setTitle(_ title: String?, secondaryTitle: String?, existenceConfirmation: String? = nil) {
|
||||
func setTitle(_ title: String?, secondaryTitle: String?) {
|
||||
titleText = title
|
||||
secondaryText = secondaryTitle
|
||||
// XCode 13 is not smart enough to detect that title is used below, and requires explicit unwrapped variable.
|
||||
@@ -93,18 +93,6 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol {
|
||||
|
||||
let attributedText = NSMutableAttributedString(string: unwrappedTitle, attributes: titleAttributes)
|
||||
|
||||
// Add existence confirmation if available
|
||||
if let existenceText = existenceConfirmation {
|
||||
let existenceParagraphStyle = NSMutableParagraphStyle()
|
||||
existenceParagraphStyle.paragraphSpacingBefore = 1
|
||||
let existenceAttributes: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.systemFont(ofSize: 11),
|
||||
.foregroundColor: UIColor.blackSecondaryText(),
|
||||
.paragraphStyle: existenceParagraphStyle
|
||||
]
|
||||
attributedText.append(NSAttributedString(string: "\n" + existenceText, attributes: existenceAttributes))
|
||||
}
|
||||
|
||||
guard let unwrappedSecondaryTitle = secondaryTitle else {
|
||||
titleLabel?.attributedText = attributedText
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user