COVIDSafe code from version 2.8 ()

This commit is contained in:
COVIDSafe Support 2021-07-04 21:11:27 -07:00 committed by GitHub
parent 30df30dacc
commit 166f0838ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 43 additions and 27 deletions

View file

@ -180,7 +180,8 @@ class CovidStatisticsViewController: UITableViewController {
let newCases = stateData?.newCases ?? 0
let localCases = stateData?.newLocallyAcquired ?? 0
let overseasCases = stateData?.newOverseasAcquired ?? 0
var bottomDesc = "\(String.localizedStringWithFormat("locally_acquired".localizedString(), "\(localCases)"))\r\(String.localizedStringWithFormat( "overseas_acquired".localizedString(), "\(overseasCases)"))"
let underInvestigation = stateData?.newUnderInvestigation ?? 0
var bottomDesc = "\(String.localizedStringWithFormat("locally_acquired".localizedString(), "\(localCases)"))\r\(String.localizedStringWithFormat( "overseas_acquired".localizedString(), "\(overseasCases)"))\r\(String.localizedStringWithFormat( "under_investigation".localizedString(), "\(underInvestigation)"))"
var description = String.localizedStringWithFormat(descriptionFormat, "new_cases".localizedString(), bottomDesc)
var attributedDesc = NSMutableAttributedString(string: description)
@ -190,6 +191,9 @@ class CovidStatisticsViewController: UITableViewController {
attributedDesc.addAttribute(.font,
value: UIFont.preferredFont(for: .callout, weight: .semibold),
range: NSRange(description.range(of: "\(overseasCases)")!, in: description))
attributedDesc.addAttribute(.font,
value: UIFont.preferredFont(for: .callout, weight: .semibold),
range: NSRange(description.range(of: "\(underInvestigation)")!, in: description))
mainSectionData.append(StatisticRowModel(number: newCases, description: attributedDesc, image: trendUpImage))