mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Finish home screen redesign
This commit is contained in:
parent
8999462776
commit
a292aedf7b
|
@ -63,13 +63,25 @@ final class HomeVC : UIViewController, UITableViewDataSource, UITableViewDelegat
|
||||||
searchBar.sizeToFit()
|
searchBar.sizeToFit()
|
||||||
tableView.contentOffset = CGPoint(x: 0, y: searchBar.frame.height)
|
tableView.contentOffset = CGPoint(x: 0, y: searchBar.frame.height)
|
||||||
// Set up new conversation button
|
// Set up new conversation button
|
||||||
// let newConversationButton = UIImageView(image: #imageLiteral(resourceName: "ic_plus_24").asTintedImage(color: UIColor(hex: 0x121212)))
|
let newConversationButton = UIButton()
|
||||||
// newConversationButton.backgroundColor = Colors.accent
|
newConversationButton.setTitle("+", for: UIControl.State.normal)
|
||||||
// newConversationButton.set(.width, to: Values.newConversationButtonSize)
|
newConversationButton.titleLabel!.font = .systemFont(ofSize: 35)
|
||||||
// newConversationButton.set(.height, to: Values.newConversationButtonSize)
|
newConversationButton.setTitleColor(UIColor(hex: 0x121212), for: UIControl.State.normal)
|
||||||
// view.addSubview(newConversationButton)
|
newConversationButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 1, bottom: 4, right: 0) // Slight adjustment to make the plus exactly centered
|
||||||
// newConversationButton.center(.horizontal, in: view)
|
newConversationButton.backgroundColor = Colors.accent
|
||||||
// newConversationButton.center(.vertical, in: view)
|
let newConversationButtonSize = Values.newConversationButtonSize
|
||||||
|
newConversationButton.layer.cornerRadius = newConversationButtonSize / 2
|
||||||
|
newConversationButton.layer.shadowPath = UIBezierPath(ovalIn: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: newConversationButtonSize, height: newConversationButtonSize))).cgPath
|
||||||
|
newConversationButton.layer.shadowColor = Colors.newConversationButtonShadow.cgColor
|
||||||
|
newConversationButton.layer.shadowOffset = CGSize(width: 0, height: 0.8)
|
||||||
|
newConversationButton.layer.shadowOpacity = 1
|
||||||
|
newConversationButton.layer.shadowRadius = 6
|
||||||
|
newConversationButton.layer.masksToBounds = false
|
||||||
|
newConversationButton.set(.width, to: newConversationButtonSize)
|
||||||
|
newConversationButton.set(.height, to: newConversationButtonSize)
|
||||||
|
view.addSubview(newConversationButton)
|
||||||
|
newConversationButton.center(.horizontal, in: view)
|
||||||
|
newConversationButton.pin(.bottom, to: .bottom, of: view, withInset: -Values.newConversationButtonBottomOffset) // Negative due to how the constraint is set up
|
||||||
// Set up previewing
|
// Set up previewing
|
||||||
if (traitCollection.forceTouchCapability == .available) {
|
if (traitCollection.forceTouchCapability == .available) {
|
||||||
registerForPreviewing(with: self, sourceView: tableView)
|
registerForPreviewing(with: self, sourceView: tableView)
|
||||||
|
|
|
@ -21,4 +21,5 @@ final class Colors : NSObject {
|
||||||
@objc static let navigationBarBackground = UIColor(hex: 0x161616)
|
@objc static let navigationBarBackground = UIColor(hex: 0x161616)
|
||||||
@objc static let searchBarPlaceholder = UIColor(hex: 0x8E8E93) // Also used for the icons
|
@objc static let searchBarPlaceholder = UIColor(hex: 0x8E8E93) // Also used for the icons
|
||||||
@objc static let searchBarBackground = UIColor(red: 142 / 255, green: 142 / 255, blue: 147 / 255, alpha: 0.12)
|
@objc static let searchBarBackground = UIColor(red: 142 / 255, green: 142 / 255, blue: 147 / 255, alpha: 0.12)
|
||||||
|
@objc static let newConversationButtonShadow = UIColor(hex: 0x077C44)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,5 @@ final class Values : NSObject {
|
||||||
@objc static let smallSpacing = CGFloat(8)
|
@objc static let smallSpacing = CGFloat(8)
|
||||||
@objc static let mediumSpacing = CGFloat(16)
|
@objc static let mediumSpacing = CGFloat(16)
|
||||||
@objc static let largeSpacing = CGFloat(24)
|
@objc static let largeSpacing = CGFloat(24)
|
||||||
|
@objc static let newConversationButtonBottomOffset = CGFloat(52)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue