Browse Source

Merge branch 'developer'

pull/1/head
InKwon James Kim 5 years ago
parent
commit
9aaec6a964
  1. 2
      GMERemittance/Info.plist
  2. 44
      GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPicker.storyboard
  3. 29
      GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPickerViewController.swift
  4. 2
      GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift

2
GMERemittance/Info.plist

@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>

44
GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPicker.storyboard

@ -13,9 +13,6 @@
<array key="Roboto-MediumItalic.ttf">
<string>Roboto-MediumItalic</string>
</array>
<array key="Roboto-Regular.ttf">
<string>Roboto-Regular</string>
</array>
<array key="SanFranciscoDisplay-Regular.otf">
<string>SanFranciscoDisplay-Regular</string>
</array>
@ -39,7 +36,7 @@
<rect key="frame" x="20" y="113.5" width="335" height="533.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="lkk-y6-gJJ">
<rect key="frame" x="10" y="5" width="315" height="89"/>
<rect key="frame" x="10" y="5" width="315" height="44"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bm0-Pj-YxX">
<rect key="frame" x="0.0" y="0.0" width="315" height="44"/>
@ -60,21 +57,11 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lpT-m6-5uw">
<rect key="frame" x="0.0" y="44" width="315" height="45"/>
<rect key="frame" x="0.0" y="44" width="315" height="0.0"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_search" translatesAutoresizingMaskIntoConstraints="NO" id="RIp-kl-uTl">
<rect key="frame" x="0.0" y="0.0" width="40" height="45"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="wa4-T1-Y7p"/>
</constraints>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Search Branch" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Sm6-Yq-rdj" customClass="TextfieldWithSearchIcon" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="40" y="0.0" width="275" height="45"/>
<textField hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Search Branch" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Sm6-Yq-rdj" customClass="TextfieldWithSearchIcon" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="0.0" height="19"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="fPa-KH-52C"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
@ -85,7 +72,7 @@
</subviews>
</stackView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" allowsMultipleSelection="YES" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="obU-jk-2i1">
<rect key="frame" x="10" y="99" width="315" height="370.5"/>
<rect key="frame" x="10" y="54" width="315" height="415.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" red="0.87450980389999999" green="0.87450980389999999" blue="0.87450980389999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -116,9 +103,9 @@
<rect key="frame" x="5" y="5" width="305" height="33.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5cS-2x-QvM">
<rect key="frame" x="40" y="8.5" width="207" height="16.5"/>
<rect key="frame" x="40" y="8.5" width="207" height="17"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
@ -151,23 +138,13 @@
<constraint firstItem="5cS-2x-QvM" firstAttribute="leading" secondItem="b4b-um-EnV" secondAttribute="trailing" id="xfa-gL-5vd"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aVs-jg-plT" userLabel="Seperator">
<rect key="frame" x="0.0" y="38" width="315" height="0.5"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="QQL-55-X5Y"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="MFk-fP-iQc" firstAttribute="top" secondItem="0jM-Ad-6f3" secondAttribute="top" constant="5" id="7oP-HX-Fsv"/>
<constraint firstAttribute="trailing" secondItem="MFk-fP-iQc" secondAttribute="trailing" constant="5" id="BZb-qr-aGc"/>
<constraint firstAttribute="bottom" secondItem="MFk-fP-iQc" secondAttribute="bottom" constant="5" id="LyB-cE-ccu"/>
<constraint firstItem="aVs-jg-plT" firstAttribute="bottom" secondItem="MFk-fP-iQc" secondAttribute="bottom" id="ThW-Jc-kGf"/>
<constraint firstAttribute="trailing" secondItem="aVs-jg-plT" secondAttribute="trailing" id="a8T-2p-hft"/>
<constraint firstItem="MFk-fP-iQc" firstAttribute="leading" secondItem="0jM-Ad-6f3" secondAttribute="leading" constant="5" id="mGH-au-GWh"/>
<constraint firstItem="aVs-jg-plT" firstAttribute="leading" secondItem="0jM-Ad-6f3" secondAttribute="leading" id="qs2-FG-Bbq"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@ -180,7 +157,7 @@
</prototypes>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="please type the name of your branch. Name should be at least 3 characters long." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J89-w4-XeB">
<rect key="frame" x="10" y="194" width="315" height="29"/>
<rect key="frame" x="10" y="149" width="315" height="29"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="12"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -204,7 +181,6 @@
<constraint firstItem="J89-w4-XeB" firstAttribute="top" secondItem="lkk-y6-gJJ" secondAttribute="bottom" constant="100" id="2GC-Mz-yhS"/>
<constraint firstItem="lkk-y6-gJJ" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" constant="10" id="5FA-LB-Q71"/>
<constraint firstAttribute="trailing" secondItem="5jc-tK-oTc" secondAttribute="trailing" constant="10" id="8kC-tx-gzG"/>
<constraint firstAttribute="height" constant="533.5" id="F3N-Vp-MLS"/>
<constraint firstAttribute="bottom" secondItem="5jc-tK-oTc" secondAttribute="bottom" constant="10" id="P0a-g3-eXp"/>
<constraint firstItem="lkk-y6-gJJ" firstAttribute="top" secondItem="IA2-r7-puo" secondAttribute="top" constant="5" id="ZEX-3U-QRk"/>
<constraint firstAttribute="trailing" secondItem="J89-w4-XeB" secondAttribute="trailing" constant="10" id="dix-UA-j0a"/>
@ -224,6 +200,8 @@
<constraint firstItem="IA2-r7-puo" firstAttribute="leading" secondItem="hQv-gh-5cz" secondAttribute="leading" constant="20" id="DDG-4u-4Ym"/>
<constraint firstAttribute="trailing" secondItem="IA2-r7-puo" secondAttribute="trailing" constant="20" id="FfM-Rd-OpC"/>
<constraint firstAttribute="bottom" secondItem="IA2-r7-puo" secondAttribute="bottom" constant="20" id="Lqm-n6-fpp"/>
<constraint firstItem="IA2-r7-puo" firstAttribute="height" secondItem="hQv-gh-5cz" secondAttribute="height" multiplier="0.8:1" id="Psu-vu-b93"/>
<constraint firstItem="IA2-r7-puo" firstAttribute="leading" secondItem="hQv-gh-5cz" secondAttribute="leading" constant="20" id="YYI-Kd-wTP"/>
</constraints>
</view>
</subviews>
@ -238,7 +216,6 @@
</view>
<connections>
<outlet property="cancelButton" destination="5jc-tK-oTc" id="mg6-k7-5GW"/>
<outlet property="height" destination="F3N-Vp-MLS" id="dtl-d8-6iH"/>
<outlet property="infoLabel" destination="J89-w4-XeB" id="nsf-RO-XfY"/>
<outlet property="mainview" destination="IA2-r7-puo" id="pHW-C8-CNR"/>
<outlet property="noResultFoundLabel" destination="bAs-K2-xyK" id="JiR-4m-mFb"/>
@ -255,7 +232,6 @@
</scene>
</scenes>
<resources>
<image name="ic_search" width="14" height="14"/>
<image name="right" width="22" height="22"/>
</resources>
</document>

29
GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPickerViewController.swift

@ -46,39 +46,23 @@ class BankBranchPickerViewController: UIViewController {
@IBOutlet weak var mainview: UIView!
@IBOutlet weak var infoLabel: UILabel!
@IBOutlet weak var cancelButton: UIButton!
@IBOutlet weak var height: NSLayoutConstraint!
@IBOutlet weak var transparentView: UIView!
private var dynamicHeight: CGFloat = 0
var data: [SendMoneyBankBranch] = [] {
didSet {
self.tableVIew.reloadData()
dynamicHeight = CGFloat(153 + 44 * (data.count + 1))
if dynamicHeight < view.frame.height * 0.5 {
dynamicHeight = view.frame.height * 0.5
} else if dynamicHeight > view.frame.height * 0.8 {
dynamicHeight = view.frame.height * 0.8
}
if height != nil {
height.constant = dynamicHeight
}
}
}
var data: [SendMoneyBankBranch]? = []
var countryCode: String?
var bankId: String?
var selectedData : SendMoneyBankBranch?
var filteredPlaces: [SendMoneyBankBranch] = [] {
var filteredPlaces: [SendMoneyBankBranch]? = [] {
didSet {
self.tableVIew.reloadData()
self.setNoResultText()
self.filteredPlaces.isEmpty ? (self.noResultFoundLabel.isHidden = false) : (self.noResultFoundLabel.isHidden = true)
self.filteredPlaces?.isEmpty ?? true ? (self.noResultFoundLabel.isHidden = false) : (self.noResultFoundLabel.isHidden = true)
}
}
@ -119,7 +103,6 @@ class BankBranchPickerViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setTitle()
height.constant = dynamicHeight
mainview.bottomToOrigin()
}
private func setNoResultText() {
@ -245,7 +228,7 @@ extension BankBranchPickerViewController: UITableViewDelegate {
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.selectedData = filteredPlaces.elementAt(index: indexPath.row)
self.selectedData = filteredPlaces?.elementAt(index: indexPath.row)
if !self.allowMultipleSelection {
self.close(nil)
}
@ -264,12 +247,12 @@ extension BankBranchPickerViewController: UITableViewDataSource {
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return filteredPlaces.count
return filteredPlaces?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableVIew.dequeueReusableCell(withIdentifier: "BankBranchPickerCell", for: indexPath) as! BankBranchPickerCell
cell.place = self.filteredPlaces.elementAt(index: indexPath.row)?.name
cell.place = self.filteredPlaces?.elementAt(index: indexPath.row)?.name
cell.setup()
return cell
}

2
GMERemittance/Module/SendMoneyModules/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift

@ -311,11 +311,13 @@ class SendMoneyPaymentModeViewController: UIViewController {
private func showBranchPickerView() {
let viewcontroller = self.getBankBranchPickerViewController()
viewcontroller.data = selectedBank?.branches
viewcontroller.type = PickerTitle.branch
viewcontroller.countryCode = self.recipient?.countryCode ?? ""
viewcontroller.bankId = self.selectedBank?.id ?? ""
viewcontroller.doneAction = self.branchSelected
viewcontroller.defaultSelectedData = [self.selectedBranch]
self.present(viewcontroller, animated: true, completion: nil)
}

Loading…
Cancel
Save