Skip to content

Commit

Permalink
fix: some ipad issues
Browse files Browse the repository at this point in the history
  • Loading branch information
khcrysalis committed Oct 25, 2024
1 parent c2758ca commit 54269ad
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
7 changes: 6 additions & 1 deletion iOS/Views/Apps/LibraryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class LibraryViewController: UITableViewController {

fileprivate func setupNavigation() {
self.navigationController?.navigationBar.prefersLargeTitles = true
self.title = String.localized("TAB_LIBRARY")
}
}

Expand Down Expand Up @@ -255,7 +256,11 @@ extension LibraryViewController {
if FileManager.default.fileExists(atPath: CoreDataManager.shared.getFilesForDownloadedApps(for:(meow as! DownloadedApps)).path) {
let ap = AppSigningViewController(app: meow, appsViewController: self)
let navigationController = UINavigationController(rootViewController: ap)
navigationController.modalPresentationStyle = .fullScreen
if UIDevice.current.userInterfaceIdiom == .pad {
navigationController.modalPresentationStyle = .formSheet
} else {
navigationController.modalPresentationStyle = .fullScreen
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
self.present(navigationController, animated: true, completion: nil)
}
Expand Down
22 changes: 16 additions & 6 deletions iOS/Views/Apps/Signing/AppSigningViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ class AppSigningViewController: UIViewController, UITableViewDataSource, UITable
self.tableView.translatesAutoresizingMaskIntoConstraints = false
self.tableView.dataSource = self
self.tableView.delegate = self
self.tableView.showsHorizontalScrollIndicator = false
self.tableView.showsVerticalScrollIndicator = false
self.tableView.contentInset.bottom = 40

tableView.register(TweakLibraryViewCell.self, forCellReuseIdentifier: "TweakLibraryViewCell")
tableView.register(SwitchViewCell.self, forCellReuseIdentifier: "SwitchViewCell")
tableView.register(ActivityIndicatorViewCell.self, forCellReuseIdentifier: "ActivityIndicatorViewCell")
self.tableView.register(TweakLibraryViewCell.self, forCellReuseIdentifier: "TweakLibraryViewCell")
self.tableView.register(SwitchViewCell.self, forCellReuseIdentifier: "SwitchViewCell")
self.tableView.register(ActivityIndicatorViewCell.self, forCellReuseIdentifier: "ActivityIndicatorViewCell")

self.view.addSubview(tableView)
self.tableView.constraintCompletely(to: view)
Expand Down Expand Up @@ -146,20 +149,27 @@ class AppSigningViewController: UIViewController, UITableViewDataSource, UITable
view.addSubview(variableBlurView!)
view.addSubview(largeButton)


var height = 90.0

if UIDevice.current.userInterfaceIdiom == .pad {
height = 50.0
}

NSLayoutConstraint.activate([
variableBlurView!.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
variableBlurView!.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
variableBlurView!.bottomAnchor.constraint(equalTo: view.bottomAnchor),
variableBlurView!.heightAnchor.constraint(equalToConstant: 90),
variableBlurView!.heightAnchor.constraint(equalToConstant: height),

largeButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 17),
largeButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -17),
largeButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -17),
largeButton.heightAnchor.constraint(equalToConstant: 50)
])

variableBlurView?.layer.zPosition = 11
largeButton.layer.zPosition = 12
variableBlurView?.layer.zPosition = 3
largeButton.layer.zPosition = 4
}

@objc func startSign() {
Expand Down
1 change: 1 addition & 0 deletions iOS/Views/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class SettingsViewController: UITableViewController {

fileprivate func setupNavigation() {
self.navigationController?.navigationBar.prefersLargeTitles = true
self.title = String.localized("TAB_SETTINGS")
}
}

Expand Down
20 changes: 2 additions & 18 deletions iOS/Views/Sources/SourcesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,7 @@ class SourcesViewController: UITableViewController {
fileprivate func setupNavigation() {
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .always
}

@objc func openSettings() {
let settings = SettingsViewController()

let navigationController = UINavigationController(rootViewController: settings)
let detent2: UISheetPresentationController.Detent = ._detent(withIdentifier: "Test2", constant: 200.0)

if let presentationController = navigationController.presentationController as? UISheetPresentationController {
presentationController.detents = [
detent2,
.large(),

]
}

self.present(navigationController, animated: true)
self.title = String.localized("TAB_SOURCES")
}
}

Expand All @@ -86,7 +70,7 @@ extension SourcesViewController {
let transferPreview = RepoViewController(sources: self.sources)

let hostingController = UIHostingController(rootView: transferPreview)
hostingController.modalPresentationStyle = .pageSheet
hostingController.modalPresentationStyle = .formSheet

if let presentationController = hostingController.presentationController as? UISheetPresentationController {
presentationController.detents = [.medium()]
Expand Down

0 comments on commit 54269ad

Please sign in to comment.