Files
comaps/iphone/Maps/UI/Downloader/Cells/MWMMapDownloaderLargeCountryTableViewCell.m
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

32 lines
1.2 KiB
Objective-C

#import "MWMMapDownloaderLargeCountryTableViewCell.h"
#import "MWMCircularProgress.h"
#import <CoreApi/MWMMapNodeAttributes.h>
@interface MWMMapDownloaderLargeCountryTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel * mapsCount;
@end
@implementation MWMMapDownloaderLargeCountryTableViewCell
#pragma mark - Config
- (void)config:(MWMMapNodeAttributes *)nodeAttrs searchQuery:(NSString *)searchQuery {
[super config:nodeAttrs searchQuery:searchQuery];
BOOL haveLocalMaps = (nodeAttrs.downloadedMwmCount != 0);
NSString *ofMaps = haveLocalMaps ? [NSString stringWithFormat:L(@"downloader_of"), nodeAttrs.downloadedMwmCount, nodeAttrs.totalMwmCount] : @(nodeAttrs.totalMwmCount).stringValue;
self.mapsCount.text = [NSString stringWithFormat:@"%@: %@", L(@"downloader_status_maps"), ofMaps];
}
- (void)configProgress:(MWMMapNodeAttributes *)nodeAttrs {
[super configProgress:nodeAttrs];
if (nodeAttrs.nodeStatus == MWMMapNodeStatusPartly || nodeAttrs.nodeStatus == MWMMapNodeStatusNotDownloaded) {
MWMCircularProgressStateVec affectedStates = @[@(MWMCircularProgressStateNormal), @(MWMCircularProgressStateSelected)];
[self.progress setImageName:@"ic_folder" forStates:affectedStates];
}
}
@end