Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
“Raouf” committed Jun 6, 2023
1 parent ea24c2b commit eda61d7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
19 changes: 19 additions & 0 deletions WDFrameWorkIOS/Classes/Storyboard/Order.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,23 @@
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yAs-Yo-ijb">
<rect key="frame" x="0.0" y="84" width="335" height="0.0"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Total" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="erz-Wi-SFU">
<rect key="frame" x="0.0" y="0.0" width="31.5" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.30196078430000001" green="0.30196078430000001" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="0.0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Ug-lW-aVd">
<rect key="frame" x="31.5" y="0.0" width="303.5" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.30196078430000001" green="0.30196078430000001" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
Expand All @@ -581,6 +598,8 @@
<connections>
<outlet property="quantityLabel" destination="03a-Vk-Zvj" id="2Sl-iy-cnl"/>
<outlet property="subTotalLabel" destination="bFH-W5-Ctd" id="xdT-kk-BbQ"/>
<outlet property="totalLbl" destination="erz-Wi-SFU" id="Kij-qz-pJH"/>
<outlet property="totalValueLbl" destination="1Ug-lW-aVd" id="gdl-AO-pdB"/>
<outlet property="vatTitlelbl" destination="LJ8-MG-Zge" id="R0K-kD-EaU"/>
<outlet property="vatValueLbl" destination="NV0-2v-m7j" id="B51-6C-aAn"/>
</connections>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,13 @@ extension STCartViewController{
func setupNavigationBar(){
let iconImage:UIImage? = UIImage.getFontAwaseomImage(fontName: "fas fa-trash",imageSize: CGSize(width: 30, height: 30),.darkGray)
let clearCart = UIBarButtonItem(image: iconImage, style: .plain, target: self, action: #selector(onClearCartTapped))
let backToMainApp = UIBarButtonItem(image: UIImage(named: "exit-to-app"), style: .plain, target: self, action: #selector(backToMainApp))
self.navigationItem.rightBarButtonItems = [clearCart, backToMainApp]
let exitBtn = UIButton(type: .custom)
exitBtn.setImage(UIImage(named: "exit-to-app"), for: .normal)
exitBtn.addTarget(self, action: #selector(backToMainApp), for: .touchUpInside)
exitBtn.frame = CGRect(x: 0, y: 0, width: 35, height: 31)
exitBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
let exit = UIBarButtonItem(customView: exitBtn)
self.navigationItem.rightBarButtonItems = [clearCart, exit]
}

@objc func backToMainApp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CartFooterTableViewCell: UITableViewCell,IBaseTableViewCell {
@IBOutlet weak var quantityLabel: UILabel!
@IBOutlet weak var vatTitlelbl: UILabel!
@IBOutlet weak var vatValueLbl: UILabel!
@IBOutlet weak var totalLbl: UILabel!
@IBOutlet weak var totalValueLbl: UILabel!

override func awakeFromNib() {
super.awakeFromNib()
Expand All @@ -28,9 +30,12 @@ class CartFooterTableViewCell: UITableViewCell,IBaseTableViewCell {
func configureCell(_ model: ICalOrderResponseDTODAL) {
self.quantityLabel.attributedText = setupLabels("quantity".localized(), ": \(model.itemsCount.value ?? 0) ")
self.subTotalLabel.attributedText = setupLabels("sub_total".localized(), ": \(model.subTotal.value ?? 0.0) \(model.currencyCode.value ?? "")")
let total = (model.subTotal.value ?? 0.0) + (model.taxAmount.value ?? 0.0)
self.totalValueLbl.text = "\(total) \(model.currencyCode.value ?? "")"
self.vatTitlelbl.text = "VAT".localized()
self.totalLbl.text = "Total".localized()
self.vatValueLbl.text = "\(model.taxAmount.value ?? 0.0) \(model.currencyCode.value ?? "")"
[self.subTotalLabel, self.quantityLabel, self.vatTitlelbl, vatValueLbl].forEach { label in
[self.subTotalLabel, self.quantityLabel, self.vatTitlelbl, self.vatValueLbl, self.totalLbl, self.totalValueLbl].forEach { label in
label?.font = APP_FONT_BOLD12
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ extension MenuViewController{
button.setImage(R.image.ic_cart(), for: .normal)
button.addTarget(self, action: #selector(openCartVC), for: .touchUpInside)
button.frame = CGRect(x: 0, y: 0, width: 53, height: 31)
button.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)//move image to the right
button.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
button.addSubview(self.cartCountLbl)
let barButton = UIBarButtonItem(customView: button)
let backToMainApp = UIBarButtonItem(image: UIImage(named: "exit-to-app"), style: .plain, target: self, action: #selector(backToMainApp))
self.navigationItem.rightBarButtonItems = [barButton, backToMainApp]
let exitBtn = UIButton(type: .custom)
exitBtn.setImage(UIImage(named: "exit-to-app"), for: .normal)
exitBtn.addTarget(self, action: #selector(backToMainApp), for: .touchUpInside)
exitBtn.frame = CGRect(x: 0, y: 0, width: 35, height: 31)
exitBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
let exit = UIBarButtonItem(customView: exitBtn)
self.navigationItem.rightBarButtonItems = [barButton, exit]
self.navigationItem.backBarButtonItem?.tintColor = .black
}

Expand Down

0 comments on commit eda61d7

Please sign in to comment.