Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improvement/register masternode #83

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e044599
ported over a lot of views from Dash Sync
QuantumExplorer Mar 15, 2019
75b2781
more work to improvement My masternodes screen
QuantumExplorer Mar 18, 2019
d7a3f72
better show keys
QuantumExplorer Mar 21, 2019
baadf3d
Search masternodes done right
podkovyrin Mar 19, 2019
63ee912
DashSyncCurrentCommit
QuantumExplorer Mar 23, 2019
cd304f2
merge
QuantumExplorer Jun 28, 2019
2efbd57
merge
QuantumExplorer Jun 28, 2019
4a060e6
sign messages
QuantumExplorer Jun 29, 2019
b19640c
register masternode
QuantumExplorer Jun 30, 2019
6f3bde6
merge from master
QuantumExplorer Aug 23, 2019
a247f66
strings
QuantumExplorer Aug 26, 2019
872d14a
merge
QuantumExplorer Oct 27, 2019
d06337f
cleanup
QuantumExplorer Oct 27, 2019
1ffcfac
cleanup
QuantumExplorer Oct 27, 2019
e77c0bd
cleanup
QuantumExplorer Oct 27, 2019
d926ac9
cleanup
QuantumExplorer Oct 27, 2019
e67a991
cleanup
QuantumExplorer Oct 27, 2019
67219c3
cleanup
QuantumExplorer Oct 27, 2019
c9c7e17
Merge branch 'redesign' into Improvement/RegisterMasternode
QuantumExplorer Oct 31, 2019
b5f0555
Merge branch 'redesign' into Improvement/RegisterMasternode
QuantumExplorer Oct 31, 2019
d27c4f0
create registration model
QuantumExplorer Nov 3, 2019
1bb4a89
updating for kvo model without storyboards
QuantumExplorer Nov 4, 2019
4b1aaa0
registration screen initial draft
QuantumExplorer Nov 11, 2019
86026be
registration screen and partial signing screen
QuantumExplorer Nov 11, 2019
1971c22
more signing screen
QuantumExplorer Nov 11, 2019
b8181f3
working with issues
QuantumExplorer Nov 11, 2019
e4873cf
masternode list UI initial work
QuantumExplorer Nov 13, 2019
94a9d2b
my masternodes UI initial work
QuantumExplorer Nov 13, 2019
a8d909e
masternode list improvements
QuantumExplorer Nov 18, 2019
2c480d5
merge from redesign
QuantumExplorer Dec 10, 2019
87a681b
masternode list screen
QuantumExplorer Dec 20, 2019
13b4b90
improvements for masternode list
QuantumExplorer Dec 21, 2019
f8000b4
merged in master
QuantumExplorer Apr 11, 2020
7a79280
Merge branch 'master' into Improvement/RegisterMasternode
QuantumExplorer Apr 11, 2020
fd4efe4
merged in master
QuantumExplorer Apr 11, 2020
709b7e2
forgot to add some items during merge
QuantumExplorer Apr 11, 2020
a92c2d3
temp changes
QuantumExplorer Apr 11, 2020
3649e91
signing from a mn
QuantumExplorer Apr 13, 2020
511e446
added reset masternode
QuantumExplorer Apr 15, 2020
ddb4891
bump to v 5.6.0
QuantumExplorer Jun 27, 2021
8e3df60
merged in master
QuantumExplorer Jun 27, 2021
6698fef
masternode features update
QuantumExplorer Jun 27, 2021
6b909c5
fixed signer
QuantumExplorer Jun 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
423 changes: 384 additions & 39 deletions DashWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/Action/DWActionFormCellModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2018 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "DWBaseFormCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface DWActionFormCellModel : DWBaseFormCellModel

@property (nullable, copy, nonatomic) void (^didSelectBlock)(DWActionFormCellModel *cellModel, NSIndexPath *indexPath);

@end

NS_ASSUME_NONNULL_END
26 changes: 26 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/Action/DWActionFormCellModel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2018 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "DWActionFormCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@implementation DWActionFormCellModel

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2018 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "DWActionFormCellModel.h"
#import "DWBaseFormTableViewCell.h"

NS_ASSUME_NONNULL_BEGIN

@interface DWActionFormTableViewCell : DWBaseFormTableViewCell

@property (nullable, strong, nonatomic) DWActionFormCellModel *cellModel;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2018 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "DWActionFormTableViewCell.h"

#import "DWSharedUIConstants.h"
#import "DWUIKit.h"

NS_ASSUME_NONNULL_BEGIN

@interface DWActionFormTableViewCell ()

@property (readonly, nonatomic, strong) UILabel *titleLabel;

@end

@implementation DWActionFormTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(nullable NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
UIView *contentView = self.roundedContentView;
contentView.backgroundColor = [UIColor dw_dashBlueColor];
NSParameterAssert(contentView);

UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.textColor = [UIColor dw_lightTitleColor];
titleLabel.numberOfLines = 0;
titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
titleLabel.font = [UIFont dw_fontForTextStyle:UIFontTextStyleSubheadline];
titleLabel.adjustsFontForContentSizeCategory = YES;
titleLabel.minimumScaleFactor = 0.5;
titleLabel.adjustsFontSizeToFitWidth = YES;
[titleLabel setContentCompressionResistancePriority:UILayoutPriorityRequired - 2
forAxis:UILayoutConstraintAxisVertical];
[contentView addSubview:titleLabel];
_titleLabel = titleLabel;

const CGFloat margin = DWDefaultMargin();
const CGFloat padding = DW_FORM_CELL_VERTICAL_PADDING;

[NSLayoutConstraint activateConstraints:@[
[titleLabel.topAnchor constraintEqualToAnchor:contentView.topAnchor
constant:padding],
[titleLabel.leadingAnchor constraintEqualToAnchor:contentView.leadingAnchor
constant:margin],
[titleLabel.bottomAnchor constraintEqualToAnchor:contentView.bottomAnchor
constant:-padding],
[titleLabel.trailingAnchor constraintEqualToAnchor:contentView.trailingAnchor
constant:-margin],
]];

[self setupObserving];
}

return self;
}

- (void)setupObserving {
[self mvvm_observe:DW_KEYPATH(self, cellModel.title)
with:^(__typeof(self) self, NSString *value) {
self.titleLabel.text = value ?: @" ";
}];
}

@end

NS_ASSUME_NONNULL_END
3 changes: 2 additions & 1 deletion DashWallet/Sources/UI/Menu/Forms/DWBaseFormCellModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
//

#import <Foundation/Foundation.h>
#import <KVO-MVVM/KVONSObject.h>

NS_ASSUME_NONNULL_BEGIN

@interface DWBaseFormCellModel : NSObject
@interface DWBaseFormCellModel : KVONSObject

@property (nullable, copy, nonatomic) NSString *title;
@property (assign, nonatomic) NSUInteger tag;
Expand Down
3 changes: 3 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/DWBaseFormTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
NS_ASSUME_NONNULL_BEGIN

extern CGFloat const DW_FORM_CELL_VERTICAL_PADDING;
extern CGFloat const DW_FORM_CELL_TWOLINE_VERTICAL_PADDING;
extern CGFloat const DW_FORM_CELL_SPACING;
extern CGFloat const DW_FORM_CELL_TWOLINE_CONTENT_VERTICAL_SPACING;


typedef NS_ENUM(NSUInteger, DWFormCellRoundMask) {
DWFormCellRoundMask_Top = 1 << 0,
Expand Down
3 changes: 3 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/DWBaseFormTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
CGFloat const DW_FORM_CELL_VERTICAL_PADDING = 24.0;
CGFloat const DW_FORM_CELL_SPACING = 10.0;

CGFloat const DW_FORM_CELL_TWOLINE_VERTICAL_PADDING = 16.0;
CGFloat const DW_FORM_CELL_TWOLINE_CONTENT_VERTICAL_SPACING = 8.0;

static CGFloat const CORNER_RADIUS = 8.0;

static CGFloat SeparatorHeight(void) {
Expand Down
3 changes: 3 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/DWFormTableViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
//
#import <UIKit/UIKit.h>

#import "DWActionFormCellModel.h"
#import "DWFormSectionModel.h"
#import "DWKeyValueFormCellModel.h"
#import "DWPublicKeyGenerationCellModel.h"
#import "DWSelectorFormCellModel.h"
#import "DWSwitcherFormCellModel.h"

Expand Down
47 changes: 47 additions & 0 deletions DashWallet/Sources/UI/Menu/Forms/DWFormTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

#import "DWFormTableViewController.h"

#import "DWActionFormTableViewCell.h"
#import "DWKeyValueFormTableViewCell.h"
#import "DWPlaceholderFormTableViewCell.h"
#import "DWPublicKeyGenerationTableViewCell.h"
#import "DWSelectorFormTableViewCell.h"
#import "DWSharedUIConstants.h"
#import "DWSwitcherFormTableViewCell.h"
Expand All @@ -26,6 +29,7 @@
NS_ASSUME_NONNULL_BEGIN

static CGFloat const DEFAULT_CELL_HEIGHT = 74.0;
static CGFloat const PUBLIC_KEY_GENERATION_CELL_HEIGHT = 124.0;
static CGFloat const SECTION_SPACING = 10.0;

@interface DWFormTableViewController ()
Expand Down Expand Up @@ -55,6 +59,9 @@ - (void)viewDidLoad {
DWSelectorFormTableViewCell.class,
DWSwitcherFormTableViewCell.class,
DWPlaceholderFormTableViewCell.class,
DWKeyValueFormTableViewCell.class,
DWPublicKeyGenerationTableViewCell.class,
DWActionFormTableViewCell.class,
];

for (Class cellClass in cellClasses) {
Expand Down Expand Up @@ -145,13 +152,34 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.roundMask = roundMask;
return cell;
}
else if ([cellModel isKindOfClass:DWKeyValueFormCellModel.class]) {
NSString *cellId = NSStringFromClass(DWKeyValueFormTableViewCell.class);
DWKeyValueFormTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId
forIndexPath:indexPath];
cell.cellModel = (DWKeyValueFormCellModel *)cellModel;
return cell;
}
else if ([cellModel isKindOfClass:DWPublicKeyGenerationCellModel.class]) {
NSString *cellId = NSStringFromClass(DWPublicKeyGenerationTableViewCell.class);
DWPublicKeyGenerationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId
forIndexPath:indexPath];
cell.cellModel = (DWPublicKeyGenerationCellModel *)cellModel;
return cell;
}
else if ([cellModel isKindOfClass:DWPlaceholderFormCellModel.class]) {
NSString *cellId = NSStringFromClass(DWPlaceholderFormTableViewCell.class);
DWPlaceholderFormTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId
forIndexPath:indexPath];
cell.cellModel = (DWPlaceholderFormCellModel *)cellModel;
return cell;
}
else if ([cellModel isKindOfClass:DWActionFormCellModel.class]) {
NSString *cellId = NSStringFromClass(DWActionFormTableViewCell.class);
DWActionFormTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId
forIndexPath:indexPath];
cell.cellModel = (DWActionFormCellModel *)cellModel;
return cell;
}
else {
NSString *cellModelClass = NSStringFromClass(cellModel.class);
NSString *cellId = self.customCellModels[cellModelClass];
Expand Down Expand Up @@ -182,6 +210,9 @@ - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(
if ([cellModel isKindOfClass:DWPlaceholderFormCellModel.class]) {
return CGRectGetHeight(tableView.bounds);
}
else if ([cellModel isKindOfClass:DWPublicKeyGenerationTableViewCell.class]) {
return PUBLIC_KEY_GENERATION_CELL_HEIGHT;
}
else {
return DEFAULT_CELL_HEIGHT;
}
Expand All @@ -200,6 +231,22 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
selectorCellModel.didSelectBlock(selectorCellModel, indexPath);
}
}
else if ([cellModel isKindOfClass:DWActionFormCellModel.class]) {
DWActionFormCellModel *actionCellModel = (DWActionFormCellModel *)cellModel;
if (actionCellModel.didSelectBlock) {
actionCellModel.didSelectBlock(actionCellModel, indexPath);
}
}
else if ([cellModel isKindOfClass:DWKeyValueFormCellModel.class]) {
DWKeyValueFormCellModel *keyValueCellModel = (DWKeyValueFormCellModel *)cellModel;
DWKeyValueFormTableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
if (cell) {
[cell resignFirstResponder];
}
if (keyValueCellModel.actionBlock) {
keyValueCellModel.actionBlock();
}
}
else if ([cellModel isKindOfClass:DWSwitcherFormCellModel.class]) {
DWSwitcherFormCellModel *switcherCellModel = (DWSwitcherFormCellModel *)cellModel;
switcherCellModel.on = !switcherCellModel.on;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Created by Sam Westrich
// Copyright © 2019 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "DWBaseFormCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface DWKeyValueFormCellModel : DWBaseFormCellModel

@property (readonly, nonatomic) NSString *placeholderText;
@property (copy, nonatomic) NSString *valueText;
@property (assign, nonatomic) BOOL editable;
@property (copy, nonatomic) NSAttributedString *actionText;
@property (nullable, copy, nonatomic) void (^didChangeValueBlock)(DWKeyValueFormCellModel *cellModel);
@property (nullable, copy, nonatomic) void (^actionBlock)(void);

- (instancetype)initWithTitle:(nullable NSString *)title valueText:(NSString *)valueText NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithTitle:(nullable NSString *)title valueText:(NSString *)valueText placeholderText:(NSString *)placeholderText actionText:(NSAttributedString *)actionText;

@end

NS_ASSUME_NONNULL_END
Loading