Manos Chorianopoulos

fix button insets

......@@ -73,14 +73,16 @@ import SwiftEventBus
redeemButton.setTitleColor(.white, for: .normal)
redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
redeemButton.layer.cornerRadius = 12.0
redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44)
redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
}
......
......@@ -119,28 +119,32 @@ import AVFoundation
redeemButton.setTitleColor(.white, for: .normal)
redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
redeemButton.layer.cornerRadius = 12.0
redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44)
redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
mapButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
mapButton.setTitle("Δες τα καταστήματα", for: .normal)
mapButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal)
mapButton.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
mapButton.layer.cornerRadius = 12.0
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
mapButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// mapButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
termsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Regular", size: 16)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
......
......@@ -79,16 +79,18 @@ import SwiftEventBus
redeemButton.setTitleColor(.white, for: .normal)
redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
redeemButton.layer.cornerRadius = 12.0
redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44)
redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 19)
redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 19)
// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
termsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
......
......@@ -100,14 +100,16 @@ import SwiftEventBus
redeemButton.setTitleColor(.white, for: .normal)
redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
redeemButton.layer.cornerRadius = 12.0
redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44)
redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
}
......
......@@ -93,14 +93,17 @@ import SwiftEventBus
activateButton.setTitleColor(.white, for: .normal)
activateButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
activateButton.layer.cornerRadius = 12.0
activateButton.frame = CGRect(x: 0.0, y: 0.0, width: activateButton.intrinsicContentSize.width, height: 44)
activateButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
// Fix width for ipad
if UIDevice.current.userInterfaceIdiom == .pad {
// iPad
activateButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
} else {
// not iPad (iPhone, mac, tv, carPlay, unspecified)
activateButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
}
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// activateButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// activateButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
moreButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Regular", size: 16)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
......