diff --git a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift index 842d135480ed5648ec83b446fd9ce0b20bd48070..1394d8d416d9d631f3651b6b26d754ea94c38164 100644 --- a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift +++ b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift @@ -105,7 +105,7 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable setupColors() - titleLabel.set(font: .regular(15)) + setupFonts() titleLabel.text = session.name @@ -116,20 +116,13 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable activityIndicator.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true activityIndicator.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true - currentPageLabel.set(font: .regular(15)) - currentPageLabel.layer.cornerRadius = 5 - selectedPagesLabel.set(font: .regular(15)) - clearSelectionButton.setTitle(.clear.localized, for: .normal) - clearSelectionButton.titleLabel?.set(font: .regular(12)) extraButton.showsMenuAsPrimaryAction = true extraButton.transform = extraButton.transform.rotated(by: .pi/2) - shareTypeLabel.set(font: .regular(15)) - updateSelectedImagesLabel() updateCurrentPageLabel() @@ -169,6 +162,19 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable layoutButton.customTint(.gray600) } + private func setupFonts() { + + titleLabel.set(font: .bold(22)) + + clearSelectionButton.titleLabel?.set(font: .medium(16)) + + selectedPagesLabel.set(font: .medium(16)) + + currentPageLabel.set(font: .medium(15)) + + shareTypeLabel.set(font: .semibold(16)) + } + private func setupPagerView() { pagerView.register(ScannedItemPagerViewCell.self, forCellWithReuseIdentifier: Constants.cellIdentifier) diff --git a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift index 7a9257a34a2395522075e8a3b24afab204eec648..6661f7753dc19cdda7da67cb019320771d4eebfe 100644 --- a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift +++ b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift @@ -59,23 +59,35 @@ extension ScanSessionPreviewViewController { private func setupUI() { - view.customBackground(.base) + setupColors() - closeButton.customTint(.gray600) + setupFonts() - nextPageButton.customTint(.gray600) - previousPageButton.customTint(.gray600) + currentPageLabel.layer.cornerRadius = 5 + + updateCurrentPageLabel() + + setupPagerView() + } + + private func setupColors() { - currentPageLabel.set(font: .regular(15)) currentPageLabel.set(color: .gray600) currentPageLabel.customLayerBackground(.gray100) - currentPageLabel.layer.cornerRadius = 5 + view.customBackground(.base) - updateCurrentPageLabel() + closeButton.customTint(.gray600) - setupPagerView() + nextPageButton.customTint(.gray600) + previousPageButton.customTint(.gray600) + + pagerView.customBackground(.clear) + } + + private func setupFonts() { + currentPageLabel.set(font: .medium(16)) } private func updateCurrentPageIndex(index: Int) { @@ -107,8 +119,6 @@ extension ScanSessionPreviewViewController { pagerView.dataSource = self pagerView.delegate = self - - pagerView.customBackground(.clear) } } diff --git a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift index 28a103298657d27f6fe7b053691a9f3ff90f0e2f..40a1a13b89db30fb42d338264bb2ac61624c82b6 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift @@ -40,9 +40,7 @@ class DocumentsCollectionViewCell: UICollectionViewCell { private func setupUI() { setupColors() - - nameLabel.set(font: .medium(16)) - detailsLabel.set(font: .regular(10)) + setupFonts() contentView.cornerRadiuss = 20 contentView.borderWidth = 2 @@ -62,6 +60,15 @@ class DocumentsCollectionViewCell: UICollectionViewCell { nameLabel.set(color: .gray600) detailsLabel.set(color: .gray600) + dateLabel.set(color: .gray600) + } + + private func setupFonts() { + + nameLabel.set(font: .semibold(16)) + + detailsLabel.set(font: .regular(10)) + dateLabel.set(font: .regular(10)) } private func setupMenu(indexPath: IndexPath) { diff --git a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift index 4b4bd52bebc086ec93fd05c2063034d4b713da5a..d16d1517b62741a824df7c21f0e008ae026aa76a 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift @@ -42,6 +42,8 @@ final class DocumentsTableViewCell: UITableViewCell { setupColors() + setupFonts() + selectionStyle = .none innerView.cornerRadiuss = 20 @@ -50,9 +52,6 @@ final class DocumentsTableViewCell: UITableViewCell { extraButton.transform = extraButton.transform.rotated(by: .pi/2) thumbnailImageView.image = .file - - dateLabel.set(font: .regular(16)) - nameLabel.set(font: .medium(16)) } private func setupColors() { @@ -66,6 +65,12 @@ final class DocumentsTableViewCell: UITableViewCell { extraButton.customTint(.gray600) } + private func setupFonts() { + + nameLabel.set(font: .semibold(16)) + dateLabel.set(font: .regular(12)) + } + private func setupMenu(indexPath: IndexPath) { let move = UIAction(title: .move.localized) { _ in diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift index 187877906ebe7d527fc86c6d1f67da81185bfae3..3177a4d9721af3a41bd4107f5ca44c6a2845d339 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift @@ -40,8 +40,13 @@ final class AllFolderTableViewCell: UIView { } private func setupUI() { + setupColors() + setupFonts() + + setupCollectionView() + addFolderButton.set(localized: .add) foldersLabel.set(localized: .folders) } @@ -58,7 +63,6 @@ final class AllFolderTableViewCell: UIView { view.autoresizingMask = [.flexibleHeight, .flexibleWidth] addSubview(view) - setupCollectionView() } private func setupColors() { @@ -71,6 +75,11 @@ final class AllFolderTableViewCell: UIView { addFolderButton.set(color: .primary) } + private func setupFonts() { + + foldersLabel.set(font: .bold(20)) + } + @IBAction func addFolderButtonTapped(_ sender: UIButton) { delegate?.addFolderTapped() } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift index 5384d0d76b6bfd542386baf887f153cbee21f831..c080bd4c3b664b84e23ceea7805032949ddcee6f 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift @@ -44,7 +44,7 @@ class FolderCollectionViewCell: UICollectionViewCell { boxView.customBackground(isFolderSelected ? .primary : .gray100) - titleLabel.set(font: isFolderSelected ? .bold(18) : .medium(18)) + titleLabel.set(font: isFolderSelected ? .bold(16) : .medium(16)) titleLabel.set(color: isFolderSelected ? .gray0 : .gray600) } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift index 458c3fdd4cae693baa9e3e705930df776f98db4e..3c76ba258c3e8e0fb78d637badca29d9e683e754 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift @@ -71,10 +71,11 @@ class CustomTabBarView: UIView { setupColors() + setupFonts() + editImageIcon.image = .preview editImageLabel.set(text: .preview.localized) - editImageLabel.set(font: .medium(18)) editImageView.layer.cornerRadius = 10 @@ -89,12 +90,8 @@ class CustomTabBarView: UIView { galleryButton.setImage(.gallery, for: .normal) fileManagerLabel.set(localized: .fileManager) - fileManagerLabel.set(font: .medium(16)) galleryLabel.set(localized: .gallery) - galleryLabel.set(font: .medium(16)) - - badgeLabel.set(font: .medium(14)) } private func setupColors() { @@ -108,6 +105,17 @@ class CustomTabBarView: UIView { galleryLabel.set(color: .gray600) } + private func setupFonts() { + + fileManagerLabel.set(font: .medium(16)) + + galleryLabel.set(font: .medium(16)) + + editImageLabel.set(font: .medium(18)) + + badgeLabel.set(font: .regular(14)) + } + func updateScannedView(session: ScanSession) { if !session.scannedItems.isEmpty { diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift index 7479dbf7ae7300a340ef5a5d379f71d2b602b311..b8cc94fe14eb8306f471da4544cfea27a2793080 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift @@ -138,17 +138,16 @@ extension KNAlertViewController { setupColors() + setupFonts() + // alert alertView.layer.cornerRadius = 16 - titleLabel.set(color: .gray600) - titleLabel.font = .bold(20) titleLabel.textAlignment = .center // text messageTextView.textAlignment = .center messageTextView.textColor = ColorStyle.gray600.uiColor - messageTextView.font = .medium(16) messageTextView.text = "" messageTextView.isEditable = false messageTextView.isSelectable = false @@ -160,13 +159,11 @@ extension KNAlertViewController { // buttons - confirmationButton.set(font: .bold(17)) confirmationButton.set(localized: confirmButtonTitle) confirmationButton.layer.cornerRadius = 20 confirmationButton.addTarget(self, action: #selector(confirmationButtonTapped), for: .touchUpInside) - destructiveButton.set(font: .bold(17)) destructiveButton.set(localized: destructiveButtonTitle) destructiveButton.layer.cornerRadius = 20 @@ -194,6 +191,8 @@ extension KNAlertViewController { alertView.customBackground(.base) + titleLabel.set(color: .gray600) + buttonStackView.customBackground(.clear) destructiveButton.customBackground(.gray100) @@ -203,6 +202,19 @@ extension KNAlertViewController { confirmationButton.customBackground(.gray600) } + private func setupFonts() { + + folderName.font = .regular(14) + + titleLabel.set(font: .bold(20)) + + messageTextView.font = .regular(18) + + confirmationButton.set(font: .bold(20)) + + destructiveButton.set(font: .regular(20)) + } + @objc func textChanged() { folderNameText = folderName.text ?? "" confirmationButton.isEnabled = folderName.text != "" ? true : false diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift index 94cf92256ff099cb280bda3f325b7ec65e1f5243..fc2b0b456b55f6924af70582a36d57442bd37e80 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift @@ -84,8 +84,9 @@ final class SearchFilesView: UIView { setupColors() + setupFonts() + titleLabel.set(text: .folderFiles.localized) - titleLabel.set(font: .bold(20)) searchTextField.isHidden = true searchTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) @@ -107,6 +108,13 @@ final class SearchFilesView: UIView { titleLabel.set(color: .gray600) } + private func setupFonts() { + + searchTextField.font = .regular(14) + + titleLabel.set(font: .semibold(18)) + } + func reloadLocalization() { titleLabel.set(text: .folderFiles.localized) } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift index 0575b50f7ceaba7d3534b6fb5e73c3020c8acf32..0d17861e528b9380eb56dae38bf8dd437c62a372 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift @@ -79,31 +79,25 @@ class ShareSheetViewController: UIViewController { setupColors() + setupFonts() + pagesCountLabel.set(text: "") - pagesCountLabel.set(font: .regular(16)) saveLabel.set(localized: .save) - saveLabel.set(font: .regular(12)) - shareTypeLabel.set(localized: shareType.displayName, color: .gray600, font: .regular(12)) + shareTypeLabel.set(localized: shareType.displayName) whatsappLabel.set(localized: .whatsapp) - whatsappLabel.set(font: .regular(12)) telegramLabel.set(localized: .telegram) - telegramLabel.set(font: .regular(12)) gmailLabel.set(localized: .gmail) - gmailLabel.set(font: .regular(12)) airdropLabel.set(localized: .airdrop) - airdropLabel.set(font: .regular(12)) printLabel.set(localized: .print) - printLabel.set(font: .regular(12)) moreLabel.set(localized: .more) - moreLabel.set(font: .regular(12)) whatsappLabel.textAlignment = .center telegramLabel.textAlignment = .center @@ -156,6 +150,24 @@ class ShareSheetViewController: UIViewController { backgroundView.customBackground(.base) } + private func setupFonts() { + + fileNameTextField.font = .semibold(24) + + pagesCountLabel.set(font: .regular(14)) + + shareTypeLabel.set(font: .semibold(16)) + + saveLabel.set(font: .semibold(16)) + + whatsappLabel.set(font: .regular(16)) + telegramLabel.set(font: .regular(16)) + gmailLabel.set(font: .regular(16)) + airdropLabel.set(font: .regular(16)) + printLabel.set(font: .regular(16)) + moreLabel.set(font: .regular(16)) + } + private func setup() { thumbnailImage.image = session.scannedItems[0].newRenderedImage?.retrieveImage() diff --git a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift index f4450666b15a0d23b985d7c8965e3e70f684fea7..7a55cb553fea1e79879a812e31294d78ebffeb02 100644 --- a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift +++ b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift @@ -132,8 +132,6 @@ extension DocumentsTableViewController { noFilesLabel.set(text: .noFilesToShow.localized) - noFilesLabel.set(font: .medium(22)) - if userSettings.defaultScreen == .camera { openCamera() } @@ -149,6 +147,11 @@ extension DocumentsTableViewController { collectionView.customBackground(.clear) } + private func setupFonts() { + + noFilesLabel.set(font: .medium(22)) + } + private func setupToolbar() { let settingsButton = UIBarButtonItem(image: .settings, style: .done, target: self, action: #selector(settingsTapped)) @@ -217,6 +220,8 @@ extension DocumentsTableViewController { noFilesLabel.set(text: .noFilesToShow.localized) + setupFonts() + allFoldersView.reloadLocalization() searchForFilesView.reloadLocalization() } diff --git a/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift b/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift index 102084fed2b6485e0242d5553a9351790ca1d75a..7daf03b095f7e694941d725fe72a8da3cc83554a 100644 --- a/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift @@ -21,13 +21,18 @@ class FolderSelectCollectionViewCell: UICollectionViewCell { private func setupUI() { setupColors() - folderTitle.set(font: .bold(15)) + + setupFonts() } private func setupColors() { folderTitle.set(color: .gray600) } + private func setupFonts() { + folderTitle.set(font: .medium(15)) + } + func set(title: String) { self.folderTitle.set(text: title) } diff --git a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift index 1d643f338230db05184045deda742b5e7570d8cd..7aaac938ae4e612e7ed270502caff7a752eb9658 100644 --- a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift +++ b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift @@ -58,6 +58,8 @@ class FoldersViewController: UIViewController { setupColors() + setupFonts() + searchBar.delegate = self titleLabel.text = .selectFolder.localized @@ -83,6 +85,10 @@ class FoldersViewController: UIViewController { titleLabel.set(color: .gray600) } + + private func setupFonts() { + titleLabel.set(font: .semibold(18)) + } } // MARK: - UICollectionViewDelegate diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index 3305515af9decb8b5b528448322d065d48106d53..c6f0ac8ae47da47cfbb3e2b3a005a3b874e6a912 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -147,6 +147,8 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess setupColors() + setupFonts() + banner.set(session: scanSession) banner.delegate = self @@ -169,8 +171,6 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess directShareLabel.set(localized: .directShare) - shareTypeLabel.set(font: .regular(15)) - shareType = userSettings.defaultFileType.shareType setupMenu() @@ -189,8 +189,6 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess pageIndex.layer.cornerRadius = 5 - pageIndex.set(font: .regular(15)) - hideCropButtons() } @@ -223,6 +221,19 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess saveCropButton.customTitleColor(.gray0) } + private func setupFonts() { + + pageIndex.set(font: .medium(16)) + directShareLabel.set(font: .medium(16)) + + shareTypeLabel.set(font: .semibold(16)) + + signatureLabel.set(font: .medium(14)) + exportTextLabel.set(font: .medium(14)) + editLabel.set(font: .medium(14)) + cropLabel.set(font: .medium(14)) + } + // MARK: - Methods @objc func backTapped() { if navigationItem.rightBarButtonItem == nil { diff --git a/MiniScanner/Modules/OCRViewController/OCRViewController.swift b/MiniScanner/Modules/OCRViewController/OCRViewController.swift index 7459b8bdcd9c28afb8d94d4f00acd819ba3e389b..81844d04e470e9256bd6c04062e89fc07f89d274 100644 --- a/MiniScanner/Modules/OCRViewController/OCRViewController.swift +++ b/MiniScanner/Modules/OCRViewController/OCRViewController.swift @@ -78,6 +78,10 @@ class OCRViewController: UIViewController { private func setupUI() { + setupColors() + + setupFonts() + view.addSubview(activityIndicator) activityIndicator.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true @@ -97,6 +101,10 @@ class OCRViewController: UIViewController { ocrTextView.customBorderColor(.gray450) } + + private func setupFonts() { + ocrTextView.font = .regular(16) + } } extension OCRViewController {