From bf854af59310c21df8a3435842a861b7213fef11 Mon Sep 17 00:00:00 2001 From: Anvitha Date: Tue, 15 Apr 2025 11:19:11 +0530 Subject: [PATCH] Added a basic data download button --- Scribe/InstallationTab/DownloadDataVC.swift | 4 ++-- Scribe/InstallationTab/InstallationVC.swift | 23 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Scribe/InstallationTab/DownloadDataVC.swift b/Scribe/InstallationTab/DownloadDataVC.swift index 17a7ef22..eb1a22ff 100644 --- a/Scribe/InstallationTab/DownloadDataVC.swift +++ b/Scribe/InstallationTab/DownloadDataVC.swift @@ -6,7 +6,7 @@ import UIKit -// class DownloadDataVC: UIViewController { + class DownloadDataVC: UIViewController { // @IBOutlet var outerTable: UITableView! // // let tableData = DownloadDataTable.downloadDataTable @@ -48,7 +48,7 @@ import UIKit // // return cell // } -// } + } // // MARK: UITableViewDelegate diff --git a/Scribe/InstallationTab/InstallationVC.swift b/Scribe/InstallationTab/InstallationVC.swift index d0f1fe12..c8924068 100644 --- a/Scribe/InstallationTab/InstallationVC.swift +++ b/Scribe/InstallationTab/InstallationVC.swift @@ -40,6 +40,10 @@ class InstallationVC: UIViewController { @IBOutlet var installationHeaderLabel: UILabel! + @IBOutlet var downloadKeyboardBtnPhone: UIButton! + @IBOutlet var downloadKeyboardBtnPad: UIButton! + var downloadKeyboardBtn: UIButton! + private let installationTipCardState: Bool = { let userDefault = UserDefaults.standard let state = userDefault.object(forKey: "installationTipCardState") as? Bool ?? true @@ -54,12 +58,14 @@ class InstallationVC: UIViewController { settingsBtn = settingsBtnPad settingsCorner = settingsCornerPad settingCornerWidthConstraint = settingCornerWidthConstraintPad + downloadKeyboardBtn = downloadKeyboardBtnPad appTextViewPhone.removeFromSuperview() appTextBackgroundPhone.removeFromSuperview() topIconPhone.removeFromSuperview() settingsBtnPhone.removeFromSuperview() settingsCornerPhone.removeFromSuperview() + } else { appTextView = appTextViewPhone appTextBackground = appTextBackgroundPhone @@ -73,6 +79,7 @@ class InstallationVC: UIViewController { topIconPad.removeFromSuperview() settingsBtnPad.removeFromSuperview() settingsCornerPad.removeFromSuperview() + } } @@ -148,6 +155,15 @@ class InstallationVC: UIViewController { settingsBtn.addTarget(self, action: #selector(keyTouchDown), for: .touchDown) } + func setDownloadKeyboardBtn() { + downloadKeyboardBtn.setTitle(NSLocalizedString("app.installation.download", value: "Download Keyboard", comment: ""), for: .normal) + downloadKeyboardBtn.setTitleColor(.white, for: .normal) + downloadKeyboardBtn.backgroundColor = scribeCTAColor + downloadKeyboardBtn.titleLabel?.font = UIFont.systemFont(ofSize: fontSize * 0.9, weight: .medium) + downloadKeyboardBtn.clipsToBounds = true + downloadKeyboardBtn.addTarget(self, action: #selector(handleDownloadKeyboard), for: .touchUpInside) + } + /// Sets constant properties for the app screen. func setUIConstantProperties() { // Set the scroll bar so that it appears on a white background regardless of light or dark mode. @@ -246,6 +262,7 @@ class InstallationVC: UIViewController { setUIConstantProperties() setUIDeviceProperties() setInstallationUI() + setDownloadKeyboardBtn() } /// Function to open the settings app that is targeted by settingsBtn. @@ -256,6 +273,12 @@ class InstallationVC: UIViewController { UIApplication.shared.open(settingsURL) } + /// Function to link download data button + @objc func handleDownloadKeyboard() { + let downloadVC = DownloadDataVC() + navigationController?.pushViewController(downloadVC, animated: true) + } + /// Function to change the key coloration given a touch down. /// /// - Parameters