Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
Appstore localized closed #283
Browse files Browse the repository at this point in the history
  • Loading branch information
hamedaakhlaghi committed Jul 31, 2019
1 parent 94d01a8 commit e0983f0
Show file tree
Hide file tree
Showing 97 changed files with 1,382 additions and 300 deletions.
484 changes: 370 additions & 114 deletions MobileToken.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions MobileToken/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@


"everywhere_fail" = "با خطا مواجه شد.";

"remainingـopportunities" = "فرصت باقیمانده";
2 changes: 2 additions & 0 deletions MobileToken/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@
"bt_cancel_otp_alert" = "Cancel";

"everywhere_fail" = "Failed";

"remainingـopportunities" = "remaining opportunities";
2 changes: 2 additions & 0 deletions MobileToken/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@
"bt_cancel_otp_alert" = "Cancel";

"everywhere_fail" = "Failed";

"remainingـopportunities" = "remaining opportunities";
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AuthenticationPasswordViewController: UIViewController, UITextFieldDelegat
}

func showWrongPasswordError(remainAttemps: Int) {
let message = R.string.localizable.sb_wrong_password() + " شما \(remainAttemps) فرصت دیگر دارید "
let message = R.string.localizable.sb_wrong_pattern() + ", \(remainAttemps) " + R.string.localizable.remainingـopportunities()
UIHelper.showSpecificSnackBar(message: message, color: R.color.errorDark()!)
textFieldPassword.text = ""
dismissKeyboard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AuthenticationPatternViewController: UIViewController, AuthenticationPatte
}

func showWrongPatternError(remainAttemps:Int) {
let message = R.string.localizable.sb_wrong_pattern() + " شما \(remainAttemps) فرصت دیگر دارید "
let message = R.string.localizable.sb_wrong_pattern() + ", \(remainAttemps) " + R.string.localizable.remainingـopportunities()
UIHelper.showSpecificSnackBar(message: message, color: R.color.errorDark()!)
}

Expand Down
8 changes: 0 additions & 8 deletions MobileToken/ui/cardlist/bankcards/CardCellXibView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ class CardCellXibView: UIView {

func xibSetup() {
contentView = loadViewFromNib()

// use bounds not frame or it'll be offset
contentView.frame = bounds

// Make the view stretch with containing view
contentView.autoresizingMask = [UIView.AutoresizingMask.flexibleWidth, UIView.AutoresizingMask.flexibleHeight]

// Adding custom subview on top of our view (over any custom drawing > see note below)
addSubview(contentView)
}

Expand All @@ -48,8 +42,6 @@ class CardCellXibView: UIView {
}

func loadViewFromNib() -> UIView! {
// let bundle = Bundle(for: type(of: self))
// let nib = UINib(nibName: "CardCell", bundle: bundle)
let view = R.nib.cardCell.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
Expand Down
5 changes: 0 additions & 5 deletions MobileToken/ui/cardlist/bankcards/CardPagerViewAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class CardPagerViewAdapter:NSObject, FSPagerViewDelegate, FSPagerViewDataSource,
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: R.nib.addCardPagerViewCell.identifier, at: index) as! AddCardPagerViewCell
cell.setBank(bank: self.bank)
cell.setDelegate(addCardPagerViewCellProtocol: self)
//cell.viewCard.imageLogo.image = UIImage(named: self.bank.logoResourceId!)

return cell
}
Expand All @@ -50,16 +49,13 @@ class CardPagerViewAdapter:NSObject, FSPagerViewDelegate, FSPagerViewDataSource,
cell.vCard.labelBankName.text = BankUtil.getName(bank: self.bank)
cell.vCard.labelCardName.text = self.cardName
if bank.CardList[index-1].id == updateCard?.id {
//pagerView.scrollToItem(at: index, animated: true)
cell.setCardName(cardName: (updateCard?.cardName)!)
cardPagerViewDelegate?.selectedCard(card: updateCard!)
updateCard = nil
}
else {
cell.setCardName(cardName: bank.CardList[index-1].cardName!)
}
// cell.vCard.setDelegate(cardCellXibProtocol: self)
//cell.vCard.imageLogo.image = UIImage(named: self.bank.logoResourceId!)
cell.initDefaultView()
cell.set(card: bank.CardList[index-1])
cell.bankCardPagerViewDelegate = self
Expand All @@ -69,7 +65,6 @@ class CardPagerViewAdapter:NSObject, FSPagerViewDelegate, FSPagerViewDataSource,
}

func pagerView(_ pagerView: FSPagerView, willDisplay cell: FSPagerViewCell, forItemAt index: Int) {
// pagerView.scrollToItem(at: 1, animated: false)
}

func addCardDetail(cardName: String, selectedBank: Bank) {
Expand Down
10 changes: 0 additions & 10 deletions MobileToken/ui/cardlist/bankcards/OtpViewDesignable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,15 @@ class OtpViewDesignable: UIView {

func xibSetup() {
contentView = loadViewFromNib()
// initUIComponent()
// use bounds not frame or it'll be offset
contentView.frame = bounds

// Make the view stretch with containing view
contentView.autoresizingMask = [UIView.AutoresizingMask.flexibleWidth, UIView.AutoresizingMask.flexibleHeight]
initUIComponent()
// Adding custom subview on top of our view (over any custom drawing > see note below)
addSubview(contentView)
}

//NOTE(HAMED) check if changes is ok
func loadViewFromNib() -> UIView! {
//let bundle = Bundle(for: type(of: self))
//let nib = UINib(nibName: "OtpViewDesignable", bundle: bundle)

let nib = UINib(resource: R.nib.otpViewDesignable)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView

return view
}

Expand Down
12 changes: 0 additions & 12 deletions MobileToken/ui/importtoken/ImportTokenPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ class ImportTokenPresenter: ImportTokenPresenterProtokol{
repository.update(card, onDone: onDataResponse)
}

func getToken(tokenPacket: String) {
let tokenRepository = TokenRepository()
let onDataResponse: ((RepositoryResponse<Token>) -> ()) = { response in
if response.value != nil {
//
} else {
//
}
}
tokenRepository.get(identifier: tokenPacket, onDone: onDataResponse)
}

func isCardExist(card: Card) -> Card? {
var existCard: Card?
let cardRepository = CardRepository()
Expand Down
6 changes: 0 additions & 6 deletions MobileToken/ui/main/IntroViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class IntroViewController {
pages[i].iconImageView.backgroundColor = R.color.primary()
pages[i].iconHeight = 250
pages[i].iconWidth = 250
//pages[i].view.contentMode = .center

}

onboardingVC = OnboardingViewController.onboard(withBackgroundImage: nil, contents: pages)
Expand All @@ -69,10 +67,6 @@ class IntroViewController {
onboardingVC.fadePageControlOnLastPage = false
onboardingVC.pageControl.pageIndicatorTintColor = UIColor.black
onboardingVC.pageControl.currentPageIndicatorTintColor = R.color.secondaryLight()
// onboardingVC.skipButton.setTitleColor(R.color.secondary(), for: .normal)
// onboardingVC.skipButton.setTitle(R.string.localizable.skip(), for: .normal)
// onboardingVC.skipButton.titleLabel?.font = R.font.iranSansMobileBold(size: 16)
// onboardingVC.allowSkipping = true
onboardingVC.fadeSkipButtonOnLastPage = true
onboardingVC.view.backgroundColor = R.color.primary()
onboardingVC.skipHandler = { onIntroEnd() }
Expand Down
10 changes: 0 additions & 10 deletions MobileToken/ui/registration/BankViewXib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,15 @@ class BankViewXib: UIView {

func xibSetup() {
contentView = loadViewFromNib()
//initUIComponent()
// // use bounds not frame or it'll be offset
contentView.frame = bounds
//
// // Make the view stretch with containing view
contentView.autoresizingMask = [UIView.AutoresizingMask.flexibleWidth, UIView.AutoresizingMask.flexibleHeight]
initUIComponent()
// // Adding custom subview on top of our view (over any custom drawing > see note below)
addSubview(contentView)
}

//NOTE(HAMED) check if changes is ok
func loadViewFromNib() -> UIView! {
//let bundle = Bundle(for: type(of: self))
//let nib = UINib(nibName: "OtpViewDesignable", bundle: bundle)

let nib = UINib(resource: R.nib.bankView)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView

return view
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class PhoneConfirmationPresenter:PhoneConfirmationPresenterProtocol {
}
}
else {
//self?.view.showEverywhereFail()
UIHelper.showFailedSnackBar()
}
}
userRepository.claim(user: user, onDone: onDataResponse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class PhoneConfirmationViewController: BaseViewController,PhoneConfirmationViewP
func initUIComponents() {
if #available(iOS 12.0, *) {
textFieldCode.textContentType = .oneTimeCode
} else {
// Fallback on earlier versions
}
self.hideKeyboardWhenTappedAround()
btConfirmation.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ class AuthenticationTypeSettingTableViewCell: UITableViewCell {
@IBOutlet var labelType: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}

override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
self.selectionStyle = .none
// Configure the view for the selected state
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class QuestionViewController: BaseViewController,WKNavigationDelegate {
configuration.preferences = preferences
webView = WKWebView(frame: view.bounds, configuration: configuration)
view.addSubview(webView)
let url = Bundle.main.url(forResource: "answer", withExtension: "html")
var url: URL?
if Locale.preferredLanguages[0] == "ar" {
url = Bundle.main.url(forResource: "answer-ar", withExtension: "html")
}else {
url = Bundle.main.url(forResource: "answer-en", withExtension: "html")
}
let request = URLRequest(url: url!)
webView.backgroundColor = R.color.primary()
webView.tintColor = R.color.primary()
Expand Down
Loading

0 comments on commit e0983f0

Please sign in to comment.