Browse Source

notice read icon updated

pull/1/head
Dibya Malla 3 years ago
parent
commit
e9ee9275b6
  1. 2
      GME Remit/Extensions/DataRequest+Ext.swift
  2. 24
      GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift
  3. 23
      GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard

2
GME Remit/Extensions/DataRequest+Ext.swift

@ -49,7 +49,7 @@ extension DataRequest {
case .failure(let error): case .failure(let error):
debugPrint("DataRequest Error: \(error.localizedDescription)") debugPrint("DataRequest Error: \(error.localizedDescription)")
if (response.response?.statusCode ?? -1) == 401 { if (response.response?.statusCode ?? -1) == 401 {
MainWireframe.logoutWarningAlert(message: "\(error.localizedDescription)")
MainWireframe.logoutWarningAlert(message: "You have logged in from another device.")
return return
} }
failure(error) failure(error)

24
GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationCell.swift

@ -9,17 +9,19 @@
import UIKit import UIKit
class NotificationCell: UITableViewCell { class NotificationCell: UITableViewCell {
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var dateLabel: UILabel!
@IBOutlet private weak var newIconImageView: UIImageView!
func setModel(_ model: NoticeModel) {
newIconImageView.isHidden = false
titleLabel.text = model.title
dateLabel.text = model.date
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var dateLabel: UILabel!
@IBOutlet private weak var newIconImageView: UIImageView!
newIconImageView.isHidden = model.isRead == "1"
}
func setModel(_ model: NoticeModel) {
titleLabel.text = model.title
dateLabel.text = model.date
if model.isRead == "1" {
newIconImageView.image = UIImage(named: "checked")
} else {
newIconImageView.image = UIImage(named: "uncheck")
}
}
} }

23
GME Remit/Modules/Notice/NotificationHistory/User Interface/View/NotificationHistory.storyboard

@ -56,15 +56,17 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="90"/> <rect key="frame" x="0.0" y="0.0" width="375" height="90"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fU1-Cn-PMg">
<rect key="frame" x="16" y="11" width="37" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="checked" translatesAutoresizingMaskIntoConstraints="NO" id="9pe-vB-1K0">
<rect key="frame" x="16" y="11" width="30" height="68"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="9VZ-g0-BTD"/>
</constraints>
</imageView> </imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="3Id-Zk-2a3"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="3Id-Zk-2a3">
<rect key="frame" x="36" y="16" width="299" height="58"/>
<rect key="frame" x="62" y="16" width="273" height="58"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="nRW-4q-6W0"> <stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="nRW-4q-6W0">
<rect key="frame" x="0.0" y="0.0" width="299" height="38"/>
<rect key="frame" x="0.0" y="0.0" width="273" height="38"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1FP-bq-7Wa"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1FP-bq-7Wa">
<rect key="frame" x="0.0" y="0.0" width="36" height="38"/> <rect key="frame" x="0.0" y="0.0" width="36" height="38"/>
@ -73,7 +75,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CcW-YB-c6O"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CcW-YB-c6O">
<rect key="frame" x="41" y="0.0" width="258" height="38"/>
<rect key="frame" x="41" y="0.0" width="232" height="38"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<color key="textColor" name="ThemeText"/> <color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -81,7 +83,7 @@
</subviews> </subviews>
</stackView> </stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dwW-XM-PeE"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dwW-XM-PeE">
<rect key="frame" x="0.0" y="38" width="299" height="20"/>
<rect key="frame" x="0.0" y="38" width="273" height="20"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="DCY-zs-RDF"/> <constraint firstAttribute="height" constant="20" id="DCY-zs-RDF"/>
</constraints> </constraints>
@ -99,17 +101,21 @@
</imageView> </imageView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="9pe-vB-1K0" firstAttribute="bottom" secondItem="jsL-8r-w5O" secondAttribute="bottomMargin" id="2I2-if-qn2"/>
<constraint firstItem="3Id-Zk-2a3" firstAttribute="leading" secondItem="9pe-vB-1K0" secondAttribute="trailing" constant="16" id="3AZ-b7-b5I"/>
<constraint firstItem="9pe-vB-1K0" firstAttribute="leading" secondItem="jsL-8r-w5O" secondAttribute="leadingMargin" id="IIw-2J-N3K"/>
<constraint firstAttribute="trailing" secondItem="afR-Xv-eGp" secondAttribute="trailing" constant="5" id="RAg-TC-MAk"/> <constraint firstAttribute="trailing" secondItem="afR-Xv-eGp" secondAttribute="trailing" constant="5" id="RAg-TC-MAk"/>
<constraint firstItem="afR-Xv-eGp" firstAttribute="top" secondItem="jsL-8r-w5O" secondAttribute="top" constant="5" id="YQb-wQ-soU"/> <constraint firstItem="afR-Xv-eGp" firstAttribute="top" secondItem="jsL-8r-w5O" secondAttribute="top" constant="5" id="YQb-wQ-soU"/>
<constraint firstItem="3Id-Zk-2a3" firstAttribute="top" secondItem="jsL-8r-w5O" secondAttribute="topMargin" constant="5" id="p0I-oM-urg"/> <constraint firstItem="3Id-Zk-2a3" firstAttribute="top" secondItem="jsL-8r-w5O" secondAttribute="topMargin" constant="5" id="p0I-oM-urg"/>
<constraint firstAttribute="bottom" secondItem="afR-Xv-eGp" secondAttribute="bottom" constant="5" id="tR3-t1-gpm"/> <constraint firstAttribute="bottom" secondItem="afR-Xv-eGp" secondAttribute="bottom" constant="5" id="tR3-t1-gpm"/>
<constraint firstItem="afR-Xv-eGp" firstAttribute="leading" secondItem="3Id-Zk-2a3" secondAttribute="trailing" constant="5" id="wqz-N9-lGz"/> <constraint firstItem="afR-Xv-eGp" firstAttribute="leading" secondItem="3Id-Zk-2a3" secondAttribute="trailing" constant="5" id="wqz-N9-lGz"/>
<constraint firstItem="3Id-Zk-2a3" firstAttribute="leading" secondItem="jsL-8r-w5O" secondAttribute="leadingMargin" constant="20" id="zkO-2c-37b"/>
<constraint firstItem="9pe-vB-1K0" firstAttribute="top" secondItem="jsL-8r-w5O" secondAttribute="topMargin" id="zu0-Nb-UL2"/>
<constraint firstAttribute="bottomMargin" secondItem="3Id-Zk-2a3" secondAttribute="bottom" constant="5" id="zw9-nN-gfO"/> <constraint firstAttribute="bottomMargin" secondItem="3Id-Zk-2a3" secondAttribute="bottom" constant="5" id="zw9-nN-gfO"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<connections> <connections>
<outlet property="dateLabel" destination="dwW-XM-PeE" id="kd7-8a-HPB"/> <outlet property="dateLabel" destination="dwW-XM-PeE" id="kd7-8a-HPB"/>
<outlet property="newIconImageView" destination="9pe-vB-1K0" id="u8u-IH-2Id"/>
<outlet property="titleLabel" destination="1FP-bq-7Wa" id="djE-Vd-glM"/> <outlet property="titleLabel" destination="1FP-bq-7Wa" id="djE-Vd-glM"/>
</connections> </connections>
</tableViewCell> </tableViewCell>
@ -161,6 +167,7 @@
</scenes> </scenes>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<resources> <resources>
<image name="checked" width="20" height="20"/>
<image name="ic_cancel" width="12" height="12"/> <image name="ic_cancel" width="12" height="12"/>
<image name="right_arrow" width="128" height="128"/> <image name="right_arrow" width="128" height="128"/>
<namedColor name="ThemeBlack"> <namedColor name="ThemeBlack">

Loading…
Cancel
Save