Skip to content

Commit 05b8e07

Browse files
committed
Added send button inside contact detail
1 parent 827d709 commit 05b8e07

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

BitStore/Controller/Contact/ContactDetailViewController.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#import "ExchangeHelper.h"
2020
#import "ExchangeListener.h"
2121
#import "Unit.h"
22+
#import "SendNavigationController.h"
2223

2324
@interface ContactDetailViewController () <AddressListener, AddressHelperListener, ExchangeListener, UITableViewDataSource, UITableViewDelegate>
2425
@end
@@ -45,6 +46,8 @@ - (id)initWithAddress:(Address *)address {
4546
- (void)viewDidLoad {
4647
[super viewDidLoad];
4748

49+
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:l10n(@"send") style:UIBarButtonItemStylePlain target:self action:@selector(actionSend:)];
50+
4851
_tableView = [[UITableView alloc] initWithFrame:self.view.frame];
4952
_tableView.tableFooterView = [[UIView alloc] init];
5053
_tableView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1.0];
@@ -54,18 +57,14 @@ - (void)viewDidLoad {
5457
_tableView.contentOffset = CGPointMake(0, -80);
5558
_tableView.scrollIndicatorInsets = UIEdgeInsetsMake(80, 0, 0, 0);
5659
[self.view addSubview:_tableView];
57-
5860
_refreshControl = [[UIRefreshControl alloc]init];
5961
[_tableView addSubview:_refreshControl];
6062
[_refreshControl addTarget:self action:@selector(refreshTable) forControlEvents:UIControlEventValueChanged];
6163

62-
6364
UIView* header = [[UIView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 80)];
6465
header.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.95];
65-
6666
UIView* background = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 80)];
6767
[header addSubview:background];
68-
6968
UIView* foreground = [[UIView alloc] initWithFrame:CGRectMake(5, 5, self.view.frame.size.width - 10, 80 - 10)];
7069
[header addSubview:foreground];
7170

@@ -81,16 +80,19 @@ - (void)viewDidLoad {
8180
_totalLabel.textColor = [Color mainTintColor];
8281
[foreground addSubview:_totalLabel];
8382

84-
8583
UIView* divider = [[UIView alloc] initWithFrame:CGRectMake(0, 80, header.frame.size.width, 0.5)];
8684
divider.backgroundColor = [UIColor colorWithWhite:0.8 alpha:1.0];
8785
[header addSubview:divider];
88-
8986
[self.view addSubview:header];
9087

9188
[self updateValues];
9289
}
9390

91+
- (void)actionSend:(id)sender {
92+
SendNavigationController* vc = [[SendNavigationController alloc] initWithAddress:_address.address amount:nil];
93+
[self presentViewController:vc animated:YES completion:nil];
94+
}
95+
9496
- (void)viewWillAppear:(BOOL)animated {
9597
[super viewWillAppear:animated];
9698
[_address refresh];

0 commit comments

Comments
 (0)