Skip to content

Commit

Permalink
v1.3.8 hot fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
HDB-Li committed Feb 15, 2020
1 parent 877213a commit fb49743
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 115 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [1.3.8](https://github.com/HDB-Li/LLDebugTool/releases/tag/1.3.8) (02/12/2020)
## [1.3.8](https://github.com/HDB-Li/LLDebugTool/releases/tag/1.3.8) (02/15/2020)

### Add `Short Cut` function and fix some bugs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@
#import "LLNetworkViewController.h"

#import "LLNetworkDetailViewController.h"
#import "LLNetworkFilterViewController.h"
#import "LLNetworkFilterView.h"
#import "LLImageNameConfig.h"
#import "LLInternalMacros.h"
#import "LLStorageManager.h"
#import "LLNetworkModel.h"
#import "LLNetworkCell.h"
#import "LLToastUtils.h"
#import "LLFactory.h"
#import "LLConfig.h"
#import "LLConst.h"

Expand All @@ -43,13 +42,7 @@

@interface LLNetworkViewController ()

@property (nonatomic, strong) LLNetworkFilterViewController *filterController;

@property (nonatomic, strong) UIView *filterView;

@property (nonatomic, strong) UIView *maskView;

@property (nonatomic, assign) BOOL isFilter;
@property (nonatomic, strong) LLNetworkFilterView *filterView;

// Data
@property (nonatomic, strong) NSArray *currentHost;
Expand Down Expand Up @@ -82,45 +75,33 @@ - (void)viewDidLoad {

[self.tableView registerClass:[LLNetworkCell class] forCellReuseIdentifier:kNetworkCellID];

// self.filterView = [[LLNetworkFilterView alloc] initWithFrame:CGRectMake(0, self.searchTextField.LL_bottom + kLLGeneralMargin, LL_SCREEN_WIDTH, 40)];
// __weak typeof(self) weakSelf = self;
// self.filterView.changeBlock = ^(NSArray *hosts, NSArray *types, NSDate *from, NSDate *end) {
// weakSelf.currentHost = hosts;
// weakSelf.currentTypes = types;
// weakSelf.currentFromDate = from;
// weakSelf.currentEndDate = end;
// [weakSelf filterData];
// };
// self.filterView.filterChangeStateBlock = ^{
// [weakSelf.tableView reloadData];
// };
// [self.filterController configWithData:self.oriDataArray];
// [self.headerView addSubview:self.filterView];
// self.headerView.frame = CGRectMake(self.headerView.LL_x, self.headerView.LL_y, self.headerView.LL_width, self.filterView.LL_bottom);

[self.navigationController.view addSubview:self.maskView];
[self.navigationController.view addSubview:self.filterView];
self.filterView = [[LLNetworkFilterView alloc] initWithFrame:CGRectMake(0, self.searchTextField.LL_bottom + kLLGeneralMargin, LL_SCREEN_WIDTH, 40)];
__weak typeof(self) weakSelf = self;
self.filterView.changeBlock = ^(NSArray *hosts, NSArray *types, NSDate *from, NSDate *end) {
weakSelf.currentHost = hosts;
weakSelf.currentTypes = types;
weakSelf.currentFromDate = from;
weakSelf.currentEndDate = end;
[weakSelf filterData];
};
self.filterView.filterChangeStateBlock = ^{
[weakSelf.tableView reloadData];
};
[self.filterView configWithData:self.oriDataArray];
[self.headerView addSubview:self.filterView];
self.headerView.frame = CGRectMake(self.headerView.LL_x, self.headerView.LL_y, self.headerView.LL_width, self.filterView.LL_bottom);

[self loadData];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// [self.filterView cancelFiltering];
}

- (void)backAction:(UIButton *)sender {
if (self.isFilter) {
[self hideFilterView];
} else {
[super backAction:sender];
}
[self.filterView cancelFiltering];
}

- (void)rightItemClick:(UIButton *)sender {
// [super rightItemClick:sender];
[self showFilterView];
// [self.filterView cancelFiltering];
[super rightItemClick:sender];
[self.filterView cancelFiltering];
}

- (BOOL)isSearching {
Expand Down Expand Up @@ -172,23 +153,23 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
return self.headerView.LL_height;
}

//#pragma mark - UIScrollViewDelegate
//- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
// [super scrollViewWillBeginDragging:scrollView];
// [self.filterView cancelFiltering];
//}
//
//#pragma mark - UITextFieldDelegate
//- (void)textFieldDidBeginEditing:(UITextField *)textField {
// [super textFieldDidBeginEditing:textField];
// [self.filterView cancelFiltering];
//}
//
//- (void)textFieldDidChange:(NSString *)text {
// [super textFieldDidChange:text];
// [self.filterView cancelFiltering];
// [self filterData];
//}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
[super scrollViewWillBeginDragging:scrollView];
[self.filterView cancelFiltering];
}

#pragma mark - UITextFieldDelegate
- (void)textFieldDidBeginEditing:(UITextField *)textField {
[super textFieldDidBeginEditing:textField];
[self.filterView cancelFiltering];
}

- (void)textFieldDidChange:(NSString *)text {
[super textFieldDidChange:text];
[self.filterView cancelFiltering];
[self filterData];
}

#pragma mark - Primary
- (void)loadData {
Expand All @@ -201,7 +182,7 @@ - (void)loadData {
[weakSelf.oriDataArray addObjectsFromArray:result];
[weakSelf.searchDataArray removeAllObjects];
[weakSelf.searchDataArray addObjectsFromArray:weakSelf.oriDataArray];
[weakSelf.filterController configWithData:weakSelf.oriDataArray];
[weakSelf.filterView configWithData:weakSelf.oriDataArray];
[weakSelf.tableView reloadData];
}];
}
Expand Down Expand Up @@ -277,61 +258,4 @@ - (void)filterData {
}
}

- (void)showFilterView {
if (self.isFilter) {
return;
}
self.isFilter = YES;
self.maskView.hidden = NO;
self.maskView.alpha = 0;
self.filterView.LL_right = 0;
[UIView animateWithDuration:0.25 animations:^{
self.filterView.LL_left = 0;
self.maskView.alpha = 1;
self.view.LL_x = self.filterView.LL_width;
} completion:^(BOOL finished) {

}];
}

- (void)hideFilterView {
if (!self.isFilter) {
return;
}
self.isFilter = NO;
[UIView animateWithDuration:0.25 animations:^{
self.filterView.LL_right = 0;
self.maskView.alpha = 0;
self.view.LL_x = 0;
} completion:^(BOOL finished) {
self.maskView.hidden = YES;
}];
}

#pragma mark - Getters and setters
- (UIView *)filterView {
if (!_filterView) {
_filterView = self.filterController.view;
_filterView.frame = CGRectMake(-floor(LL_SCREEN_WIDTH * 0.7), LL_NAVIGATION_HEIGHT, floor(LL_SCREEN_WIDTH * 0.7), LL_SCREEN_HEIGHT - LL_NAVIGATION_HEIGHT);
}
return _filterView;
}

- (LLNetworkFilterViewController *)filterController {
if (!_filterController) {
_filterController = [[LLNetworkFilterViewController alloc] init];
}
return _filterController;
}

- (UIView *)maskView {
if (!_maskView) {
_maskView = [LLFactory getView];
_maskView.frame = CGRectMake(0, LL_NAVIGATION_HEIGHT, LL_SCREEN_WIDTH, LL_SCREEN_HEIGHT - LL_NAVIGATION_HEIGHT);
_maskView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6];
_maskView.hidden = YES;
}
return _maskView;
}

@end

0 comments on commit fb49743

Please sign in to comment.