diff --git a/iphone/Chart/Chart/ChartData/ChartData.swift b/iphone/Chart/Chart/ChartData/ChartData.swift
index 2750fa3612..6e1ca3226a 100644
--- a/iphone/Chart/Chart/ChartData/ChartData.swift
+++ b/iphone/Chart/Chart/ChartData/ChartData.swift
@@ -6,8 +6,8 @@ public enum ChartType {
}
public enum ChartLineType: String {
- case line = "line"
- case lineArea = "lineArea"
+ case line
+ case lineArea
}
public protocol ChartFormatter {
@@ -26,7 +26,6 @@ public protocol ChartData {
public protocol ChartLine {
var values: [ChartValue] { get }
- var name: String { get }
var color: UIColor { get }
var type: ChartLineType { get }
}
diff --git a/iphone/Chart/Chart/ChartData/ChartPresentationLine.swift b/iphone/Chart/Chart/ChartData/ChartPresentationLine.swift
index 897058baa9..e31abcbece 100644
--- a/iphone/Chart/Chart/ChartData/ChartPresentationLine.swift
+++ b/iphone/Chart/Chart/ChartData/ChartPresentationLine.swift
@@ -11,7 +11,6 @@ final class ChartPresentationLine {
var values: [ChartValue] { chartLine.values }
var color: UIColor { chartLine.color }
- var name: String { chartLine.name }
var type: ChartLineType { chartLine.type }
init(_ chartLine: ChartLine) {
diff --git a/iphone/Chart/Chart/Views/ChartInfo/ChartInfoView.swift b/iphone/Chart/Chart/Views/ChartInfo/ChartInfoView.swift
index 530e340c27..00bc321445 100644
--- a/iphone/Chart/Chart/Views/ChartInfo/ChartInfoView.swift
+++ b/iphone/Chart/Chart/Views/ChartInfo/ChartInfoView.swift
@@ -1,7 +1,6 @@
import UIKit
struct ChartLineInfo {
- let name: String
let color: UIColor
let point: CGPoint
let formattedValue: String
diff --git a/iphone/Chart/Chart/Views/ChartView.swift b/iphone/Chart/Chart/Views/ChartView.swift
index fc2ba88ca5..19ee63daf0 100644
--- a/iphone/Chart/Chart/Views/ChartView.swift
+++ b/iphone/Chart/Chart/Views/ChartView.swift
@@ -121,6 +121,13 @@ public class ChartView: UIView {
}
}
+ public var isChartViewInfoHidden: Bool = false {
+ didSet {
+ chartInfoView.isHidden = isChartViewInfoHidden
+ chartInfoView.isUserInteractionEnabled = !isChartViewInfoHidden
+ }
+ }
+
public typealias OnSelectedPointChangedClosure = (_ px: CGFloat) -> Void
public var onSelectedPointChanged: OnSelectedPointChangedClosure?
@@ -332,11 +339,11 @@ extension ChartView: ChartInfoViewDelegate {
}
func chartInfoView(_ view: ChartInfoView, infoAtPointX pointX: CGFloat) -> (String, [ChartLineInfo])? {
- let p = convert(CGPoint(x: pointX, y: 0), from: view)
+ let p = convert(CGPoint(x: pointX, y: .zero), from: view)
let x = (p.x / bounds.width) * CGFloat(xAxisView.upperBound - xAxisView.lowerBound) + CGFloat(xAxisView.lowerBound)
let x1 = floor(x)
let x2 = ceil(x)
- guard Int(x1) < chartData.labels.count && x >= 0 else { return nil }
+ guard !pointX.isZero, Int(x1) < chartData.labels.count && x >= 0 else { return nil }
let label = chartData.labelAt(x)
var result: [ChartLineInfo] = []
@@ -352,8 +359,7 @@ extension ChartView: ChartInfoViewDelegate {
CGFloat(yAxisView.upperBound - yAxisView.lowerBound))
let v = round(dx * CGFloat(y2 - y1)) + CGFloat(y1)
- result.append(ChartLineInfo(name: line.name,
- color: line.color,
+ result.append(ChartLineInfo(color: line.color,
point: chartsContainerView.convert(CGPoint(x: p.x, y: py), to: view),
formattedValue: chartData.formatter.yAxisString(from: Double(v))))
}
diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileBuilder.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileBuilder.swift
index 54efc864bb..8e9e166416 100644
--- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileBuilder.swift
+++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileBuilder.swift
@@ -4,15 +4,12 @@ class ElevationProfileBuilder {
static func build(trackInfo: TrackInfo,
elevationProfileData: ElevationProfileData?,
delegate: ElevationProfileViewControllerDelegate?) -> ElevationProfileViewController {
- let storyboard = UIStoryboard.instance(.placePage)
- let viewController = storyboard.instantiateViewController(ofType: ElevationProfileViewController.self);
+ let viewController = ElevationProfileViewController();
let presenter = ElevationProfilePresenter(view: viewController,
trackInfo: trackInfo,
profileData: elevationProfileData,
delegate: delegate)
-
viewController.presenter = presenter
-
return viewController
}
}
diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileDescriptionCell.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileDescriptionCell.swift
index d5eade28ee..e39a36552b 100644
--- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileDescriptionCell.swift
+++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileDescriptionCell.swift
@@ -1,18 +1,82 @@
-class ElevationProfileDescriptionCell: UICollectionViewCell {
- @IBOutlet private var titleLabel: UILabel!
- @IBOutlet private var valueLabel: UILabel!
- @IBOutlet var imageView: UIImageView!
-
- func configure(title: String, value: String, imageName: String) {
- titleLabel.text = title
+final class ElevationProfileDescriptionCell: UICollectionViewCell {
+
+ private enum Constants {
+ static let insets = UIEdgeInsets(top: 2, left: 0, bottom: -2, right: 0)
+ static let valueSpacing: CGFloat = 8.0
+ static let imageSize: CGSize = CGSize(width: 20, height: 20)
+ }
+
+ private let valueLabel = UILabel()
+ private let subtitleLabel = UILabel()
+ private let imageView = UIImageView()
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ setupViews()
+ layoutViews()
+ }
+
+ @available(*, unavailable)
+ required init?(coder: NSCoder) {
+ super.init(coder: coder)
+ setupViews()
+ layoutViews()
+ }
+
+ private func setupViews() {
+ valueLabel.font = .medium14()
+ valueLabel.styleName = "blackSecondaryText"
+ valueLabel.numberOfLines = 1
+ valueLabel.minimumScaleFactor = 0.1
+ valueLabel.adjustsFontSizeToFitWidth = true
+ valueLabel.allowsDefaultTighteningForTruncation = true
+
+ subtitleLabel.font = .regular10()
+ subtitleLabel.styleName = "blackSecondaryText"
+ subtitleLabel.numberOfLines = 1
+ subtitleLabel.minimumScaleFactor = 0.1
+ subtitleLabel.adjustsFontSizeToFitWidth = true
+ subtitleLabel.allowsDefaultTighteningForTruncation = true
+
+ imageView.contentMode = .scaleAspectFit
+ imageView.styleName = "MWMBlack"
+ }
+
+ private func layoutViews() {
+ contentView.addSubview(imageView)
+ contentView.addSubview(valueLabel)
+ contentView.addSubview(subtitleLabel)
+ imageView.translatesAutoresizingMaskIntoConstraints = false
+ valueLabel.translatesAutoresizingMaskIntoConstraints = false
+ subtitleLabel.translatesAutoresizingMaskIntoConstraints = false
+
+ NSLayoutConstraint.activate([
+ imageView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: Constants.insets.top),
+ imageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
+ imageView.widthAnchor.constraint(equalToConstant: Constants.imageSize.width),
+ imageView.heightAnchor.constraint(equalToConstant: Constants.imageSize.height),
+
+ valueLabel.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: Constants.valueSpacing),
+ valueLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
+ valueLabel.centerYAnchor.constraint(equalTo: imageView.centerYAnchor),
+
+ subtitleLabel.topAnchor.constraint(equalTo: imageView.bottomAnchor),
+ subtitleLabel.leadingAnchor.constraint(equalTo: imageView.leadingAnchor),
+ subtitleLabel.bottomAnchor.constraint(lessThanOrEqualTo: contentView.bottomAnchor, constant: Constants.insets.bottom)
+ ])
+ subtitleLabel.setContentHuggingPriority(.defaultHigh, for: .vertical)
+ }
+
+ func configure(subtitle: String, value: String, imageName: String) {
+ subtitleLabel.text = subtitle
valueLabel.text = value
imageView.image = UIImage(named: imageName)
}
-
+
override func prepareForReuse() {
super.prepareForReuse()
- titleLabel.text = ""
valueLabel.text = ""
+ subtitleLabel.text = ""
imageView.image = nil
}
}
diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift
index ec18a1f77b..585ae633a5 100644
--- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift
+++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift
@@ -3,6 +3,7 @@ import CoreApi
protocol ElevationProfilePresenterProtocol: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
func configure()
+ func update(trackInfo: TrackInfo, profileData: ElevationProfileData?)
func onDifficultyButtonPressed()
func onSelectedPointChanged(_ point: CGFloat)
@@ -21,13 +22,14 @@ fileprivate struct DescriptionsViewModel {
final class ElevationProfilePresenter: NSObject {
private weak var view: ElevationProfileViewProtocol?
- private let trackInfo: TrackInfo
- private let profileData: ElevationProfileData?
+ private var trackInfo: TrackInfo
+ private var profileData: ElevationProfileData?
private let delegate: ElevationProfileViewControllerDelegate?
+ private let bookmarkManager: BookmarksManager = .shared()
private let cellSpacing: CGFloat = 8
- private let descriptionModels: [DescriptionsViewModel]
- private let chartData: ElevationProfileChartData?
+ private var descriptionModels: [DescriptionsViewModel]
+ private var chartData: ElevationProfileChartData?
private let formatter: ElevationProfileFormatter
init(view: ElevationProfileViewProtocol,
@@ -36,17 +38,18 @@ final class ElevationProfilePresenter: NSObject {
formatter: ElevationProfileFormatter = ElevationProfileFormatter(),
delegate: ElevationProfileViewControllerDelegate?) {
self.view = view
+ self.delegate = delegate
+ self.formatter = formatter
self.trackInfo = trackInfo
self.profileData = profileData
- self.delegate = delegate
if let profileData {
self.chartData = ElevationProfileChartData(profileData)
- } else {
- self.chartData = nil
}
- self.formatter = formatter
+ self.descriptionModels = Self.descriptionModels(for: trackInfo)
+ }
- descriptionModels = [
+ private static func descriptionModels(for trackInfo: TrackInfo) -> [DescriptionsViewModel] {
+ [
DescriptionsViewModel(title: L("elevation_profile_ascent"), value: trackInfo.ascent, imageName: "ic_em_ascent_24"),
DescriptionsViewModel(title: L("elevation_profile_descent"), value: trackInfo.descent, imageName: "ic_em_descent_24"),
DescriptionsViewModel(title: L("elevation_profile_max_elevation"), value: trackInfo.maxElevation, imageName: "ic_em_max_attitude_24"),
@@ -55,41 +58,39 @@ final class ElevationProfilePresenter: NSObject {
}
deinit {
- BookmarksManager.shared().resetElevationActivePointChanged()
- BookmarksManager.shared().resetElevationMyPositionChanged()
+ bookmarkManager.resetElevationActivePointChanged()
+ bookmarkManager.resetElevationMyPositionChanged()
}
}
extension ElevationProfilePresenter: ElevationProfilePresenterProtocol {
+ func update(trackInfo: TrackInfo, profileData: ElevationProfileData?) {
+ self.profileData = profileData
+ if let profileData {
+ self.chartData = ElevationProfileChartData(profileData)
+ } else {
+ self.chartData = nil
+ }
+ descriptionModels = Self.descriptionModels(for: trackInfo)
+ configure()
+ }
+
func configure() {
- guard let profileData, let chartData else {
+ let kMinPointsToDraw = 3
+ guard let profileData, let chartData, chartData.points.count >= kMinPointsToDraw else {
view?.isChartViewHidden = true
- view?.isDifficultyHidden = true
- view?.isExtendedDifficultyLabelHidden = true
- view?.isBottomPanelHidden = true
return
}
view?.isChartViewHidden = false
+ view?.setChartData(ChartPresentationData(chartData, formatter: formatter))
+ view?.reloadDescription()
- if profileData.difficulty != .disabled {
- view?.isDifficultyHidden = false
- view?.setDifficulty(profileData.difficulty)
- } else {
- view?.isDifficultyHidden = true
- }
-
- view?.isBottomPanelHidden = profileData.difficulty == .disabled
- view?.isExtendedDifficultyLabelHidden = true
-
- let presentationData = ChartPresentationData(chartData, formatter: formatter)
- view?.setChartData(presentationData)
view?.setActivePoint(profileData.activePoint)
view?.setMyPosition(profileData.myPosition)
-
- BookmarksManager.shared().setElevationActivePointChanged(profileData.trackId) { [weak self] distance in
+ bookmarkManager.setElevationActivePointChanged(profileData.trackId) { [weak self] distance in
self?.view?.setActivePoint(distance)
}
- BookmarksManager.shared().setElevationMyPositionChanged(profileData.trackId) { [weak self] distance in
+ bookmarkManager.setElevationMyPositionChanged(profileData.trackId) { [weak self] distance in
self?.view?.setMyPosition(distance)
}
}
@@ -114,9 +115,9 @@ extension ElevationProfilePresenter {
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ElevationProfileDescriptionCell", for: indexPath) as! ElevationProfileDescriptionCell
+ let cell = collectionView.dequeueReusableCell(cell: ElevationProfileDescriptionCell.self, indexPath: indexPath)
let model = descriptionModels[indexPath.row]
- cell.configure(title: model.title, value: formatter.yAxisString(from: Double(model.value)), imageName: model.imageName)
+ cell.configure(subtitle: model.title, value: formatter.yAxisString(from: Double(model.value)), imageName: model.imageName)
return cell
}
}
@@ -128,7 +129,7 @@ extension ElevationProfilePresenter {
let width = collectionView.width
let cellHeight = collectionView.height
let modelsCount = CGFloat(descriptionModels.count)
- let cellWidth = (width - cellSpacing * (modelsCount - 1)) / modelsCount
+ let cellWidth = (width - cellSpacing * (modelsCount - 1) - collectionView.contentInset.right) / modelsCount
return CGSize(width: cellWidth, height: cellHeight)
}
@@ -141,7 +142,6 @@ fileprivate struct ElevationProfileChartData {
struct Line: ChartLine {
var values: [ChartValue]
- var name: String
var color: UIColor
var type: ChartLineType
}
@@ -159,8 +159,8 @@ fileprivate struct ElevationProfileChartData {
self.maxDistance = distances.last ?? 0
let lineColor = StyleManager.shared.theme?.colors.chartLine ?? .blue
let lineShadowColor = StyleManager.shared.theme?.colors.chartShadow ?? .lightGray
- let l1 = Line(values: chartValues, name: "Altitude", color: lineColor, type: .line)
- let l2 = Line(values: chartValues, name: "Altitude", color: lineShadowColor, type: .lineArea)
+ let l1 = Line(values: chartValues, color: lineColor, type: .line)
+ let l2 = Line(values: chartValues, color: lineShadowColor, type: .lineArea)
chartLines = [l1, l2]
}
@@ -168,7 +168,6 @@ fileprivate struct ElevationProfileChartData {
_ p2: ElevationHeightPoint,
at distance: Double) -> Double {
assert(distance > p1.distance && distance < p2.distance, "distance must be between points")
-
let d = (distance - p1.distance) / (p2.distance - p1.distance)
return p1.altitude + round(Double(p2.altitude - p1.altitude) * d)
}
diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift
index 37d41a4f0f..c1d8a4e962 100644
--- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift
+++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift
@@ -4,49 +4,54 @@ protocol ElevationProfileViewProtocol: AnyObject {
var presenter: ElevationProfilePresenterProtocol? { get set }
var isChartViewHidden: Bool { get set }
- var isExtendedDifficultyLabelHidden: Bool { get set }
- var isDifficultyHidden: Bool { get set }
- var isBottomPanelHidden: Bool { get set }
+ var isChartViewInfoHidden: Bool { get set }
- func setExtendedDifficultyGrade(_ value: String)
- func setDifficulty(_ value: ElevationDifficulty)
func setChartData(_ data: ChartPresentationData)
func setActivePoint(_ distance: Double)
func setMyPosition(_ distance: Double)
+ func reloadDescription()
}
-class ElevationProfileViewController: UIViewController {
+final class ElevationProfileViewController: UIViewController {
private enum Constants {
+ static let descriptionCollectionViewHeight: CGFloat = 52
+ static let descriptionCollectionViewContentInsets = UIEdgeInsets(top: 20, left: 16, bottom: 4, right: 16)
+ static let graphViewContainerInsets = UIEdgeInsets(top: -4, left: 0, bottom: 0, right: 0)
+ static let chartViewInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: -16)
static let chartViewVisibleHeight: CGFloat = 176
- static let chartViewHiddenHeight: CGFloat = 20
- static let difficultyVisibleHeight: CGFloat = 60
- static let difficultyHiddenHeight: CGFloat = 20
+ static let chartViewHiddenHeight: CGFloat = .zero
+ }
+
+ var presenter: ElevationProfilePresenterProtocol?
+
+ init() {
+ super.init(nibName: nil, bundle: nil)
}
- var presenter: ElevationProfilePresenterProtocol?
+ @available(*, unavailable)
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
- @IBOutlet private weak var chartView: ChartView!
- @IBOutlet private weak var graphViewContainer: UIView!
- @IBOutlet private weak var descriptionCollectionView: UICollectionView!
- @IBOutlet private weak var difficultyView: DifficultyView!
- @IBOutlet private weak var difficultyTitle: UILabel!
- @IBOutlet private weak var extendedDifficultyGradeLabel: UILabel!
- @IBOutlet private weak var extendedGradeButton: UIButton!
- @IBOutlet private weak var chartHeightConstraint: NSLayoutConstraint!
- @IBOutlet private weak var difficultyConstraint: NSLayoutConstraint!
+ private var chartView = ChartView()
+ private var graphViewContainer = UIView()
+ private var descriptionCollectionView: UICollectionView = {
+ let layout = UICollectionViewFlowLayout()
+ layout.scrollDirection = .horizontal
+ layout.minimumInteritemSpacing = 0
+ return UICollectionView(frame: .zero, collectionViewLayout: layout)
+ }()
+ private var chartViewHeightConstraint: NSLayoutConstraint!
- private var difficultyHidden: Bool = false
- private var bottomPanelHidden: Bool = false
+
+ // MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
- descriptionCollectionView.dataSource = presenter
- descriptionCollectionView.delegate = presenter
+ setupViews()
+ layoutViews()
presenter?.configure()
- chartView.onSelectedPointChanged = { [weak self] in
- self?.presenter?.onSelectedPointChanged($0)
- }
}
override func viewWillLayoutSubviews() {
@@ -54,60 +59,75 @@ class ElevationProfileViewController: UIViewController {
descriptionCollectionView.reloadData()
}
- @IBAction func onExtendedDifficultyButtonPressed(_ sender: Any) {
- presenter?.onDifficultyButtonPressed()
+// MARK: - Private methods
+
+ private func setupViews() {
+ view.styleName = "Background"
+ setupDescriptionCollectionView()
+ setupChartView()
}
- func getPreviewHeight() -> CGFloat {
- return view.height - descriptionCollectionView.frame.minY
+ private func setupChartView() {
+ graphViewContainer.translatesAutoresizingMaskIntoConstraints = false
+ chartView.translatesAutoresizingMaskIntoConstraints = false
+ chartView.onSelectedPointChanged = { [weak self] in
+ self?.presenter?.onSelectedPointChanged($0)
+ }
+ }
+
+ private func setupDescriptionCollectionView() {
+ descriptionCollectionView.backgroundColor = .clear
+ descriptionCollectionView.register(cell: ElevationProfileDescriptionCell.self)
+ descriptionCollectionView.dataSource = presenter
+ descriptionCollectionView.delegate = presenter
+ descriptionCollectionView.isScrollEnabled = false
+ descriptionCollectionView.contentInset = Constants.descriptionCollectionViewContentInsets
+ descriptionCollectionView.translatesAutoresizingMaskIntoConstraints = false
+ }
+
+ private func layoutViews() {
+ view.addSubview(descriptionCollectionView)
+ graphViewContainer.addSubview(chartView)
+ view.addSubview(graphViewContainer)
+
+ chartViewHeightConstraint = chartView.heightAnchor.constraint(equalToConstant: Constants.chartViewVisibleHeight)
+ NSLayoutConstraint.activate([
+ descriptionCollectionView.topAnchor.constraint(equalTo: view.topAnchor),
+ descriptionCollectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
+ descriptionCollectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
+ descriptionCollectionView.heightAnchor.constraint(equalToConstant: Constants.descriptionCollectionViewHeight),
+ descriptionCollectionView.bottomAnchor.constraint(equalTo: graphViewContainer.topAnchor, constant: Constants.graphViewContainerInsets.top),
+ graphViewContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor),
+ graphViewContainer.trailingAnchor.constraint(equalTo: view.trailingAnchor),
+ graphViewContainer.bottomAnchor.constraint(equalTo: view.bottomAnchor),
+ chartView.topAnchor.constraint(equalTo: graphViewContainer.topAnchor),
+ chartView.leadingAnchor.constraint(equalTo: graphViewContainer.leadingAnchor, constant: Constants.chartViewInsets.left),
+ chartView.trailingAnchor.constraint(equalTo: graphViewContainer.trailingAnchor, constant: Constants.chartViewInsets.right),
+ chartView.bottomAnchor.constraint(equalTo: graphViewContainer.bottomAnchor),
+ chartViewHeightConstraint,
+ ])
+ }
+
+ private func getPreviewHeight() -> CGFloat {
+ view.height - descriptionCollectionView.frame.minY
}
}
+// MARK: - ElevationProfileViewProtocol
+
extension ElevationProfileViewController: ElevationProfileViewProtocol {
var isChartViewHidden: Bool {
- get { return chartView.isHidden }
+ get { chartView.isHidden }
set {
chartView.isHidden = newValue
graphViewContainer.isHidden = newValue
- chartHeightConstraint.constant = newValue ? Constants.chartViewHiddenHeight : Constants.chartViewVisibleHeight
+ chartViewHeightConstraint.constant = newValue ? Constants.chartViewHiddenHeight : Constants.chartViewVisibleHeight
}
}
- var isExtendedDifficultyLabelHidden: Bool {
- get { return extendedDifficultyGradeLabel.isHidden }
- set {
- extendedDifficultyGradeLabel.isHidden = newValue
- extendedGradeButton.isHidden = newValue
- }
- }
-
- var isDifficultyHidden: Bool {
- get { difficultyHidden }
- set {
- difficultyHidden = newValue
- difficultyTitle.isHidden = newValue
- difficultyView.isHidden = newValue
- }
- }
-
- var isBottomPanelHidden: Bool {
- get { bottomPanelHidden }
- set {
- bottomPanelHidden = newValue
- if newValue == true {
- isExtendedDifficultyLabelHidden = true
- isDifficultyHidden = true
- }
- difficultyConstraint.constant = newValue ? Constants.difficultyHiddenHeight : Constants.difficultyVisibleHeight
- }
- }
-
- func setExtendedDifficultyGrade(_ value: String) {
- extendedDifficultyGradeLabel.text = value
- }
-
- func setDifficulty(_ value: ElevationDifficulty) {
- difficultyView.difficulty = value
+ var isChartViewInfoHidden: Bool {
+ get { chartView.isChartViewInfoHidden }
+ set { chartView.isChartViewInfoHidden = newValue }
}
func setChartData(_ data: ChartPresentationData) {
@@ -121,4 +141,8 @@ extension ElevationProfileViewController: ElevationProfileViewProtocol {
func setMyPosition(_ distance: Double) {
chartView.myPosition = distance
}
+
+ func reloadDescription() {
+ descriptionCollectionView.reloadData()
+ }
}
diff --git a/iphone/Maps/UI/PlacePage/PlacePage.storyboard b/iphone/Maps/UI/PlacePage/PlacePage.storyboard
index 405c1e31ee..545857ac51 100644
--- a/iphone/Maps/UI/PlacePage/PlacePage.storyboard
+++ b/iphone/Maps/UI/PlacePage/PlacePage.storyboard
@@ -7,7 +7,6 @@
-
@@ -1281,181 +1280,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1679,17 +1503,14 @@
-
-
-
-
+
-
+