Skip to content

Commit

Permalink
UI: Make UI more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
josefdolezal committed May 14, 2017
1 parent 6b1e301 commit b4d53a8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions OctoPhone/Coordinators/DetailCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Icons

/// Printer detail flow controller
final class DetailCoordinator: TabCoordinator {
Expand All @@ -29,6 +30,8 @@ final class DetailCoordinator: TabCoordinator {
let controller = DetailViewController(viewModel: viewModel)

controller.title = tr(.printerDetail)
controller.tabBarItem = UITabBarItem(withIcon: .ulIcon, size: CGSize(width: 22, height: 22),
title: tr(.printerDetail))
navigationController?.pushViewController(controller, animated: false)
}
}
Expand Down
3 changes: 3 additions & 0 deletions OctoPhone/Coordinators/FilesCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import UIKit
import Icons

/// Stored files list coordinator
final class FilesCoordinator: TabCoordinator {
Expand All @@ -16,6 +17,8 @@ final class FilesCoordinator: TabCoordinator {
let controller = FilesViewController(viewModel: viewModel)

controller.title = tr(.files)
controller.tabBarItem = UITabBarItem(withIcon: ._429Icon, size: CGSize(width: 22, height: 22),
title: tr(.files))
navigationController?.pushViewController(controller, animated: false)
}
}
Expand Down
3 changes: 3 additions & 0 deletions OctoPhone/Coordinators/SettingsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Icons

/// Printer settings flow controller
final class SettingsCoordinator: TabCoordinator {
Expand All @@ -15,6 +16,8 @@ final class SettingsCoordinator: TabCoordinator {
let controller = SettingsViewController(viewModel: viewModel)

controller.title = tr(.settings)
navigationController?.tabBarItem = UITabBarItem(withIcon: .cogIcon, size: CGSize(width: 22, height: 22),
title: tr(.settings))
navigationController?.pushViewController(controller, animated: false)
}
}
Expand Down
2 changes: 2 additions & 0 deletions OctoPhone/View Related/Files/FileCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class FileCollectionViewCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)

backgroundColor = .white

bindViewModel()
}

Expand Down
8 changes: 7 additions & 1 deletion OctoPhone/View Related/Files/FilesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,20 @@ extension FilesViewController {
}
}

// MARK: - UICollectionViewDataSource
// MARK: - UICollectionViewDelegateFlowLayout
extension FilesViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize {

return CGSize(width: collectionView.frame.width, height: 44)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
minimumLineSpacingForSectionAt section: Int) -> CGFloat {

return 0.5
}
}

// MARK: - UICollectionViewDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class SettingsCollectionViewCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)

backgroundColor = .white

contentView.addSubview(settingsTextLabel)
bindViewModel()
}
Expand Down
9 changes: 7 additions & 2 deletions OctoPhone/View Related/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ extension SettingsViewController {

// MARK: - UICollectionViewDelegateFlowLayout
extension SettingsViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize {

return CGSize(width: view.frame.width, height: 40)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
minimumLineSpacingForSectionAt section: Int) -> CGFloat {

return 0.5
}
}

0 comments on commit b4d53a8

Please sign in to comment.