This repository has been archived by the owner. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Modified TrayToolbar for Cliqz branding
- Removed delete button - Moved `New Tab` button in the middle - Added `Done` button to the right with Long press gesture to close all tabs - Changed the look and feel of the private mode button - Changed coloring for toolbar and tab tray toolbar
- Loading branch information
Showing
with
225 additions
and 0 deletions.
- +20 −0 Client.xcodeproj/project.pbxproj
- +3 −0 Client/Frontend/Browser/BrowserTrayAnimators.swift
- +9 −0 Client/Frontend/Browser/TabToolbar.swift
- +69 −0 Client/Frontend/Browser/TabTrayController.swift
- +15 −0 Cliqz/Extensions/ColorExtension.swift
- +23 −0 Cliqz/Resources/Cliqz.xcassets/TabToolbar/cliqz-nav-add.imageset/Contents.json
- BIN Cliqz/Resources/Cliqz.xcassets/TabToolbar/cliqz-nav-add.imageset/plus.png
- BIN Cliqz/Resources/Cliqz.xcassets/TabToolbar/cliqz-nav-add.imageset/plus@2x.png
- BIN Cliqz/Resources/Cliqz.xcassets/TabToolbar/cliqz-nav-add.imageset/plus@3x.png
- +37 −0 Cliqz/Tab Tray/CliqzForgetModeButton.swift
- +22 −0 Cliqz/Tab Tray/TabTrayControllerExtension.swift
- +27 −0 Cliqz/Tab Tray/TabTrayDoneButton.swift
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "plus.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "plus@2x.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "plus@3x.png", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,37 @@ | ||
| // | ||
| // CliqzForgetModeButton.swift | ||
| // Client | ||
| // | ||
| // Created by Mahmoud Adam on 4/23/18. | ||
| // Copyright © 2018 Cliqz. All rights reserved. | ||
| // | ||
| import UIKit | ||
| import QuartzCore | ||
|
|
||
| class CliqzForgetModeButton: UIButton, Themeable { | ||
| override init(frame: CGRect) { | ||
| super.init(frame: frame) | ||
| setTitle(NSLocalizedString("Forget", tableName: "Cliqz", comment: "Forget toogle button in tab overview"), for: []) | ||
| self.accessibilityIdentifier = "TabTrayController.forgetModeButton" | ||
| self.layer.cornerRadius = 5.0 | ||
| self.layer.masksToBounds = true | ||
| } | ||
|
|
||
| required init?(coder aDecoder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| func applyTheme(_ theme: Theme) { | ||
| setTitleColor(UIColor.CliqzTabTray.ButtonText.colorFor(theme), for: []) | ||
| } | ||
|
|
||
| func setSelected(_ selected: Bool, animated: Bool = true) { | ||
| self.isSelected = selected | ||
| let duration = animated ? 0.4 : 0.0 | ||
| UIView.transition(with: self, duration:duration, options: .curveEaseInOut, animations: { | ||
| self.backgroundColor = selected ? UIColor.cliqzBluePrimary : UIColor.clear | ||
| }) | ||
| } | ||
|
|
||
| } |
| @@ -0,0 +1,22 @@ | ||
| // | ||
| // TabTrayControllerExtension.swift | ||
| // Client | ||
| // | ||
| // Created by Mahmoud Adam on 4/20/18. | ||
| // Copyright © 2018 Cliqz. All rights reserved. | ||
| // | ||
| import UIKit | ||
|
|
||
| extension TabTrayController { | ||
|
|
||
| func didTapDone() { | ||
| _ = self.navigationController?.popViewController(animated: true) | ||
| } | ||
|
|
||
| func SELlongPressDoneButton(_ recognizer: UILongPressGestureRecognizer) { | ||
| if recognizer.state == .began { | ||
| self.didTapDelete(self.toolbar.doneButton) | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,27 @@ | ||
| // | ||
| // TabTrayDoneButton.swift | ||
| // Client | ||
| // | ||
| // Created by Mahmoud Adam on 5/3/18. | ||
| // Copyright © 2018 Cliqz. All rights reserved. | ||
| // | ||
| import UIKit | ||
|
|
||
| class TabTrayDoneButton: UIButton, Themeable { | ||
|
|
||
| override init(frame: CGRect) { | ||
| super.init(frame: frame) | ||
| let title = NSLocalizedString("Done", tableName: "Cliqz", comment: "Done button in the tabTray Toolbar") | ||
| setTitle(title, for: .normal) | ||
| accessibilityIdentifier = "TabTrayController.doneButton" | ||
| } | ||
|
|
||
| required init?(coder aDecoder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| func applyTheme(_ theme: Theme) { | ||
| setTitleColor(UIColor.CliqzTabTray.ButtonText.colorFor(theme), for: []) | ||
| } | ||
| } |