From 0ee3302ea9f33d2660c19caefbf24d7b1aef7a45 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Mon, 22 Aug 2022 17:01:36 +1000 Subject: [PATCH] fix next button not showing the first time tapping input field --- Session/DMs/NewDMVC.swift | 10 ++++++---- Session/Home/HomeVC.swift | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Session/DMs/NewDMVC.swift b/Session/DMs/NewDMVC.swift index 08190e3dc..370a32ff3 100644 --- a/Session/DMs/NewDMVC.swift +++ b/Session/DMs/NewDMVC.swift @@ -283,6 +283,8 @@ private final class EnterPublicKeyVC : UIViewController { qrCodeImageView.contentMode = .scaleAspectFit qrCodeImageView.set(.height, to: isIPhone5OrSmaller ? 160 : 220) qrCodeImageView.set(.width, to: isIPhone5OrSmaller ? 160 : 220) + qrCodeImageView.layer.cornerRadius = 8 + qrCodeImageView.layer.masksToBounds = true // Set up QR code image view container qrCodeImageViewContainer.addSubview(qrCodeImageView) qrCodeImageView.center(.horizontal, in: qrCodeImageViewContainer) @@ -362,12 +364,12 @@ private final class EnterPublicKeyVC : UIViewController { guard let newHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size.height else { return } bottomConstraint.constant = newHeight + bottomMargin UIView.animate(withDuration: 0.25) { + self.nextButtonContainer.alpha = 1 + self.nextButtonContainer.isHidden = false [ self.spacer1, self.separator, self.spacer2, self.qrCodeImageViewContainer, self.spacer3, self.userPublicKeyLabel, self.spacer4, self.buttonContainer ].forEach { $0.alpha = 0 $0.isHidden = true } - self.nextButtonContainer.alpha = 1 - self.nextButtonContainer.isHidden = false self.view.layoutIfNeeded() } } @@ -377,12 +379,12 @@ private final class EnterPublicKeyVC : UIViewController { isKeyboardShowing = false bottomConstraint.constant = bottomMargin UIView.animate(withDuration: 0.25) { + self.nextButtonContainer.alpha = 0 + self.nextButtonContainer.isHidden = true [ self.spacer1, self.separator, self.spacer2, self.qrCodeImageViewContainer, self.spacer3, self.userPublicKeyLabel, self.spacer4, self.buttonContainer ].forEach { $0.alpha = 1 $0.isHidden = false } - self.nextButtonContainer.alpha = 0 - self.nextButtonContainer.isHidden = true self.view.layoutIfNeeded() } } diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index c9fd4d948..d01afaba9 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -111,6 +111,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi result.setCircularGlow(with: glowConfiguration) result.layer.masksToBounds = false result.tintColor = .white + result.addTarget(self, action: #selector(createNewDM), for: .touchUpInside) return result }()