Browse Source

remove animation of each cell (reward product, order history)

image download use another gcd
pull/1/head
james 5 years ago
parent
commit
3adc3abc24
  1. 8
      GMERemittance/Library/CountryWithCurrencyPicker/TableViewPicker.storyboard
  2. 2
      GMERemittance/Library/CountryWithFlagPicker/CountryPicker.storyboard
  3. 1
      GMERemittance/Library/CurrencyPicker/CurrencyPicker.storyboard
  4. 7
      GMERemittance/Library/ItemPickerView/ItemsPicker.storyboard
  5. 7
      GMERemittance/Module/RewardModules/OrderHistory/User Interface/View/OrderHistoryViewController.swift
  6. 17
      GMERemittance/Module/RewardModules/Reward/User Interface/View/Cell/RewardItemCollectionViewCell.swift
  7. 21
      GMERemittance/Module/RewardModules/Reward/User Interface/View/RewardViewController.swift

8
GMERemittance/Library/CountryWithCurrencyPicker/TableViewPicker.storyboard

@ -116,10 +116,10 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="W99-fc-7xF"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="W99-fc-7xF">
<rect key="frame" x="5" y="5" width="305" height="33.5"/>
<rect key="frame" x="5" y="5" width="305" height="34"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6kC-9f-Tap"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6kC-9f-Tap">
<rect key="frame" x="65" y="8.5" width="182" height="16.5"/>
<rect key="frame" x="65" y="9" width="182" height="16.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <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="Roboto-Regular" family="Roboto" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -155,7 +155,7 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AR6-jS-KPe" userLabel="Seperator"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AR6-jS-KPe" userLabel="Seperator">
<rect key="frame" x="0.0" y="38" width="315" height="0.5"/>
<rect key="frame" x="0.0" y="38.5" width="315" height="0.5"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.5" id="AN7-gZ-zWO"/> <constraint firstAttribute="height" constant="0.5" id="AN7-gZ-zWO"/>
@ -189,7 +189,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="Dro-lA-36G"/> <constraint firstAttribute="height" constant="44" id="Dro-lA-36G"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Button"> <state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>

2
GMERemittance/Library/CountryWithFlagPicker/CountryPicker.storyboard

@ -189,7 +189,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="wxW-LL-Hct"/> <constraint firstAttribute="height" constant="44" id="wxW-LL-Hct"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="18"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Close"> <state key="normal" title="Close">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>

1
GMERemittance/Library/CurrencyPicker/CurrencyPicker.storyboard

@ -188,6 +188,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="LCU-D4-6Yb"/> <constraint firstAttribute="height" constant="44" id="LCU-D4-6Yb"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Button"> <state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>

7
GMERemittance/Library/ItemPickerView/ItemsPicker.storyboard

@ -116,10 +116,10 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MFk-fP-iQc"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MFk-fP-iQc">
<rect key="frame" x="5" y="5" width="305" height="33.5"/>
<rect key="frame" x="5" y="5" width="305" height="34"/>
<subviews> <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"> <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" width="207" height="17.5"/>
<rect key="frame" x="40" y="8.5" width="207" height="17.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="15"/> <fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="15"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -155,7 +155,7 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aVs-jg-plT" userLabel="Seperator"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aVs-jg-plT" userLabel="Seperator">
<rect key="frame" x="0.0" y="38" width="315" height="0.5"/>
<rect key="frame" x="0.0" y="38.5" width="315" height="0.5"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.5" id="QQL-55-X5Y"/> <constraint firstAttribute="height" constant="0.5" id="QQL-55-X5Y"/>
@ -188,6 +188,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="du1-lh-8FH"/> <constraint firstAttribute="height" constant="44" id="du1-lh-8FH"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Button"> <state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>

7
GMERemittance/Module/RewardModules/OrderHistory/User Interface/View/OrderHistoryViewController.swift

@ -248,13 +248,6 @@ extension OrderHistoryViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
presenter?.pushDetailOrder(with: orders?[indexPath.row]) presenter?.pushDetailOrder(with: orders?[indexPath.row])
} }
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.alpha = 0
UIView.animate(withDuration: 0.5) {
cell.alpha = 1
}
}
} }
// MARK: - UISearchBarDelegate // MARK: - UISearchBarDelegate

17
GMERemittance/Module/RewardModules/Reward/User Interface/View/Cell/RewardItemCollectionViewCell.swift

@ -21,11 +21,20 @@ class RewardItemCollectionViewCell: UICollectionViewCell {
var delegate: RewardViewInterface? var delegate: RewardViewInterface?
func setModel(with model: RewardProduct?, delegate: RewardViewInterface?){ func setModel(with model: RewardProduct?, delegate: RewardViewInterface?){
if let imageData = model?.productImgPath,
let url = URL(string: imageData),
let data = try? Data(contentsOf: url) {
self.itemImage.image = UIImage(data: data)
DispatchQueue.global().async {
if let imageData = model?.productImgPath,
let url = URL(string: imageData),
let data = try? Data(contentsOf: url) {
DispatchQueue.main.async {[weak self] in
guard let `self` = self else {
return
}
self.itemImage.image = UIImage(data: data)
}
}
} }
self.itemNameLabel.text = model?.productName self.itemNameLabel.text = model?.productName
self.itemPriceLabel.text = model?.pointPrice self.itemPriceLabel.text = model?.pointPrice

21
GMERemittance/Module/RewardModules/Reward/User Interface/View/RewardViewController.swift

@ -18,7 +18,6 @@ class RewardViewController: UIViewController {
private var models: [RewardProduct]? { private var models: [RewardProduct]? {
didSet { didSet {
collectionView.reloadData() collectionView.reloadData()
collectionView.setContentOffset(.zero, animated: false)
} }
} }
@ -48,7 +47,9 @@ class RewardViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
title = "reward_group_title_text".localized() title = "reward_group_title_text".localized()
presenter?.viewIsReady()
collectionView.setContentOffset(.zero, animated: false)
rewardPoint = UserDefaults.standard.string(forKey: UserKeys.rewardPoint) rewardPoint = UserDefaults.standard.string(forKey: UserKeys.rewardPoint)
} }
@ -68,12 +69,11 @@ class RewardViewController: UIViewController {
setCollectionViewLayout() setCollectionViewLayout()
addRefreshControlCollectionView() addRefreshControlCollectionView()
setMultiLanguage() setMultiLanguage()
rewardPointContainerView.hero.id = "pointsView" rewardPointContainerView.hero.id = "pointsView"
presenter?.viewIsReady()
} }
private func setDelegate(){ private func setDelegate(){
collectionView.delegate = self
collectionView.dataSource = self collectionView.dataSource = self
} }
@ -155,19 +155,6 @@ extension RewardViewController: RewardViewInterface {
} }
} }
extension RewardViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
cell.alpha = 0
// cell.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
// cell.transform = CGAffineTransform(translationX: (view.frame.width - 20) / 2 - 3.5, y: 0)
UIView.animate(withDuration: 0.5) {
cell.alpha = 1
// cell.transform = .identity
}
}
}
extension RewardViewController: UICollectionViewDataSource { extension RewardViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return models?.count ?? 0 return models?.count ?? 0

Loading…
Cancel
Save