Fix UI issues under large text mode

This commit is contained in:
Mingshen Sun 2021-01-05 23:27:35 -08:00
parent 3ecb35e701
commit 05a3fa8d9f
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 58 additions and 14 deletions

View file

@ -79,6 +79,14 @@ class AdvancedSettingsTableViewController: UITableViewController {
}
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
@objc
func encryptInASCIIArmoredAction(_: Any?) {
Defaults.encryptInArmored = encryptInASCIIArmoredSwitch.isOn

View file

@ -115,6 +115,14 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo
}
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
func sendEmail(toRecipients recipients: [String], subject: String) {
let mailVC = MFMailComposeViewController()
mailVC.mailComposeDelegate = self

View file

@ -95,9 +95,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
hideUnknownSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hideUnknownSwitch.bounds.width, height: hideUnknownSwitch.bounds.height)
detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height)
detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHideUnknownSwitchDetailButton(_:)), for: UIControl.Event.touchDown)
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideUnknownSwitch.bounds.width + 10, height: hideUnknownSwitch.bounds.height))
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideUnknownSwitch.bounds.width + 10, height: cell.contentView.bounds.height))
accessoryView.addSubview(detailButton)
accessoryView.addSubview(hideUnknownSwitch)
hideUnknownSwitch.center.y = accessoryView.center.y
detailButton.center.y = accessoryView.center.y
cell.accessoryView = accessoryView
cell.selectionStyle = .none
hideUnknownSwitch.isOn = Defaults.isHideUnknownOn
@ -107,9 +109,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
hideOTPSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hideOTPSwitch.bounds.width, height: hideOTPSwitch.bounds.height)
detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height)
detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHideOTPSwitchDetailButton(_:)), for: UIControl.Event.touchDown)
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideOTPSwitch.bounds.width + 10, height: hideOTPSwitch.bounds.height))
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideOTPSwitch.bounds.width + 10, height: cell.contentView.bounds.height))
accessoryView.addSubview(detailButton)
accessoryView.addSubview(hideOTPSwitch)
hideOTPSwitch.center.y = accessoryView.center.y
detailButton.center.y = accessoryView.center.y
cell.accessoryView = accessoryView
cell.selectionStyle = .none
hideOTPSwitch.isOn = Defaults.isHideOTPOn
@ -131,9 +135,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
hidePasswordImagesSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hidePasswordImagesSwitch.bounds.width, height: hidePasswordImagesSwitch.bounds.height)
detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height)
detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHidePasswordImagesSwitchDetailButton(_:)), for: UIControl.Event.touchDown)
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hidePasswordImagesSwitch.bounds.width + 10, height: hidePasswordImagesSwitch.bounds.height))
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hidePasswordImagesSwitch.bounds.width + 10, height: cell.contentView.bounds.height))
accessoryView.addSubview(detailButton)
accessoryView.addSubview(hidePasswordImagesSwitch)
hidePasswordImagesSwitch.center.y = accessoryView.center.y
detailButton.center.y = accessoryView.center.y
cell.accessoryView = accessoryView
cell.selectionStyle = .none
hidePasswordImagesSwitch.isOn = Defaults.isHidePasswordImagesOn

View file

@ -19,7 +19,6 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
@IBOutlet var authSSHKeyCell: UITableViewCell!
@IBOutlet var authPasswordCell: UITableViewCell!
@IBOutlet var gitURLCell: UITableViewCell!
@IBOutlet var gitRepositoryURLTabelViewCell: UITableViewCell!
// MARK: - Properties
@ -106,6 +105,14 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
tableView.deselectRow(at: indexPath, animated: true)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
// MARK: - Segue Handlers
@IBAction

View file

@ -366,6 +366,14 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
return cell
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
private func getPasswordEntry(by indexPath: IndexPath) -> PasswordTableEntry {
sections[indexPath.section].entries[indexPath.row]
}

View file

@ -140,6 +140,14 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
tableView.deselectRow(at: indexPath, animated: true)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
func showPGPKeyActionSheet() {
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
optionMenu.addAction(