Address PR feedback.

This commit is contained in:
Igor Solomennikov 2022-04-29 14:11:12 -07:00
parent c90b282f97
commit bee4567dac
5 changed files with 15 additions and 16 deletions

View File

@ -46,7 +46,7 @@ class GroupCallErrorView: UIView {
return label
}()
private let button: UIButton = {
private lazy var button: UIButton = {
let buttonLabel = NSLocalizedString(
"GROUP_CALL_ERROR_DETAILS",
comment: "A button to receive more info about not seeing a participant in group call grid")
@ -62,14 +62,16 @@ class GroupCallErrorView: UIView {
button.titleLabel?.font = UIFont.ows_dynamicTypeSubheadline.ows_semibold
button.setTitle(buttonLabel, for: .normal)
button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
return button
}()
private let miniButton: UIButton = {
private lazy var miniButton: UIButton = {
let button = UIButton()
button.contentVerticalAlignment = .fill
button.contentHorizontalAlignment = .fill
button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
return button
}()
@ -105,9 +107,6 @@ class GroupCallErrorView: UIView {
button.autoSetDimension(.height, toSize: 24, relation: .greaterThanOrEqual)
miniButton.autoSetDimensions(to: CGSize(width: 24, height: 24))
button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
miniButton.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
configure()
}

View File

@ -100,7 +100,7 @@ public class PinSetupViewController: OWSViewController {
return pinTypeToggle
}()
private let nextButton: OWSFlatButton = {
private lazy var nextButton: OWSFlatButton = {
let nextButton = OWSFlatButton()
nextButton.setTitle(
title: CommonStrings.nextButton,
@ -112,6 +112,7 @@ public class PinSetupViewController: OWSViewController {
nextButton.button.layer.cornerRadius = 14
nextButton.contentEdgeInsets = UIEdgeInsets(hMargin: 4, vMargin: 14)
nextButton.addTarget(target: self, selector: #selector(nextPressed))
nextButton.accessibilityIdentifier = "pinCreation.nextButton"
return nextButton
}()
@ -136,17 +137,19 @@ public class PinSetupViewController: OWSViewController {
return recommendationLabel
}()
private let backButton: UIButton = {
private lazy var backButton: UIButton = {
let topButtonImage = CurrentAppContext().isRTL ? #imageLiteral(resourceName: "NavBarBackRTL") : #imageLiteral(resourceName: "NavBarBack")
let backButton = UIButton.withTemplateImage(topButtonImage, tintColor: Theme.secondaryTextAndIconColor)
backButton.autoSetDimensions(to: CGSize(square: 40))
backButton.addTarget(self, action: #selector(navigateBack), for: .touchUpInside)
return backButton
}()
private let moreButton: UIButton = {
private lazy var moreButton: UIButton = {
let moreButton = UIButton.withTemplateImageName("more-horiz-24", tintColor: Theme.primaryIconColor)
moreButton.autoSetDimensions(to: CGSize(square: 40))
moreButton.addTarget(self, action: #selector(didTapMoreButton), for: .touchUpInside)
return moreButton
}()
@ -369,10 +372,6 @@ public class PinSetupViewController: OWSViewController {
if #available(iOS 13, *) {
isModalInPresentation = true
}
nextButton.addTarget(target: self, selector: #selector(nextPressed))
backButton.addTarget(self, action: #selector(navigateBack), for: .touchUpInside)
moreButton.addTarget(self, action: #selector(didTapMoreButton), for: .touchUpInside)
}
var titleText: String {

View File

@ -71,11 +71,12 @@ public class RegistrationPhoneNumberViewController: OnboardingBaseViewController
return imageView
}()
private let callingCodeLabel: UILabel = {
private lazy var callingCodeLabel: UILabel = {
let label = UILabel()
label.textColor = Theme.primaryTextColor
label.font = UIFont.ows_dynamicTypeBodyClamped
label.isUserInteractionEnabled = true
label.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(countryCodeTapped)))
label.accessibilityIdentifier = "onboarding.phoneNumber." + "callingCodeLabel"
return label
}()
@ -255,8 +256,6 @@ public class RegistrationPhoneNumberViewController: OnboardingBaseViewController
phoneNumberTextField.delegate = self
phoneNumberTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
populateDefaults()
callingCodeLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(countryCodeTapped)))
}
var isAppearing = false

View File

@ -555,6 +555,8 @@ public class OWSAttachmentDownloads: NSObject {
} else {
attachmentPointer.updateAttachmentPointerState(.failed, transaction: transaction)
}
@unknown default:
owsFailDebug("Invalid value.")
}
if let message = job.message {

View File

@ -18,7 +18,7 @@ typedef NS_ENUM(NSUInteger, TSAttachmentPointerType) {
TSAttachmentPointerTypeRestoring = 2,
};
typedef NS_CLOSED_ENUM(NSUInteger, TSAttachmentPointerState) {
typedef NS_ENUM(NSUInteger, TSAttachmentPointerState) {
TSAttachmentPointerStateEnqueued = 0,
TSAttachmentPointerStateDownloading = 1,
TSAttachmentPointerStateFailed = 2,