Browse Source

settings

v0.17
Dibya 1 year ago
parent
commit
4037dcf60d
  1. 4
      GME Remit/Models/Response/User.swift
  2. 8
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Cell/TransferListTableViewCell.swift
  3. 4
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard
  4. 60
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift
  5. 2
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModel.swift
  6. 41
      GME Remit/Modules/SideMenu/Setting.storyboard
  7. 17
      GME Remit/Modules/SideMenu/SettingViewController.swift
  8. 2
      GME Remit/Utilities/Database/GMEDB.swift

4
GME Remit/Models/Response/User.swift

@ -112,7 +112,7 @@ class User: Mappable {
var agreeYn: String?
var referralCode: String?
var selfieDocPath: String?
var notificationCount: String?
var showInviteCode: String?
var useNFC: String?
@ -161,7 +161,7 @@ class User: Mappable {
data <- map["Data"]
kftcClientId <- map["kftcClientId"]
pennyTestStatus <- map["pennyTestStatus"]
selfieDocPath <- map["SelfieDocPath"]
accessTokenRegTime <- map["accessTokenRegTime"]
accessTokenExpTime <- map["accessTokenExpTime"]
hasVerifiedOTP <- map["hasVerifiedOTP"]

8
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Cell/TransferListTableViewCell.swift

@ -33,10 +33,12 @@ class TransferListTableViewCell: UITableViewCell {
func setModel(with model: RecentTransactions?) {
// hero.id = model?.receiverID
nameLabel.text = model?.user?.uppercased()
addtTextLabel.text = model?.payoutMode?.uppercased()
addtTextLabel.text = "\(model?.payoutAmt ?? "") \(model?.pCurr ?? "")"
dateLabel.text = model?.sendDate ?? ""
nameLabel.text = model?.user?.uppercased()
additionalTextLabel.text = model?.payoutMode?.uppercased()
statusLabel.setTitle(model?.payStatus?.uppercased() ?? "", for: .normal)
self.model = model
}

4
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard

@ -572,6 +572,9 @@
<state key="normal" title="Edit Details">
<color key="titleColor" red="0.18039215689999999" green="0.53725490200000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="didTappedEditDetailsButton:" destination="K6H-Ti-Vmr" eventType="touchUpInside" id="1MS-zr-vjO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="V4Y-CS-dqf">
<rect key="frame" x="148.5" y="0.0" width="146.5" height="31"/>
@ -632,6 +635,7 @@
</subviews>
<color key="backgroundColor" name="ThemeMainBackground"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="fv4-Df-cKH" secondAttribute="bottom" constant="55" id="5j8-JL-Imu"/>
<constraint firstItem="fv4-Df-cKH" firstAttribute="top" secondItem="10B-NZ-04W" secondAttribute="bottom" constant="12" id="7Et-4J-JL8"/>
<constraint firstItem="fv4-Df-cKH" firstAttribute="leading" secondItem="bhj-7t-TFt" secondAttribute="leading" constant="20" symbolic="YES" id="Ghd-gX-nYW"/>
<constraint firstItem="10B-NZ-04W" firstAttribute="leading" secondItem="bhj-7t-TFt" secondAttribute="leading" constant="24" id="M1A-8j-vpc"/>

60
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift

@ -142,7 +142,7 @@ extension RecipientsViewController {
fetchTrigger: viewWillAppear,
refreshTrigger: tableView.refreshControl!.rx.controlEvent(.valueChanged).asDriver(),
// addTrigger: addRecipientTapGestureRecognizer.rx.event.mapToVoid().asDriverOnErrorJustComplete(),
selectTrigger: tableView.rx.itemSelected.asDriver(),
// selectTrigger: tableView.rx.itemSelected.asDriver(),
editTrigger: editTrigger.asDriverOnErrorJustComplete(),
deleteTrigger: deleteTrigger.asDriverOnErrorJustComplete(),
needEditTrigger: needEditTrigger.asDriverOnErrorJustComplete(),
@ -181,9 +181,10 @@ extension RecipientsViewController {
.transactions.drive(
onNext: {[weak self] _ in guard let `self` = self else { return }
DispatchQueue.main.async {
self.tableView.reloadData()
self.viewWillLayoutSubviews()
}
self.tableView.reloadData()
}
).disposed(by: disposeBag)
@ -193,10 +194,25 @@ extension RecipientsViewController {
tableView.rx.items(cellIdentifier: "TransferListTableViewCell")
) { [weak self] (_, element: RecentTransactions, cell: TransferListTableViewCell) in
guard let `self` = self else { return }
cell.selectionStyle = .none
cell.setModel(with: element)
cell.didTappedEditDetails = { [weak self] model in
let recipientModel = Recipient(
firstName: model?.user,
middleName: "",
lastName: "",
localFirstName: model?.user,
localMiddleName: "",
localLastName: "",
localFullName: model?.user,
fullName: model?.user,
address: "",
city: "",
email: "",
mobile: "",
idNumber: ""
)
self?.editTrigger.onNext(recipientModel)
}
// cell.hero.modifiers = [.fade, .scale(0.7)]
// cell.delegate = self
@ -267,24 +283,24 @@ extension RecipientsViewController: UITableViewDelegate {
view.endEditing(true)
}
}
// MARK: - RecipientCellDelegate
extension RecipientsViewController: RecipientCellDelegate {
func edit(didSelect model: Recipient?) {
guard let model = model else { return }
self.editTrigger.onNext(model)
}
func delete(didSelect model: Recipient?) {
self.alertWithOkCancel(
message: "delete_recipient_confirmation_text".localized(),
title: "alert_text".localized(),
okAction: {
guard let model = model else { return }
self.deleteTrigger.onNext(model)
})
}
}
//
//// MARK: - RecipientCellDelegate
//extension RecipientsViewController: RecipientCellDelegate {
// func edit(didSelect model: Recipient?) {
//// guard let model = model else { return }
//// self.editTrigger.onNext(model)
// }
//
// func delete(didSelect model: Recipient?) {
// self.alertWithOkCancel(
// message: "delete_recipient_confirmation_text".localized(),
// title: "alert_text".localized(),
// okAction: {
// guard let model = model else { return }
// self.deleteTrigger.onNext(model)
// })
// }
//}
extension RecipientsViewController: UICollectionViewDelegate, UICollectionViewDataSource {

2
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModel.swift

@ -16,7 +16,7 @@ class RecipientsViewModel: ViewModelType {
let fetchTrigger: Driver<Void>
let refreshTrigger: Driver<Void>
// let addTrigger: Driver<Void>
let selectTrigger: Driver<IndexPath>
// let selectTrigger: Driver<IndexPath>
let editTrigger: Driver<Recipient>
let deleteTrigger: Driver<Recipient>
let needEditTrigger: Driver<Void>

41
GME Remit/Modules/SideMenu/Setting.storyboard

@ -517,8 +517,48 @@
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MCI-h0-0pJ">
<rect key="frame" x="0.0" y="990" width="375" height="110"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="xb8-n1-VS1">
<rect key="frame" x="85" y="16" width="205.5" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Privacy Policy" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l58-BR-HAn">
<rect key="frame" x="0.0" y="0.0" width="82.5" height="20"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/>
<color key="textColor" name="ThemeBlack"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Q3-YQ-PHv">
<rect key="frame" x="90.5" y="0.0" width="8" height="20"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eJr-zw-D8V">
<rect key="frame" x="0.0" y="6" width="8" height="8"/>
<color key="backgroundColor" red="0.1803921568627451" green="0.53725490196078429" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="8" id="A83-KX-pUq"/>
<constraint firstAttribute="height" constant="8" id="l2s-cB-EWA"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="width" constant="8" id="2XP-WX-FDU"/>
<constraint firstItem="eJr-zw-D8V" firstAttribute="centerX" secondItem="1Q3-YQ-PHv" secondAttribute="centerX" id="fZA-Rw-yIi"/>
<constraint firstAttribute="height" constant="20" id="hjd-Ai-fgb"/>
<constraint firstItem="eJr-zw-D8V" firstAttribute="centerY" secondItem="1Q3-YQ-PHv" secondAttribute="centerY" id="z9M-GK-gDf"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Service" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uxy-sK-c2G">
<rect key="frame" x="106.5" y="0.0" width="99" height="20"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/>
<color key="textColor" name="ThemeBlack"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="xb8-n1-VS1" firstAttribute="centerX" secondItem="MCI-h0-0pJ" secondAttribute="centerX" id="9jg-WB-iVi"/>
<constraint firstItem="xb8-n1-VS1" firstAttribute="top" secondItem="MCI-h0-0pJ" secondAttribute="top" constant="16" id="QJC-dy-SSx"/>
<constraint firstAttribute="height" constant="110" id="li5-Et-Tk3"/>
</constraints>
</view>
@ -560,6 +600,7 @@
<size key="freeformSize" width="375" height="1100"/>
<connections>
<outlet property="changePinButton" destination="ell-Za-mW4" id="YHc-0j-2ee"/>
<outlet property="pinView" destination="eJr-zw-D8V" id="1S7-ki-e1j"/>
<outlet property="profileImage" destination="rAk-ou-5gw" id="Sdh-qW-VEi"/>
<outlet property="settingTopBackgroundView" destination="b6D-W4-RD7" id="or3-MR-eY1"/>
<outlet property="useBiometricAuthSwitch" destination="zDc-hB-WUE" id="ovO-KD-9xo"/>

17
GME Remit/Modules/SideMenu/SettingViewController.swift

@ -8,6 +8,7 @@
import UIKit
import Localize_Swift
import SDWebImage
class SettingViewController: UIViewController {
@ -52,7 +53,7 @@ class SettingViewController: UIViewController {
GMEDB.shared.app.set(code, .firstTimeLanguageIsSet)
}
}
var status: Bool!
var status: Bool!
// @IBOutlet weak var settingLabel: UILabel!
// @IBOutlet weak var changePasswordButton: UIButton!
@ -69,7 +70,12 @@ class SettingViewController: UIViewController {
profileImage.sizeToFit()
}
}
@IBOutlet weak var pinView: UIView! {
didSet{
pinView.clipsToBounds = true
pinView.layer.cornerRadius = pinView.frame.width/2
}
}
@IBAction func logoutTapped(_ sender: UIButton) {
alertWithOkCancel(
type: .normal,
@ -84,6 +90,7 @@ class SettingViewController: UIViewController {
@IBAction func uploadProfileTapped(_ sender: UIButton) {
self.multiMediaManager?.openPicker(mode: UIImagePickerController.CameraCaptureMode.photo)
}
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(
@ -92,9 +99,13 @@ class SettingViewController: UIViewController {
name: NSNotification.Name(LCLLanguageChangeNotification),
object: nil
)
multiMediaManager = MultiMediaManager(presenter: self)
multiMediaManager?.delegate = self
let image = GMEDB.shared.user.string(.profileImage) ?? ""
profileImage.sd_setImage(with: URL(string: image), placeholderImage: UIImage(named: "round-person"))
setupLanguages()
configureLanguage()
@ -189,7 +200,7 @@ class SettingViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {

2
GME Remit/Utilities/Database/GMEDB.swift

@ -68,6 +68,7 @@ class GMEDB {
case notificationCount
case showInviteCode
case rewardPoints
case profileImage
}
enum AppKey: String, KeyProtocol {
@ -115,6 +116,7 @@ extension GMEDB {
.set(user?.dpUrl, .dpUrl)
.set(user?.walletNumber, .walletNumber)
.set(user?.primaryBankName, .primaryBankName)
.set(user?.selfieDocPath, .profileImage)
self.user
.set(fullName, .fullName)

Loading…
Cancel
Save