Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // PaymentConfirmationNewView.m
- // Moselo
- //
- // Created by Axel Soedarsono on 11/15/17.
- // Copyright © 2017 Moselo. All rights reserved.
- //
- #import "PaymentConfirmationNewView.h"
- @interface PaymentConfirmationNewView ()
- //@property (strong, nonatomic) UIScrollView *scrollView;
- //@property (strong, nonatomic) UIView *separator1View;
- //@property (strong, nonatomic) UIView *separator2View;
- //@property (strong, nonatomic) UIView *paymentTotalPriceWithStatusView;
- //@property (strong, nonatomic) UILabel *totalPriceLabel;
- //@property (strong, nonatomic) UILabel *totalPriceNumberLabel;
- //
- //@property (strong, nonatomic) UIView *paymentStatusView;
- //@property (strong, nonatomic) UIView *paymentStatusNotificationView;
- //@property (strong, nonatomic) UILabel *paymentStatusNotificationLabel;
- //
- //@property (strong, nonatomic) UIView *paymentConfirmationContainerView;
- //@property (strong, nonatomic) UILabel *paymentConfirmationBlankLabel;
- //
- //@property (strong, nonatomic) UIView *paymentConfirmationItemView;
- //@property (strong, nonatomic) RNImageView *paymentConfirmationItemImageView;
- //@property (strong, nonatomic) UILabel *paymentConfirmationItemDatetimeLabel;
- //@property (strong, nonatomic) UILabel *paymentConfirmationItemPriceLabel;
- //
- //@property (strong, nonatomic) UIImageView *iconTransferDestinationImageView;
- //@property (strong, nonatomic) UILabel *bankAccountTransferDestinationLabel;
- //@property (strong, nonatomic) UILabel *bankAccountUsernameTransferDestinationLabel;
- //
- //@property (strong, nonatomic) UIImageView *iconSenderImageView;
- //@property (strong, nonatomic) UILabel *bankAccountSenderLabel;
- //@property (strong, nonatomic) UILabel *bankAccountUsernameSenderLabel;
- //
- //@property (strong, nonatomic) UIView *separatorUpperView;
- //@property (strong, nonatomic) UIView *separatorMidView;
- //
- //@property (strong, nonatomic) UIView *statusConfirmationView;
- //@property (strong, nonatomic) UILabel *statusConfirmationLabel;
- //
- //@property (strong, nonatomic) UIView *leftOptionView;
- //@property (strong, nonatomic) UILabel *leftOptionLabel;
- //@property (strong, nonatomic) UIButton *leftOptionButton;
- //
- //@property (strong, nonatomic) UIView *rightOptionView;
- //@property (strong, nonatomic) UILabel *rightOptionLabel;
- //@property (strong, nonatomic) UIButton *rightOptionButton;
- //
- //@property (strong, nonatomic) UIView *createConfirmationContainerView;
- //@property (strong, nonatomic) UIView *createConfirmationView;
- //@property (strong, nonatomic) UILabel *createConfirmationLabel;
- //@property (strong, nonatomic) UIButton *createConfirmationButton;
- @end
- @implementation PaymentConfirmationNewView
- #pragma mark - Lifecycle
- - (id)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- self.backgroundColor = [Util getColor:@"F5F5F5"];
- if(self) {
- _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame))];
- [self.scrollView setContentSize:CGSizeMake(CGRectGetWidth(self.frame), 700.0f)];
- self.scrollView.showsHorizontalScrollIndicator = NO;
- self.scrollView.showsVerticalScrollIndicator = NO;
- self.scrollView.alwaysBounceVertical = YES;
- [self addSubview:self.scrollView];
- _paymentTotalPriceWithStatusView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.frame), 130.0f)];
- self.paymentTotalPriceWithStatusView.backgroundColor = [Util getColor:@"FFFFFF"];
- [self.scrollView addSubview:self.paymentTotalPriceWithStatusView];
- _separator1View = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMaxY(self.paymentTotalPriceWithStatusView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.frame), [Util lineMinimumHeight])];
- self.separator1View.backgroundColor = [Util getColor:@"DDDDDD"];
- [self.scrollView addSubview:self.separator1View];
- _totalPriceLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 53.0f)/2.0f, 21.0f, 53.0f, 14.0f)];
- self.totalPriceLabel.text = NSLocalizedString(@"Total (Rp)", @"");
- self.totalPriceLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:12.0f];
- self.totalPriceLabel.textColor = [Util getColor:@"AAAAAA"];
- self.totalPriceLabel.textAlignment = NSTextAlignmentCenter;
- [self.paymentTotalPriceWithStatusView addSubview:self.totalPriceLabel];
- _totalPriceNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(16.0f, CGRectGetMaxY(self.totalPriceLabel.frame) + 10.0f, CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 16.0f - 16.0f, 32.0f)];
- self.totalPriceNumberLabel.text = NSLocalizedString(@"515.000", @"");
- self.totalPriceNumberLabel.font = [UIFont fontWithName:FONT_LATO_BOLD size:30.0f];
- self.totalPriceNumberLabel.textColor = [Util getColor:@"333333"];
- self.totalPriceNumberLabel.textAlignment = NSTextAlignmentCenter;
- [self.paymentTotalPriceWithStatusView addSubview:self.totalPriceNumberLabel];
- _paymentStatusNotificationView = [[UIView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentTotalPriceWithStatusView.frame) - 120.0f)/2.0f, CGRectGetMaxY(self.totalPriceNumberLabel.frame) + 14.0f, 120.0f, 20.0f)];
- self.paymentStatusNotificationView.layer.cornerRadius = CGRectGetHeight(self.paymentStatusNotificationView.frame)/2.0f;
- [self.paymentTotalPriceWithStatusView addSubview:self.paymentStatusNotificationView];
- _paymentStatusNotificationLabel = [[UILabel alloc] initWithFrame:CGRectMake(5.0f, 3.0f, 110.0f, 14.0f)];
- self.paymentStatusNotificationLabel.font = [UIFont fontWithName:FONT_LATO_BOLD size:10.0f];
- self.paymentStatusNotificationLabel.textAlignment = NSTextAlignmentCenter;
- [self.paymentStatusNotificationView addSubview:self.paymentStatusNotificationLabel];
- //AS TEMP
- // self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"AB81C5"];
- // self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
- // self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
- // self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT COMPLETED", @"");
- self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
- self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
- self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"AB81C5"].CGColor;
- self.paymentStatusNotificationLabel.textColor = [Util getColor:@"AB81C5"];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT PENDING", @"");
- //END AS TEMP
- _paymentConfirmationContainerView = [[UIView alloc]initWithFrame:CGRectMake(0.0f, CGRectGetMaxY(self.separator1View.frame), CGRectGetWidth(self.scrollView.frame), CGRectGetHeight(self.frame) - CGRectGetHeight(self.paymentTotalPriceWithStatusView.frame))];
- self.paymentConfirmationContainerView.backgroundColor = [Util getColor:@"F5F5F5"];
- [self.scrollView addSubview:self.paymentConfirmationContainerView];
- _paymentConfirmationBlankLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.paymentConfirmationContainerView.frame) - 130.0f )/2.0f, 80.0f, 130.0f, 30.0f)];
- self.paymentConfirmationBlankLabel.numberOfLines = 0;
- self.paymentConfirmationBlankLabel.text = NSLocalizedString(@"You haven’t made any\npayment confirmation", @"");
- self.paymentConfirmationBlankLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.paymentConfirmationBlankLabel.textColor = [Util getColor:@"AAAAAA"];
- CGSize paymentConfirmationBlankLabelSize = [self.paymentConfirmationBlankLabel sizeThatFits:CGSizeMake(130.0f, CGFLOAT_MAX)];
- self.paymentConfirmationBlankLabel.frame = CGRectMake((CGRectGetWidth(self.paymentConfirmationContainerView.frame) - 130.0f )/2.0f, 80.0f, 130.0f, paymentConfirmationBlankLabelSize.height);
- self.paymentConfirmationBlankLabel.textAlignment = NSTextAlignmentCenter;
- [self.paymentConfirmationContainerView addSubview:self.paymentConfirmationBlankLabel];
- //IF THERE'S AN ORDER IN ROLE USER || EXPERT
- _paymentConfirmationItemView = [[UIView alloc] initWithFrame:CGRectMake(16.0f, 16.0f, CGRectGetWidth(self.paymentConfirmationContainerView.frame) - 16.0 - 16.0f, 322.0f)];
- self.paymentConfirmationItemView.layer.cornerRadius = 4.0f;
- self.paymentConfirmationItemView.layer.masksToBounds = YES;
- self.paymentConfirmationItemView.clipsToBounds = YES;
- self.paymentConfirmationItemView.layer.borderWidth = 1.0f;
- self.paymentConfirmationItemView.layer.borderColor = [Util getColor:@"EEEEEE"].CGColor;
- self.paymentConfirmationItemView.backgroundColor = [Util getColor:@"FFFFFF"];
- [self.paymentConfirmationContainerView addSubview:self.paymentConfirmationItemView];
- _paymentConfirmationItemImageContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
- [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemImageContainerView];
- _paymentConfirmationItemImageView = [[RNImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
- //AS TEMP
- self.paymentConfirmationItemImageView.image = [UIImage imageNamed:@"testCover"];
- //END AS TEMP
- self.paymentConfirmationItemImageView.contentMode = UIViewContentModeScaleAspectFill;
- self.paymentConfirmationItemImageView.layer.cornerRadius = 2.0f;
- self.paymentConfirmationItemImageView.layer.borderWidth = 1.0f;
- self.paymentConfirmationItemImageView.layer.borderColor = [Util getColor:@"EEEEEE"].CGColor;
- self.paymentConfirmationItemImageView.clipsToBounds = YES;
- self.paymentConfirmationItemImageView.layer.masksToBounds = YES;
- [self.paymentConfirmationItemImageContainerView addSubview:self.paymentConfirmationItemImageView];
- // _paymentConfirmationItemImageView = [[RNImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 128.0f)];
- // //AS TEMP
- // self.paymentConfirmationItemImageView.image = [UIImage imageNamed:@"testCover"];
- // //END AS TEMP
- // self.paymentConfirmationItemImageView.contentMode = UIViewContentModeScaleAspectFill;
- // self.paymentConfirmationItemImageView.clipsToBounds = YES;
- // [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemImageView];
- _paymentConfirmationItemDatetimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(17.0f, CGRectGetMaxY(self.paymentConfirmationItemImageView.frame) + 18.0f, 125.0f, 15.0f)];
- self.paymentConfirmationItemDatetimeLabel.text = NSLocalizedString(@"08 Feb 2017, 21:00", @"");
- self.paymentConfirmationItemDatetimeLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.paymentConfirmationItemDatetimeLabel.textColor = [Util getColor:@"444444"];
- self.paymentConfirmationItemDatetimeLabel.textAlignment = NSTextAlignmentLeft;
- [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemDatetimeLabel];
- _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)];
- self.paymentConfirmationItemPriceLabel.text = NSLocalizedString(@"Rp 520.000.000.000", @"");
- self.paymentConfirmationItemPriceLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:18.0f];
- self.paymentConfirmationItemPriceLabel.textColor = [Util getColor:@"444444"];
- self.paymentConfirmationItemPriceLabel.textAlignment = NSTextAlignmentRight;
- [self.paymentConfirmationItemView addSubview:self.paymentConfirmationItemPriceLabel];
- _iconTransferDestinationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(17.0f, CGRectGetMaxY(self.paymentConfirmationItemPriceLabel.frame) + 14.0f, 15.0f, 17.0f)];
- self.iconTransferDestinationImageView.image = [UIImage imageNamed:@"arrowRightGray"];
- self.iconTransferDestinationImageView.contentMode = UIViewContentModeScaleAspectFit;
- [self.paymentConfirmationItemView addSubview:self.iconTransferDestinationImageView];
- _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)];
- self.bankAccountTransferDestinationLabel.numberOfLines = 0;
- self.bankAccountTransferDestinationLabel.text = NSLocalizedString(@"Bank Central Asia: 131-00-12210-888", @"");
- self.bankAccountTransferDestinationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.bankAccountTransferDestinationLabel.textColor = [Util getColor:@"444444"];
- CGSize bankAccountTransferDestinationLabelSize = [self.bankAccountTransferDestinationLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, CGFLOAT_MAX)];
- 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);
- self.bankAccountTransferDestinationLabel.textAlignment = NSTextAlignmentLeft;
- [self.paymentConfirmationItemView addSubview:self.bankAccountTransferDestinationLabel];
- _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)];
- self.bankAccountUsernameTransferDestinationLabel.numberOfLines = 0;
- self.bankAccountUsernameTransferDestinationLabel.text = NSLocalizedString(@"Adaniwafi Kodok1 Kodok2 Kodok3 Kodok4", @"");
- self.bankAccountUsernameTransferDestinationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.bankAccountUsernameTransferDestinationLabel.textColor = [Util getColor:@"444444"];
- CGSize bankAccountUsernameTransferDestinationLabelSize = [self.bankAccountUsernameTransferDestinationLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 17.0f - 17.0f - 18.0f - 17.0f, CGFLOAT_MAX)];
- 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);
- self.bankAccountUsernameTransferDestinationLabel.textAlignment = NSTextAlignmentLeft;
- [self.paymentConfirmationItemView addSubview:self.bankAccountUsernameTransferDestinationLabel];
- _iconSenderImageView = [[UIImageView alloc] initWithFrame:CGRectMake(14.0f, CGRectGetMaxY(self.bankAccountUsernameTransferDestinationLabel.frame) + 16.0f, 20.0f, 16.0f)];
- self.iconSenderImageView.image = [UIImage imageNamed:@"cardLogo"];
- self.iconSenderImageView.contentMode = UIViewContentModeScaleAspectFit;
- [self.paymentConfirmationItemView addSubview:self.iconSenderImageView];
- _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)];
- self.bankAccountSenderLabel.numberOfLines = 0;
- self.bankAccountSenderLabel.text = NSLocalizedString(@"Bank BRI: 777-1087-888", @"");
- self.bankAccountSenderLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.bankAccountSenderLabel.textColor = [Util getColor:@"444444"];
- CGSize bankAccountSenderLabelSize = [self.bankAccountSenderLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, CGFLOAT_MAX)];
- 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);
- self.bankAccountSenderLabel.textAlignment = NSTextAlignmentLeft;
- [self.paymentConfirmationItemView addSubview:self.bankAccountSenderLabel];
- _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)];
- self.bankAccountUsernameSenderLabel.numberOfLines = 0;
- self.bankAccountUsernameSenderLabel.text = NSLocalizedString(@"Rizka FM KODOK KODOK KODOK KODOK", @"");
- self.bankAccountUsernameSenderLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:13.0f];
- self.bankAccountUsernameSenderLabel.textColor = [Util getColor:@"444444"];
- CGSize bankAccountUsernameSenderLabelSize = [self.bankAccountUsernameSenderLabel sizeThatFits:CGSizeMake(CGRectGetWidth(self.paymentConfirmationItemView.frame) - 14.0f - 20.0f - 15.0f - 17.0f, CGFLOAT_MAX)];
- 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);
- self.bankAccountUsernameSenderLabel.textAlignment = NSTextAlignmentLeft;
- [self.paymentConfirmationItemView addSubview:self.bankAccountUsernameSenderLabel];
- //WAITING CONFIRMATION
- _statusConfirmationView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.paymentConfirmationItemView.frame) - 45.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame), 45.0f)];
- self.statusConfirmationView.backgroundColor = [Util getColor:@"FFFFFF"];
- self.statusConfirmationLabel.clipsToBounds = YES;
- self.statusConfirmationLabel.layer.masksToBounds = YES;
- [self.paymentConfirmationItemView addSubview:self.statusConfirmationView];
- _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)];
- self.statusConfirmationLabel.text = NSLocalizedString(@"Waiting Confirmation", @"");
- self.statusConfirmationLabel.font = [UIFont fontWithName:FONT_LATO_REGULAR size:16.0f];
- self.statusConfirmationLabel.textColor = [Util getColor:@"CCCCCC"];
- self.statusConfirmationLabel.textAlignment = NSTextAlignmentCenter;
- // self.statusConfirmationLabel.backgroundColor = [[UIColor yellowColor]colorWithAlphaComponent:0.3f];
- [self.statusConfirmationView addSubview:self.statusConfirmationLabel];
- //OLD separatorUpperView
- // _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.statusConfirmationView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight] + 0.5f)];
- // self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
- // [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
- _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.statusConfirmationView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight])];
- self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
- [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
- //END WAITING CONFIRMATION
- //ACCEPT & DECLINE FOR EXPERT PAYMENT CONFIRMATION FROM USER
- //LEFT OPTION VIEW (DECLINE)
- // _leftOptionView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.paymentConfirmationItemView.frame) - 45.0f, CGRectGetWidth(self.paymentConfirmationItemView.frame)/2.0f, 45.0f)];
- //// self.leftOptionView.backgroundColor = [UIColor redColor];//AS TEMP
- // [self.paymentConfirmationItemView addSubview:self.leftOptionView];
- //
- // //RIGHT OPTION VIEW (ACCEPT)
- // _rightOptionView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.leftOptionView.frame), CGRectGetMinY(self.leftOptionView.frame), CGRectGetWidth(self.paymentConfirmationItemView.frame)/2.0f, CGRectGetHeight(self.leftOptionView.frame))];
- //// self.rightOptionView.backgroundColor = [UIColor greenColor];//AS TEMP
- // [self.paymentConfirmationItemView addSubview:self.rightOptionView];
- //
- // //SEPARATOR MID
- // _separatorMidView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.leftOptionView.frame), CGRectGetMinY(self.leftOptionView.frame), [Util lineMinimumHeight], CGRectGetHeight(self.leftOptionView.frame))];
- // self.separatorMidView.backgroundColor = [Util getColor:@"EEEEEE"];
- //// self.separatorMidView.backgroundColor = [UIColor yellowColor];
- // [self.paymentConfirmationItemView addSubview:self.separatorMidView];
- //
- // _separatorUpperView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMinY(self.leftOptionView.frame) - [Util lineMinimumHeight], CGRectGetWidth(self.paymentConfirmationItemView.frame), [Util lineMinimumHeight])];
- // self.separatorUpperView.backgroundColor = [Util getColor:@"EEEEEE"];
- // [self.paymentConfirmationItemView addSubview:self.separatorUpperView];
- //
- //
- //END ACCEPT & DECLINE FOR EXPERT PAYMENT CONFIRMATION FROM USER
- //@property (strong, nonatomic) UIView *createConfirmationContainerView;
- //@property (strong, nonatomic) UIView *createConfirmationView;
- //@property (strong, nonatomic) UILabel *createConfirmationLabel;
- //@property (strong, nonatomic) UIButton *createConfirmationButton;
- _createConfirmationContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, CGRectGetHeight(self.frame) - 56.0f, CGRectGetWidth(self.frame), 56.0f)];
- self.createConfirmationContainerView.backgroundColor = [Util getColor:@"FFFFFF"];
- [self addSubview:self.createConfirmationContainerView];
- _separatorUppercreateConfirmationContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.createConfirmationContainerView.frame), 1.0f)];
- self.separatorUppercreateConfirmationContainerView.backgroundColor = [Util getColor:@"DDDDDD"];
- [self.createConfirmationContainerView addSubview:self.separatorUppercreateConfirmationContainerView];
- _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)];
- self.createConfirmationView.layer.cornerRadius = 4.0f;
- self.createConfirmationView.layer.borderWidth = 1.0f;
- self.createConfirmationView.layer.borderColor = [Util getColor:@"17B293"].CGColor;
- self.createConfirmationView.backgroundColor = [Util getColor:@"2ECCAD"];
- [self. createConfirmationContainerView addSubview:self.createConfirmationView];
- _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)];
- self.createConfirmationLabel.text = NSLocalizedString(@"Create Confirmation", @"");
- self.createConfirmationLabel.font = [UIFont fontWithName:FONT_NAME_BOLD size:14.0f];
- self.createConfirmationLabel.textColor = [Util getColor:@"FFFFFF"];
- self.createConfirmationLabel.textAlignment = NSTextAlignmentCenter;
- [self.createConfirmationView addSubview:self.createConfirmationLabel];
- _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)];
- [self.createConfirmationContainerView addSubview:self.createConfirmationButton];
- self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.scrollView.frame), CGRectGetMaxY(self.paymentConfirmationContainerView.frame) + 56.0f);
- }
- return self;
- }
- #pragma mark - Custom Method
- - (void)setPaymentConfirmationNewViewType:(PaymentConfirmationNewViewType)paymentConfirmationNewViewType {
- _paymentConfirmationNewViewType = paymentConfirmationNewViewType;
- /*
- PaymentConfirmationNewViewTypeCancelled = 0,
- PaymentConfirmationNewViewTypeUserConfirmed = 1,
- PaymentConfirmationNewViewTypeDeclined = 2,
- PaymentConfirmationNewViewTypeAccepted = 3,
- PaymentConfirmationNewViewTypeConfirmed = 4,
- PaymentConfirmationNewViewTypeCompleted = 5,
- PaymentConfirmationNewViewTypeOverpaid = 6,
- */
- if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeCancelled) {
- self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"FF5656"];
- self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
- self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"CANCELLED", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeConfirmed) {
- self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
- self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
- self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"2ECCAD"].CGColor;
- self.paymentStatusNotificationLabel.textColor = [Util getColor:@"2ECCAD"];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"USER CONFIRMED", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationTypeDeclined) {
- self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"FF5656"];
- self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
- self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"EXPERT DECLINED", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationTypeAccepted) {
- self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
- self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
- self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"AB81C5"].CGColor;
- self.paymentStatusNotificationLabel.textColor = [Util getColor:@"AB81C5"];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT PENDING", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeUserConfirmed) {
- self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"2ECCAD"];
- self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
- self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
- //NSString *formattedString = [NSString stringWithFormat:@"%li PAYMENT CONFIRMED", (long)numberOfPaymentConfirmed];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT CONFIRMED", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeCompleted) {
- self.paymentStatusNotificationView.backgroundColor = [Util getColor:@"AB81C5"];
- self.paymentStatusNotificationView.layer.borderWidth = 0.0f;
- self.paymentStatusNotificationLabel.textColor = [UIColor whiteColor];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"PAYMENT COMPLETED", @"");
- }
- else if(self.paymentConfirmationNewViewType == PaymentConfirmationNewViewTypeOverpaid) {
- self.paymentStatusNotificationView.backgroundColor = [UIColor whiteColor];
- self.paymentStatusNotificationView.layer.borderWidth = 1.0f;
- self.paymentStatusNotificationView.layer.borderColor = [Util getColor:@"FF5656"].CGColor;
- self.paymentStatusNotificationLabel.textColor = [Util getColor:@"FF5656"];
- self.paymentStatusNotificationLabel.text = NSLocalizedString(@"OVERPAID", @"");
- }
- }
- - (void)setPaymentConfirmationNewViewButtonType:(PaymentConfirmationNewViewButtonType)paymentConfirmationNewViewButtonType {
- //User = 0 || Expert = 1
- //not yet implemented
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement