forked from organicmaps/organicmaps-tmp
[MAPSME-6946] [ios] Fixed autoupdate dialog progress display.
This commit is contained in:
parent
3ec84c7bc5
commit
76cbe813ff
1 changed files with 18 additions and 11 deletions
|
@ -107,18 +107,25 @@ enum class State
|
|||
- (void)setStatusForNodeName:(NSString *)nodeName rootAttributes:(NodeAttrs const &)nodeAttrs
|
||||
{
|
||||
auto const progress = nodeAttrs.m_downloadingProgress;
|
||||
CGFloat const prog = kMaxProgress * static_cast<CGFloat>(progress.first) / progress.second;
|
||||
self.spinner.progress = prog;
|
||||
if (progress.second > 0)
|
||||
{
|
||||
CGFloat const prog = kMaxProgress * static_cast<CGFloat>(progress.first) / progress.second;
|
||||
self.spinner.progress = prog;
|
||||
|
||||
NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init];
|
||||
[numberFormatter setNumberStyle:NSNumberFormatterPercentStyle];
|
||||
[numberFormatter setMaximumFractionDigits:0];
|
||||
[numberFormatter setMultiplier:@100];
|
||||
NSString * percent = [numberFormatter stringFromNumber:@(prog)];
|
||||
NSString * downloadedSize = formattedSize(progress.first);
|
||||
NSString * totalSize = formattedSize(progress.second);
|
||||
self.progressLabel.text = [NSString stringWithCoreFormat:L(@"downloader_percent")
|
||||
arguments:@[percent, downloadedSize, totalSize]];
|
||||
NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init];
|
||||
[numberFormatter setNumberStyle:NSNumberFormatterPercentStyle];
|
||||
[numberFormatter setMaximumFractionDigits:0];
|
||||
[numberFormatter setMultiplier:@100];
|
||||
NSString * percent = [numberFormatter stringFromNumber:@(prog)];
|
||||
NSString * downloadedSize = formattedSize(progress.first);
|
||||
NSString * totalSize = formattedSize(progress.second);
|
||||
self.progressLabel.text = [NSString stringWithCoreFormat:L(@"downloader_percent")
|
||||
arguments:@[percent, downloadedSize, totalSize]];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.progressLabel.text = @"";
|
||||
}
|
||||
|
||||
BOOL const isApplying = nodeAttrs.m_status == storage::NodeStatus::Applying;
|
||||
NSString * format = L(isApplying ? @"downloader_applying" : @"downloader_process");
|
||||
|
|
Loading…
Add table
Reference in a new issue