COVIDSafe code from version 1.6 (#6)

This commit is contained in:
COVIDSafe Support 2020-06-19 17:43:33 +10:00 committed by GitHub
parent 149daee2e9
commit 2063cea613
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1963 additions and 1664 deletions

View file

@ -30,6 +30,9 @@
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizationKey" value="FoundIssueWithApp"/>
</userDefinedRuntimeAttributes>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="a6i-hw-Hlf" userLabel="Compose Issue View">
<rect key="frame" x="0.0" y="53.5" width="359" height="50"/>
@ -46,6 +49,9 @@
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" systemColor="placeholderTextColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizationKey" value="IssueDescPlaceholder"/>
</userDefinedRuntimeAttributes>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZsZ-Vk-6gd" userLabel="Separator View">
<rect key="frame" x="0.0" y="49" width="359" height="1"/>
@ -77,6 +83,9 @@
<rect key="frame" x="0.0" y="0.0" width="359" height="96.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" textContentType="email"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizationKey" value="EmailPlaceholder"/>
</userDefinedRuntimeAttributes>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Hzk-03-ymA" userLabel="Separator View">
<rect key="frame" x="0.0" y="98.5" width="359" height="1"/>
@ -90,6 +99,9 @@
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizationKey" value="IssueFooter"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
@ -135,6 +147,9 @@
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizationKey" value="IssueThankYou"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>

View file

@ -1,12 +0,0 @@
/* Class = "UILabel"; text = "Share your feedback…"; ObjectID = "OZa-NP-7UE"; */
"OZa-NP-7UE.text" = "Share your feedback about COVIDSafe";
/* Class = "UITextView"; text = "."; ObjectID = "f9d-gY-osK"; */
"f9d-gY-osK.text" = ".";
/* Class = "UILabel"; text = "Screenshot"; ObjectID = "gny-Yi-vdL"; */
"gny-Yi-vdL.text" = "Screenshot";
/* Class = "UILabel"; text = "Sending"; ObjectID = "jxY-0S-cFE"; */
"jxY-0S-cFE.text" = "Sending";

View file

@ -29,16 +29,16 @@ final class FeedbackViewController: UIViewController {
}
private lazy var sendBarButtonItem: UIBarButtonItem = {
let item = UIBarButtonItem(title: NSLocalizedString("global_send_button_title",
tableName: "Feedback",
bundle: Bundle.main,
comment: "Send"), style: .done, target: self, action: #selector(sendButtonTapped))
item.tintColor = .covidCareColor
let item = UIBarButtonItem(title: "global_send_button_title".localizedString(comment: "Send Button"),
style: .done,
target: self,
action: #selector(sendButtonTapped))
item.tintColor = .covidSafeColor
return item
}()
private lazy var doneButtonItem: UIBarButtonItem = {
let item = UIBarButtonItem(title: NSLocalizedString("Done", comment: "Done"), style: .done, target: self, action: #selector(doneButtonTapped))
let item = UIBarButtonItem(title: "Done".localizedString(), style: .done, target: self, action: #selector(doneButtonTapped))
item.tintColor = .covidSafeColor
return item
}()
@ -110,11 +110,7 @@ final class FeedbackViewController: UIViewController {
}
private func setup() {
self.title = NSLocalizedString("newFeedbackFlow_navigationTitle",
tableName: "Feedback",
bundle: Bundle.main,
comment: "Title for feedback flow navigation"
)
self.title = "newFeedbackFlow_navigationTitle".localizedString(comment: "Title for feedback flow navigation")
issueTextView.textContainer.lineFragmentPadding = 0.0
setupDelegates()
@ -148,8 +144,7 @@ final class FeedbackViewController: UIViewController {
@objc private func sendButtonTapped(_ sender: Any) {
guard emailTextField.isValid else {
let errorMessage = NSLocalizedString("newFeedback_invalidEmail_errorMessage",tableName: "Feedback",
bundle: Bundle.main, comment: "Please enter a valid email address!")
let errorMessage = "newFeedback_invalidEmail_errorMessage".localizedString(comment: "Please enter a valid email address!")
showErrorMessage(errorMessage)
return
}
@ -211,11 +206,7 @@ final class FeedbackViewController: UIViewController {
case.error:
self.state = .idle
let errorMessage = NSLocalizedString("newFeedback_send_errorMessage",
tableName: "Feedback",
bundle: Bundle.main,
comment: "Generic error message shown when feedback could not be sent"
)
let errorMessage = "newFeedback_send_errorMessage".localizedString(comment: "Generic error message shown when feedback could not be sent")
self.showErrorMessage(errorMessage)
@ -229,10 +220,7 @@ final class FeedbackViewController: UIViewController {
private func showErrorMessage(_ message: String) {
let alert = AlertController(title: "COVIDSafe", message: message, preferredStyle: .alert)
let okActionTitle = NSLocalizedString("global_ok_button_title",
tableName: "Feedback",
bundle: Bundle.main,
comment: "Title for ok button")
let okActionTitle = "OK".localizedString()
let okAction = UIAlertAction(title: okActionTitle, style: .default)
alert.addAction(okAction)
present(alert, animated: true)

View file

@ -115,11 +115,7 @@ extension NewFeedbackFlowController {
// MARK: Factories
func createCancelBarButtonItem() -> UIBarButtonItem {
let buttonTitle = NSLocalizedString("global_cancel_button_title",
tableName: "Feedback",
bundle: Bundle.main,
comment: "Cancel button title"
)
let buttonTitle = "global_cancel_button_title".localizedString()
let item = UIBarButtonItem(
title: buttonTitle,

View file

@ -116,9 +116,7 @@ extension UIViewController {
extension AlertController {
func addNewFeedbackFlowAction() {
let title = NSLocalizedString("entryPrompt_newFeedback_button_title",
tableName: "Feedback",
bundle: Bundle.main,
let title = "entryPrompt_newFeedback_button_title".localizedString(
comment: "Button title for button that launches new feedback flow"
)
self.addDefaultAction(localizedTitle: title) { [weak self] _ in

View file

@ -22,9 +22,7 @@ extension UIAlertAction {
// MARK: UIAlertController cancel extension
extension UIAlertController {
func addCancelAction() {
let cancelActionTitle = NSLocalizedString("global_cancel_button_title",
tableName: "Feedback",
bundle: Bundle.main,
let cancelActionTitle = "global_cancel_button_title".localizedString(
comment: "Cancel button title"
)
let cancelAction = UIAlertAction(title: cancelActionTitle, style: .cancel, handler: nil)

View file

@ -5,15 +5,11 @@ import UIKit
class ViewControllerFactory {
func createPropmtController(_ useCustomTransition: Bool, settings: FeedbackSettings? = nil) -> UIViewController {
let title = NSLocalizedString("entryPrompt_alert_title",
tableName: "Feedback",
bundle: Bundle.main,
let title = "entryPrompt_alert_title".localizedString(
comment: "Title for initial alert when feedback is launched"
)
let message = NSLocalizedString("entryPrompt_alert_message",
tableName: "Feedback",
bundle: Bundle.main,
let message = "entryPrompt_alert_message".localizedString(
comment: "Prompt message for initial alert when feedback is launched"
)