Advertisement
axelso

PaymentConfirmationNewView.m - 17 Nov 17 @11.31 OLD uppersep

Nov 16th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  PaymentConfirmationNewView.m
  3. //  Moselo
  4. //
  5. //  Created by Axel Soedarsono on 11/15/17.
  6. //  Copyright © 2017 Moselo. All rights reserved.
  7. //
  8.  
  9. #import "PaymentConfirmationNewView.h"
  10.  
  11. @interface PaymentConfirmationNewView ()
  12.  
  13. //@property (strong, nonatomic) UIScrollView *scrollView;
  14. //@property (strong, nonatomic) UIView *separator1View;
  15. //@property (strong, nonatomic) UIView *separator2View;
  16.  
  17. //@property (strong, nonatomic) UIView *paymentTotalPriceWithStatusView;
  18. //@property (strong, nonatomic) UILabel *totalPriceLabel;
  19. //@property (strong, nonatomic) UILabel *totalPriceNumberLabel;
  20. //
  21. //@property (strong, nonatomic) UIView *paymentStatusView;
  22. //@property (strong, nonatomic) UIView *paymentStatusNotificationView;
  23. //@property (strong, nonatomic) UILabel *paymentStatusNotificationLabel;
  24. //
  25. //@property (strong, nonatomic) UIView *paymentConfirmationContainerView;
  26. //@property (strong, nonatomic) UILabel *paymentConfirmationBlankLabel;
  27. //
  28. //@property (strong, nonatomic) UIView *paymentConfirmationItemView;
  29. //@property (strong, nonatomic) RNImageView *paymentConfirmationItemImageView;
  30. //@property (strong, nonatomic) UILabel *paymentConfirmationItemDatetimeLabel;
  31. //@property (strong, nonatomic) UILabel *paymentConfirmationItemPriceLabel;
  32. //
  33. //@property (strong, nonatomic) UIImageView *iconTransferDestinationImageView;
  34. //@property (strong, nonatomic) UILabel *bankAccountTransferDestinationLabel;
  35. //@property (strong, nonatomic) UILabel *bankAccountUsernameTransferDestinationLabel;
  36. //
  37. //@property (strong, nonatomic) UIImageView *iconSenderImageView;
  38. //@property (strong, nonatomic) UILabel *bankAccountSenderLabel;
  39. //@property (strong, nonatomic) UILabel *bankAccountUsernameSenderLabel;
  40. //
  41. //@property (strong, nonatomic) UIView *separatorUpperView;
  42. //@property (strong, nonatomic) UIView *separatorMidView;
  43. //
  44. //@property (strong, nonatomic) UIView *statusConfirmationView;
  45. //@property (strong, nonatomic) UILabel *statusConfirmationLabel;
  46. //
  47. //@property (strong, nonatomic) UIView *leftOptionView;
  48. //@property (strong, nonatomic) UILabel *leftOptionLabel;
  49. //@property (strong, nonatomic) UIButton *leftOptionButton;
  50. //
  51. //@property (strong, nonatomic) UIView *rightOptionView;
  52. //@property (strong, nonatomic) UILabel *rightOptionLabel;
  53. //@property (strong, nonatomic) UIButton *rightOptionButton;
  54. //
  55. //@property (strong, nonatomic) UIView *createConfirmationContainerView;
  56. //@property (strong, nonatomic) UIView *createConfirmationView;
  57. //@property (strong, nonatomic) UILabel *createConfirmationLabel;
  58. //@property (strong, nonatomic) UIButton *createConfirmationButton;
  59.  
  60. @end
  61.  
  62. @implementation PaymentConfirmationNewView
  63. #pragma mark - Lifecycle
  64. - (id)initWithFrame:(CGRect)frame {
  65.     self = [super initWithFrame:frame];
  66.    
  67.     self.backgroundColor = [Util getColor:@"F5F5F5"];
  68.    
  69.     if(self) {
  70.        
  71.         _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame))];
  72.         [self.scrollView setContentSize:CGSizeMake(CGRectGetWidth(self.frame), 700.0f)];
  73.         self.scrollView.showsHorizontalScrollIndicator = NO;
  74.         self.scrollView.showsVerticalScrollIndicator = NO;
  75.         self.scrollView.alwaysBounceVertical = YES;
  76.         [self addSubview:self.scrollView];
  77.  
  78.         _paymentTotalPriceWithStatusView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.frame), 130.0f)];
  79.         self.paymentTotalPriceWithStatusView.backgroundColor = [Util getColor:@"FFFFFF"];
  80.         [self.scrollView addSubview:self.paymentTotalPriceWithStatusView];
  81.        
  82.         _separator1View = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMaxY(self.paymentTotalPriceWithStatusView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.frame), [Util lineMinimumHeight])];
  83.         self.separator1View.backgroundColor = [Util getColor:@"DDDDDD"];
  84.         [self.scrollView addSubview:self.separator1View];
  85.        
  86.         _totalPriceLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 53.0f)/2.0f, 21.0f, 53.0f, 14.0f)];
  87.         self.totalPriceLabel.text = NSLocalizedString(@"Total (Rp)", @"");
  88.         self.totalPriceLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:12.0f];
  89.         self.totalPriceLabel.textColor = [Util getColor:@"AAAAAA"];
  90.         self.totalPriceLabel.textAlignment = NSTextAlignmentCenter;
  91.         [self.paymentTotalPriceWithStatusView addSubview:self.totalPriceLabel];
  92.        
  93.         _totalPriceNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(16.0f, CGRectGetMaxY(self.totalPriceLabel.frame) + 10.0f, CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 16.0f - 16.0f, 32.0f)];
  94.         self.totalPriceNumberLabel.text = NSLocalizedString(@"515.000", @"");
  95.         self.totalPriceNumberLabel.font = [UIFont fontWithName:FONT_LATO_BOLD size:30.0f];
  96.         self.totalPriceNumberLabel.textColor = [Util getColor:@"333333"];
  97.         self.totalPriceNumberLabel.textAlignment = NSTextAlignmentCenter;
  98.         [self.paymentTotalPriceWithStatusView addSubview:self.totalPriceNumberLabel];
  99.        
  100.         _paymentStatusNotificationView = [[UIView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 120.0f)/2.0f, CGRectGetMaxY(self.totalPriceNumberLabel.frame) + 14.0f, 120.0f, 20.0f)];
  101.         self.paymentStatusNotificationView.layer.cornerRadius = CGRectGetHeight(self.paymentStatusNotificationView.frame)/2.0f;
  102.         [self.paymentTotalPriceWithStatusView addSubview:self.paymentStatusNotificationView];
  103.  
  104.         _paymentStatusNotificationLabel = [[UILabel alloc] initWithFrame:CGRectMake(5.0f, 3.0f, 110.0f, 14.0f)];
  105.         self.paymentStatusNotificationLabel.font = [UIFont fontWithName:FONT_LATO_BOLD size:10.0f];
  106.         self.paymentStatusNotificationLabel.textAlignment = NSTextAlignmentCenter;
  107.         [self.paymentStatusNotificationView addSubview:self.paymentStatusNotificationLabel];
  108.        
  109.         //AS TEMP
  110. //        self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"AB81C5"];
  111. //        self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
  112. //        self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
  113. //        self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT COMPLETED", @"");
  114.        
  115.         self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
  116.         self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
  117.         self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"AB81C5"].CGColor;
  118.         self.paymentStatusNotificationLabel.textColor = [Util getColor:@"AB81C5"];
  119.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT PENDING", @"");
  120.         //END AS TEMP
  121.        
  122.         _paymentConfirmationContainerView = [[UIView alloc]initWithFrame:CGRectMake(0.0f, CGRectGetMaxY(self.separator1View.frame), CGRectGetWidth(self.scrollView.frame), CGRectGetHeight(self.frame) - CGRectGetHeight(self.paymentTotalPriceWithStatusView.frame))];
  123.         self.paymentConfirmationContainerView.backgroundColor = [Util getColor:@"F5F5F5"];
  124.         [self.scrollView addSubview:self.paymentConfirmationContainerView];
  125.        
  126.         _paymentConfirmationBlankLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentConfirmationContainerView.frame) - 130.0f )/2.0f, 80.0f, 130.0f, 30.0f)];
  127.         self.paymentConfirmationBlankLabel.numberOfLines = 0;
  128.         self.paymentConfirmationBlankLabel.text = NSLocalizedString(@"You haven’t made any\npayment confirmation", @"");
  129.         self.paymentConfirmationBlankLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  130.         self.paymentConfirmationBlankLabel.textColor = [Util getColor:@"AAAAAA"];
  131.        
  132.         CGSize paymentConfirmationBlankLabelSize = [self.paymentConfirmationBlankLabel sizeThatFits:CGSizeMake(130.0f, CGFLOAT_MAX)];
  133.         self.paymentConfirmationBlankLabel.frame = CGRectMake((CGRectGetWidth(self.paymentConfirmationContainerView.frame) - 130.0f )/2.0f, 80.0f, 130.0f, paymentConfirmationBlankLabelSize.height);
  134.         self.paymentConfirmationBlankLabel.textAlignment = NSTextAlignmentCenter;
  135.         [self.paymentConfirmationContainerView addSubview:self.paymentConfirmationBlankLabel];
  136.        
  137.         //IF THERE'S AN ORDER IN ROLE USER || EXPERT
  138.         _paymentConfirmationItemView = [[UIView alloc] initWithFrame:CGRectMake(16.0f, 16.0f, CGRectGetWidth(self.paymentConfirmationContainerView.frame) -  16.0 - 16.0f, 322.0f)];
  139.         self.paymentConfirmationItemView.layer.cornerRadius = 4.0f;
  140.         self.paymentConfirmationItemView.layer.masksToBounds = YES;
  141.         self.paymentConfirmationItemView.clipsToBounds = YES;
  142.         self.paymentConfirmationItemView.layer.borderWidth = 1.0f;
  143.         self.paymentConfirmationItemView.layer.borderColor = [Util getColor:@"EEEEEE"].CGColor;
  144.         self.paymentConfirmationItemView.backgroundColor = [Util getColor:@"FFFFFF"];
  145.         [self.paymentConfirmationContainerView addSubview:self.paymentConfirmationItemView];
  146.        
  147.         _paymentConfirmationItemImageContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
  148.         [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemImageContainerView];
  149.        
  150.         _paymentConfirmationItemImageView = [[RNImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
  151.         //AS TEMP
  152.         self.paymentConfirmationItemImageView.image = [UIImage imageNamed:@"testCover"];
  153.         //END AS TEMP
  154.         self.paymentConfirmationItemImageView.contentMode = UIViewContentModeScaleAspectFill;
  155.         self.paymentConfirmationItemImageView.layer.cornerRadius = 2.0f;
  156.         self.paymentConfirmationItemImageView.layer.borderWidth = 1.0f;
  157.         self.paymentConfirmationItemImageView.layer.borderColor = [Util getColor:@"EEEEEE"].CGColor;
  158.         self.paymentConfirmationItemImageView.clipsToBounds = YES;
  159.         self.paymentConfirmationItemImageView.layer.masksToBounds = YES;
  160.         [self.paymentConfirmationItemImageContainerView addSubview:self.paymentConfirmationItemImageView];
  161.        
  162. //        _paymentConfirmationItemImageView = [[RNImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
  163. //        //AS TEMP
  164. //        self.paymentConfirmationItemImageView.image = [UIImage imageNamed:@"testCover"];
  165. //        //END AS TEMP
  166. //        self.paymentConfirmationItemImageView.contentMode = UIViewContentModeScaleAspectFill;
  167. //        self.paymentConfirmationItemImageView.clipsToBounds = YES;
  168. //        [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemImageView];
  169.        
  170.         _paymentConfirmationItemDatetimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(17.0f, CGRectGetMaxY(self.paymentConfirmationItemImageView.frame) + 18.0f, 125.0f, 15.0f)];
  171.         self.paymentConfirmationItemDatetimeLabel.text = NSLocalizedString(@"08 Feb 2017, 21:00", @"");
  172.         self.paymentConfirmationItemDatetimeLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  173.         self.paymentConfirmationItemDatetimeLabel.textColor = [Util getColor:@"444444"];
  174.         self.paymentConfirmationItemDatetimeLabel.textAlignment = NSTextAlignmentLeft;
  175.         [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemDatetimeLabel];
  176.        
  177.         _paymentConfirmationItemPriceLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 16.0f - (CGRectGetWidth(self.paymentConfirmationItemView.frame) -  17.0f - 125.0f - 5.0f - 16.0f), CGRectGetMaxY(self.paymentConfirmationItemImageView.frame) + 15.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame) -  17.0f - 125.0f - 5.0f - 16.0f, 20.0f)];
  178.         self.paymentConfirmationItemPriceLabel.text = NSLocalizedString(@"Rp 520.000.000.000", @"");
  179.         self.paymentConfirmationItemPriceLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:18.0f];
  180.         self.paymentConfirmationItemPriceLabel.textColor = [Util getColor:@"444444"];
  181.         self.paymentConfirmationItemPriceLabel.textAlignment = NSTextAlignmentRight;
  182.         [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemPriceLabel];
  183.        
  184.         _iconTransferDestinationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(17.0f, CGRectGetMaxY(self.paymentConfirmationItemPriceLabel.frame) + 14.0f, 15.0f, 17.0f)];
  185.         self.iconTransferDestinationImageView.image = [UIImage imageNamed:@"arrowRightGray"];
  186.         self.iconTransferDestinationImageView.contentMode = UIViewContentModeScaleAspectFit;
  187.         [self.paymentConfirmationItemView addSubview:self.iconTransferDestinationImageView];
  188.        
  189.         _bankAccountTransferDestinationLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconTransferDestinationImageView.frame) + 18.0f, CGRectGetMinY(self.iconTransferDestinationImageView.frame), CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, 15.0f)];
  190.         self.bankAccountTransferDestinationLabel.numberOfLines = 0;
  191.         self.bankAccountTransferDestinationLabel.text = NSLocalizedString(@"Bank Central Asia: 131-00-12210-888", @"");
  192.         self.bankAccountTransferDestinationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  193.         self.bankAccountTransferDestinationLabel.textColor = [Util getColor:@"444444"];
  194.         CGSize bankAccountTransferDestinationLabelSize = [self.bankAccountTransferDestinationLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, CGFLOAT_MAX)];
  195.         self.bankAccountTransferDestinationLabel.frame = CGRectMake(CGRectGetMaxX(self.iconTransferDestinationImageView.frame) + 18.0f, CGRectGetMinY(self.iconTransferDestinationImageView.frame), CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, bankAccountTransferDestinationLabelSize.height);
  196.         self.bankAccountTransferDestinationLabel.textAlignment = NSTextAlignmentLeft;
  197.         [self.paymentConfirmationItemView addSubview:self.bankAccountTransferDestinationLabel];
  198.        
  199.         _bankAccountUsernameTransferDestinationLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconTransferDestinationImageView.frame) + 18.0f, CGRectGetMaxY(self.bankAccountTransferDestinationLabel.frame) + 3.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, 15.0f)];
  200.         self.bankAccountUsernameTransferDestinationLabel.numberOfLines = 0;
  201.         self.bankAccountUsernameTransferDestinationLabel.text = NSLocalizedString(@"Adaniwafi Kodok1 Kodok2 Kodok3 Kodok4", @"");
  202.         self.bankAccountUsernameTransferDestinationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  203.         self.bankAccountUsernameTransferDestinationLabel.textColor = [Util getColor:@"444444"];
  204.         CGSize bankAccountUsernameTransferDestinationLabelSize = [self.bankAccountUsernameTransferDestinationLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, CGFLOAT_MAX)];
  205.         self.bankAccountUsernameTransferDestinationLabel.frame = CGRectMake(CGRectGetMaxX(self.iconTransferDestinationImageView.frame) + 18.0f, CGRectGetMaxY(self.bankAccountTransferDestinationLabel.frame) + 3.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, bankAccountUsernameTransferDestinationLabelSize.height);
  206.         self.bankAccountUsernameTransferDestinationLabel.textAlignment = NSTextAlignmentLeft;
  207.         [self.paymentConfirmationItemView addSubview:self.bankAccountUsernameTransferDestinationLabel];
  208.        
  209.         _iconSenderImageView = [[UIImageView alloc] initWithFrame:CGRectMake(14.0f, CGRectGetMaxY(self.bankAccountUsernameTransferDestinationLabel.frame) + 16.0f, 20.0f, 16.0f)];
  210.         self.iconSenderImageView.image = [UIImage imageNamed:@"cardLogo"];
  211.         self.iconSenderImageView.contentMode = UIViewContentModeScaleAspectFit;
  212.         [self.paymentConfirmationItemView addSubview:self.iconSenderImageView];
  213.        
  214.         _bankAccountSenderLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconSenderImageView.frame) + 15.0f, CGRectGetMinY(self.iconSenderImageView.frame) - 0.5f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, 15.0f)];
  215.         self.bankAccountSenderLabel.numberOfLines = 0;
  216.         self.bankAccountSenderLabel.text = NSLocalizedString(@"Bank BRI: 777-1087-888", @"");
  217.         self.bankAccountSenderLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  218.         self.bankAccountSenderLabel.textColor = [Util getColor:@"444444"];
  219.         CGSize bankAccountSenderLabelSize = [self.bankAccountSenderLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, CGFLOAT_MAX)];
  220.         self.bankAccountSenderLabel.frame = CGRectMake(CGRectGetMaxX(self.iconSenderImageView.frame) + 15.0f, CGRectGetMinY(self.iconSenderImageView.frame) - 0.5f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, bankAccountSenderLabelSize.height);
  221.         self.bankAccountSenderLabel.textAlignment = NSTextAlignmentLeft;
  222.         [self.paymentConfirmationItemView addSubview:self.bankAccountSenderLabel];
  223.        
  224.         _bankAccountUsernameSenderLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconSenderImageView.frame) + 15.0f, CGRectGetMaxY(self.bankAccountSenderLabel.frame) + 3.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, 15.0f)];
  225.         self.bankAccountUsernameSenderLabel.numberOfLines = 0;
  226.         self.bankAccountUsernameSenderLabel.text = NSLocalizedString(@"Rizka FM KODOK KODOK KODOK KODOK", @"");
  227.         self.bankAccountUsernameSenderLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
  228.         self.bankAccountUsernameSenderLabel.textColor = [Util getColor:@"444444"];
  229.         CGSize bankAccountUsernameSenderLabelSize = [self.bankAccountUsernameSenderLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, CGFLOAT_MAX)];
  230.         self.bankAccountUsernameSenderLabel.frame = CGRectMake(CGRectGetMaxX(self.iconSenderImageView.frame) + 15.0f, CGRectGetMaxY(self.bankAccountSenderLabel.frame) + 3.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, bankAccountUsernameSenderLabelSize.height);
  231.         self.bankAccountUsernameSenderLabel.textAlignment = NSTextAlignmentLeft;
  232.         [self.paymentConfirmationItemView addSubview:self.bankAccountUsernameSenderLabel];
  233.        
  234.         //WAITING CONFIRMATION
  235.         _statusConfirmationView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.paymentConfirmationItemView.frame) - 45.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 45.0f)];
  236.         self.statusConfirmationView.backgroundColor = [Util getColor:@"FFFFFF"];
  237.         self.statusConfirmationLabel.clipsToBounds = YES;
  238.         self.statusConfirmationLabel.layer.masksToBounds = YES;
  239.         [self.paymentConfirmationItemView addSubview:self.statusConfirmationView];
  240.  
  241.         _statusConfirmationLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.statusConfirmationView.frame) - 160.0f)/2.0f, (CGRectGetHeight(self.statusConfirmationView.frame) - 18.0f)/2.0f, 160.0f, 18.0f)];
  242.         self.statusConfirmationLabel.text = NSLocalizedString(@"Waiting Confirmation", @"");
  243.         self.statusConfirmationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:16.0f];
  244.         self.statusConfirmationLabel.textColor = [Util getColor:@"CCCCCC"];
  245.         self.statusConfirmationLabel.textAlignment = NSTextAlignmentCenter;
  246. //        self.statusConfirmationLabel.backgroundColor = [[UIColor yellowColor]colorWithAlphaComponent:0.3f];
  247.         [self.statusConfirmationView addSubview:self.statusConfirmationLabel];
  248.  
  249.         //OLD separatorUpperView
  250. //        _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.statusConfirmationView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight] + 0.5f)];
  251. //        self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
  252. //        [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
  253.        
  254.         _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.statusConfirmationView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight])];
  255.         self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
  256.         [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
  257.        
  258.         //END WAITING CONFIRMATION
  259.        
  260.        
  261.         //ACCEPT & DECLINE FOR EXPERT PAYMENT CONFIRMATION FROM USER
  262.         //LEFT OPTION VIEW (DECLINE)
  263. //        _leftOptionView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.paymentConfirmationItemView.frame) - 45.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame)/2.0f, 45.0f)];
  264. ////        self.leftOptionView.backgroundColor = [UIColor redColor];//AS TEMP
  265. //        [self.paymentConfirmationItemView addSubview:self.leftOptionView];
  266. //
  267. //        //RIGHT OPTION VIEW (ACCEPT)
  268. //        _rightOptionView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.leftOptionView.frame), CGRectGetMinY(self.leftOptionView.frame), CGRectGetWidth(self.paymentConfirmationItemView.frame)/2.0f, CGRectGetHeight(self.leftOptionView.frame))];
  269. ////        self.rightOptionView.backgroundColor = [UIColor greenColor];//AS TEMP
  270. //        [self.paymentConfirmationItemView addSubview:self.rightOptionView];
  271. //
  272. //        //SEPARATOR MID
  273. //        _separatorMidView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.leftOptionView.frame), CGRectGetMinY(self.leftOptionView.frame), [Util lineMinimumHeight], CGRectGetHeight(self.leftOptionView.frame))];
  274. //        self.separatorMidView.backgroundColor = [Util getColor:@"EEEEEE"];
  275. ////        self.separatorMidView.backgroundColor = [UIColor yellowColor];
  276. //        [self.paymentConfirmationItemView addSubview:self.separatorMidView];
  277. //
  278. //        _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.leftOptionView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight])];
  279. //        self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
  280. //        [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
  281. //
  282. //
  283.         //END ACCEPT & DECLINE FOR EXPERT PAYMENT CONFIRMATION FROM USER
  284.        
  285.        
  286.        
  287.         //@property (strong, nonatomic) UIView *createConfirmationContainerView;
  288.         //@property (strong, nonatomic) UIView *createConfirmationView;
  289.         //@property (strong, nonatomic) UILabel *createConfirmationLabel;
  290.         //@property (strong, nonatomic) UIButton *createConfirmationButton;
  291.        
  292.         _createConfirmationContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.frame) - 56.0f, CGRectGetWidth(self.frame), 56.0f)];
  293.         self.createConfirmationContainerView.backgroundColor = [Util getColor:@"FFFFFF"];
  294.         [self addSubview:self.createConfirmationContainerView];
  295.        
  296.         _separatorUppercreateConfirmationContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.createConfirmationContainerView.frame), 1.0f)];
  297.         self.separatorUppercreateConfirmationContainerView.backgroundColor = [Util getColor:@"DDDDDD"];
  298.         [self.createConfirmationContainerView addSubview:self.separatorUppercreateConfirmationContainerView];
  299.        
  300.         _createConfirmationView = [[UIView alloc] initWithFrame:CGRectMake(8.0f, 8.0f, CGRectGetWidth(self.createConfirmationContainerView.frame) - 8.0f - 8.0f, CGRectGetHeight(self.createConfirmationContainerView.frame) - 8.0f - 8.0f)];
  301.         self.createConfirmationView.layer.cornerRadius = 4.0f;
  302.         self.createConfirmationView.layer.borderWidth = 1.0f;
  303.         self.createConfirmationView.layer.borderColor = [Util getColor:@"17B293"].CGColor;
  304.         self.createConfirmationView.backgroundColor = [Util getColor:@"2ECCAD"];
  305.         [self. createConfirmationContainerView addSubview:self.createConfirmationView];
  306.        
  307.         _createConfirmationLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.createConfirmationView.frame) - 150.0f)/2.0f, (CGRectGetHeight(self.createConfirmationView.frame) - 16.0f)/2.0f, 150.0f, 16.0f)];
  308.         self.createConfirmationLabel.text = NSLocalizedString(@"Create Confirmation", @"");
  309.         self.createConfirmationLabel.font = [UIFont fontWithName:FONT_NAME_BOLD size:14.0f];
  310.         self.createConfirmationLabel.textColor = [Util getColor:@"FFFFFF"];
  311.         self.createConfirmationLabel.textAlignment = NSTextAlignmentCenter;
  312.         [self.createConfirmationView addSubview:self.createConfirmationLabel];
  313.        
  314.         _createConfirmationButton = [[UIButton alloc] initWithFrame:CGRectMake(8.0f, 8.0f, CGRectGetWidth(self.createConfirmationContainerView.frame) - 8.0f - 8.0f, CGRectGetHeight(self.createConfirmationContainerView.frame) - 8.0f - 8.0f)];
  315.         [self.createConfirmationContainerView addSubview:self.createConfirmationButton];
  316.        
  317.        
  318.         self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.scrollView.frame), CGRectGetMaxY(self.paymentConfirmationContainerView.frame) + 56.0f);
  319.     }
  320.    
  321.     return self;
  322. }
  323.  
  324. #pragma mark - Custom Method
  325. - (void)setPaymentConfirmationNewViewType:(PaymentConfirmationNewViewType)paymentConfirmationNewViewType {
  326.     _paymentConfirmationNewViewType = paymentConfirmationNewViewType;
  327.    
  328.     /*
  329.      
  330.      PaymentConfirmationNewViewTypeCancelled = 0,
  331.      PaymentConfirmationNewViewTypeUserConfirmed = 1,
  332.      PaymentConfirmationNewViewTypeDeclined = 2,
  333.      PaymentConfirmationNewViewTypeAccepted = 3,
  334.      PaymentConfirmationNewViewTypeConfirmed = 4,
  335.      PaymentConfirmationNewViewTypeCompleted = 5,
  336.      PaymentConfirmationNewViewTypeOverpaid = 6,
  337.      
  338.      */
  339.    
  340.     if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeCancelled) {
  341.        
  342.         self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"FF5656"];
  343.         self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
  344.         self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
  345.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"CANCELLED", @"");
  346.        
  347.     }
  348.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeConfirmed) {
  349.        
  350.         self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
  351.         self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
  352.         self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"2ECCAD"].CGColor;
  353.         self.paymentStatusNotificationLabel.textColor = [Util getColor:@"2ECCAD"];
  354.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"USER CONFIRMED", @"");
  355.     }
  356.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationTypeDeclined) {
  357.        
  358.         self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"FF5656"];
  359.         self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
  360.         self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
  361.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"EXPERT DECLINED", @"");
  362.     }
  363.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationTypeAccepted) {
  364.        
  365.         self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
  366.         self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
  367.         self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"AB81C5"].CGColor;
  368.         self.paymentStatusNotificationLabel.textColor = [Util getColor:@"AB81C5"];
  369.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT PENDING", @"");
  370.     }
  371.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeUserConfirmed) {
  372.    
  373.         self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"2ECCAD"];
  374.         self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
  375.         self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
  376.         //NSString *formattedString = [NSString stringWithFormat:@"%li PAYMENT CONFIRMED", (long)numberOfPaymentConfirmed];
  377.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT CONFIRMED", @"");
  378.     }
  379.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeCompleted) {
  380.        
  381.         self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"AB81C5"];
  382.         self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
  383.         self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
  384.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT COMPLETED", @"");
  385.     }
  386.     else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeOverpaid) {
  387.        
  388.         self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
  389.         self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
  390.         self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"FF5656"].CGColor;
  391.         self.paymentStatusNotificationLabel.textColor = [Util getColor:@"FF5656"];
  392.         self.paymentStatusNotificationLabel.text = NSLocalizedString(@"OVERPAID", @"");
  393.     }
  394. }
  395.  
  396. - (void)setPaymentConfirmationNewViewButtonType:(PaymentConfirmationNewViewButtonType)paymentConfirmationNewViewButtonType {
  397.     //User = 0 || Expert = 1
  398.     //not yet implemented
  399. }
  400.  
  401. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement