mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
[ios] Move branch data to PlacePagePreview
Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
49391bb39e
commit
47b18e7753
@@ -35,12 +35,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly, nullable) NSString *title;
|
||||
@property(nonatomic, readonly, nullable) NSString *secondaryTitle;
|
||||
@property(nonatomic, readonly, nullable) NSString *subtitle;
|
||||
@property(nonatomic, readonly, nullable) NSString *branch;
|
||||
@property(nonatomic, readonly, nullable) NSString *coordinates;
|
||||
@property(nonatomic, readonly, nullable) NSString *secondarySubtitle;
|
||||
@property(nonatomic, readonly) PlacePageDataSchedule schedule;
|
||||
@property(nonatomic, readonly) BOOL isMyPosition;
|
||||
|
||||
- (instancetype)initWithTrackInfo:(TrackInfo * _Nonnull)trackInfo;
|
||||
- (void)setBranch:(NSString * _Nullable)branch;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -59,6 +59,10 @@ static PlacePageDataSchedule convertOpeningHours(std::string_view rawOH)
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setBranch:(NSString * _Nullable)branch {
|
||||
_branch = branch;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation PlacePagePreviewData (Core)
|
||||
|
||||
@@ -75,6 +75,9 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) {
|
||||
}];
|
||||
}
|
||||
_previewData = [[PlacePagePreviewData alloc] initWithRawData:rawData()];
|
||||
|
||||
// Set branch from infoData to previewData
|
||||
[_previewData setBranch:_infoData.branch];
|
||||
|
||||
auto const &countryId = rawData().GetCountryId();
|
||||
if (!countryId.empty()) {
|
||||
|
||||
@@ -6,7 +6,6 @@ class PlacePageHeaderBuilder {
|
||||
let viewController = storyboard.instantiateViewController(ofType: PlacePageHeaderViewController.self);
|
||||
let presenter = PlacePageHeaderPresenter(view: viewController,
|
||||
placePagePreviewData: data.previewData,
|
||||
branch: data.infoData?.branch,
|
||||
objectType: data.objectType,
|
||||
delegate: delegate,
|
||||
headerType: headerType)
|
||||
|
||||
@@ -23,21 +23,18 @@ class PlacePageHeaderPresenter {
|
||||
|
||||
private weak var view: PlacePageHeaderViewProtocol?
|
||||
private let placePagePreviewData: PlacePagePreviewData
|
||||
private let branch: String?
|
||||
let objectType: PlacePageObjectType
|
||||
private weak var delegate: PlacePageHeaderViewControllerDelegate?
|
||||
private let headerType: HeaderType
|
||||
|
||||
init(view: PlacePageHeaderViewProtocol,
|
||||
placePagePreviewData: PlacePagePreviewData,
|
||||
branch: String?,
|
||||
objectType: PlacePageObjectType,
|
||||
delegate: PlacePageHeaderViewControllerDelegate?,
|
||||
headerType: HeaderType) {
|
||||
self.view = view
|
||||
self.delegate = delegate
|
||||
self.placePagePreviewData = placePagePreviewData
|
||||
self.branch = branch
|
||||
self.objectType = objectType
|
||||
self.headerType = headerType
|
||||
}
|
||||
@@ -45,7 +42,7 @@ class PlacePageHeaderPresenter {
|
||||
|
||||
extension PlacePageHeaderPresenter: PlacePageHeaderPresenterProtocol {
|
||||
func configure() {
|
||||
view?.setTitle(placePagePreviewData.title, secondaryTitle: placePagePreviewData.secondaryTitle, branch: branch)
|
||||
view?.setTitle(placePagePreviewData.title, secondaryTitle: placePagePreviewData.secondaryTitle, branch: placePagePreviewData.branch)
|
||||
switch headerType {
|
||||
case .flexible:
|
||||
view?.isExpandViewHidden = false
|
||||
|
||||
Reference in New Issue
Block a user