@@ -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