Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

Commit 04e6075

Browse files
authored
Merge pull request #350 from admin-ch/feature/remove-refresh-info-button
Removes refreshInfo button
2 parents 9d0368b + 318649e commit 04e6075

3 files changed

Lines changed: 0 additions & 112 deletions

File tree

CovidCertificate.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@
357357
F80FA8B52797159200172880 /* HomescreenBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F80FA8B42797159200172880 /* HomescreenBannerView.swift */; };
358358
F80FA8B72797221700172880 /* CertificateDetailBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F80FA8B62797221700172880 /* CertificateDetailBannerView.swift */; };
359359
F80FA8B92797297D00172880 /* EOLBannerPopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F80FA8B82797297D00172880 /* EOLBannerPopupView.swift */; };
360-
F8118D6927847076007FC484 /* RefreshButtonVisibilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8118D6827847076007FC484 /* RefreshButtonVisibilityManager.swift */; };
361360
F8119172278888B8007FC484 /* OnboardingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8119171278888B8007FC484 /* OnboardingTests.swift */; };
362361
F8130CDC2685B46200A29326 /* URLSession+synchron.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8130CDB2685B46200A29326 /* URLSession+synchron.swift */; };
363362
F8130CDD2685B46200A29326 /* URLSession+synchron.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8130CDB2685B46200A29326 /* URLSession+synchron.swift */; };
@@ -664,7 +663,6 @@
664663
F80FA8B42797159200172880 /* HomescreenBannerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomescreenBannerView.swift; sourceTree = "<group>"; };
665664
F80FA8B62797221700172880 /* CertificateDetailBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertificateDetailBannerView.swift; sourceTree = "<group>"; };
666665
F80FA8B82797297D00172880 /* EOLBannerPopupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EOLBannerPopupView.swift; sourceTree = "<group>"; };
667-
F8118D6827847076007FC484 /* RefreshButtonVisibilityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshButtonVisibilityManager.swift; sourceTree = "<group>"; };
668666
F811916F278888B8007FC484 /* CovidCertificateWalletUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CovidCertificateWalletUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
669667
F8119171278888B8007FC484 /* OnboardingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingTests.swift; sourceTree = "<group>"; };
670668
F8130CDB2685B46200A29326 /* URLSession+synchron.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLSession+synchron.swift"; sourceTree = "<group>"; };
@@ -1249,7 +1247,6 @@
12491247
6EF166CE264E5C3200426985 /* ConfigResponseBody.swift */,
12501248
6EF166CF264E5C3200426985 /* InfoBoxVisibilityManager.swift */,
12511249
DC286A25242CE0B9001D5344 /* Environment.swift */,
1252-
F8118D6827847076007FC484 /* RefreshButtonVisibilityManager.swift */,
12531250
);
12541251
path = Config;
12551252
sourceTree = "<group>";
@@ -2160,7 +2157,6 @@
21602157
6EBF9C7A267C809700E86B45 /* Migration.swift in Sources */,
21612158
8E81CC9D241FCC7D006F2437 /* ViewController.swift in Sources */,
21622159
6ED9161F2681B171006D9E7C /* UBPushRegistrationManager.swift in Sources */,
2163-
F8118D6927847076007FC484 /* RefreshButtonVisibilityManager.swift in Sources */,
21642160
F88DA6B3268C786D001DB072 /* Error+NetworkError.swift in Sources */,
21652161
6EE55DA82761075B001F9E1F /* CheckModeState.swift in Sources */,
21662162
6E173924267B31BB00813D30 /* TransferCodeErrorRetryViewController.swift in Sources */,

CovidCertificate/SharedLogic/Networking/Config/RefreshButtonVisibilityManager.swift

Lines changed: 0 additions & 48 deletions
This file was deleted.

Wallet/Screens/Certificates/CertificateDetailViewController.swift

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ class CertificateDetailViewController: ViewController {
4141
private let modeView = CertificateModeView()
4242
private var infoPopupView: IconTextInfoBoxView?
4343
private var bannerPopupView: EOLBannerPopupView?
44-
private var refreshInfoPopupView: RefreshInfoPopupView?
4544

4645
private let noteView = CertificateNoteView()
4746

4847
private let removeButton = Button(titleKey: .delete_button, style: .normal(.cc_bund))
4948

50-
private let floatingButton = Button(image: UIImage(named: "ic-load")?.withRenderingMode(.alwaysTemplate), accessibilityKey: .accessibility_refresh_button)
51-
5249
private lazy var qrCodeStateView = CertificateQRCodeStateView(initialState: temporaryVerifierState)
5350

5451
private let certificateLightRow = IconImageRowView(icon: UIImage(named: "ic-qr-certificate-light")!,
@@ -84,7 +81,6 @@ class CertificateDetailViewController: ViewController {
8481
guard let strongSelf = self else { return }
8582
UIView.animate(withDuration: 0.2) {
8683
strongSelf.temporaryVerifierState = .idle
87-
strongSelf.floatingButton.alpha = 1
8884
strongSelf.update()
8985
}
9086
}
@@ -126,28 +122,6 @@ class CertificateDetailViewController: ViewController {
126122
}
127123
}
128124

129-
override func viewWillAppear(_ animated: Bool) {
130-
super.viewWillAppear(animated)
131-
switch RefreshButtonVisibilityManager.state {
132-
case .refreshButton:
133-
floatingButton.isHidden = false
134-
floatingButton.setImage(UIImage(named: "ic-load")?.withRenderingMode(.alwaysTemplate), for: .normal)
135-
136-
floatingButton.backgroundColor = .cc_blue
137-
floatingButton.tintColor = .cc_white
138-
floatingButton.layer.borderWidth = 0.0
139-
case .infoButton:
140-
floatingButton.isHidden = false
141-
floatingButton.setImage(UIImage(named: "ic-info"), for: .normal)
142-
143-
floatingButton.backgroundColor = .cc_white
144-
floatingButton.tintColor = .cc_blue
145-
floatingButton.layer.borderWidth = 2.0
146-
case .none:
147-
floatingButton.isHidden = true
148-
}
149-
}
150-
151125
// MARK: - Setup
152126

153127
private func setup() {
@@ -233,41 +207,10 @@ class CertificateDetailViewController: ViewController {
233207
make.top.equalTo(spacer.snp.top)
234208
}
235209

236-
floatingButton.backgroundColor = .cc_blue
237-
floatingButton.tintColor = .cc_white
238-
let size: CGFloat = 50.0
239-
floatingButton.layer.cornerRadius = size * 0.5
240-
floatingButton.layer.borderColor = UIColor.cc_blue.cgColor
241-
floatingButton.highlightCornerRadius = size * 0.5
242-
floatingButton.ub_addShadow(radius: 4.0, opacity: 0.2, xOffset: 0.0, yOffset: 0.0)
243-
view.addSubview(floatingButton)
244-
floatingButton.snp.makeConstraints { make in
245-
make.size.equalTo(size)
246-
make.bottom.equalTo(view.safeAreaLayoutGuide).inset(Padding.large)
247-
make.trailing.equalTo(view.safeAreaLayoutGuide).inset(Padding.large + Padding.small)
248-
}
249-
floatingButton.alpha = 0
250-
251210
update()
252211
}
253212

254213
private func setupInteraction() {
255-
floatingButton.touchUpCallback = { [weak self] in
256-
guard let strongSelf = self else { return }
257-
258-
switch RefreshButtonVisibilityManager.state {
259-
case .refreshButton:
260-
strongSelf.stackScrollView.scrollToTop(animated: true)
261-
strongSelf.startTemporaryCheck()
262-
case .infoButton:
263-
strongSelf.refreshInfoPopupView?.removeFromSuperview()
264-
strongSelf.refreshInfoPopupView = RefreshInfoPopupView()
265-
strongSelf.refreshInfoPopupView?.addAndPresent(to: strongSelf.view, from: strongSelf.floatingButton)
266-
case .none:
267-
break
268-
}
269-
}
270-
271214
removeButton.touchUpCallback = { [weak self] in
272215
guard let strongSelf = self else { return }
273216
strongSelf.removeCertificate()
@@ -413,7 +356,6 @@ class CertificateDetailViewController: ViewController {
413356
temporaryVerifierState = .verifying
414357
state = .loading
415358
UIView.animate(withDuration: 0.2) {
416-
self.floatingButton.alpha = 0
417359
self.qrCodeStateView.state = self.temporaryVerifierState
418360
}
419361

@@ -439,12 +381,10 @@ class CertificateDetailViewController: ViewController {
439381
guard let qrCode = certificate?.qrCode else { return }
440382

441383
state = .loading
442-
floatingButton.alpha = 0
443384

444385
VerifierManager.shared.addObserver(self, for: qrCode, modes: Verifier.currentModes()) { [weak self] state in
445386
guard let self = self else { return }
446387
self.qrCodeStateView.alpha = 0
447-
self.floatingButton.alpha = state == .loading ? 0 : 1
448388
self.state = state
449389
}
450390
}

0 commit comments

Comments
 (0)