|
@@ -48,7 +48,7 @@
|
|
|
NSUInteger _failedAttempts;
|
|
|
NSDate *_lockUntilDate;
|
|
|
|
|
|
- NCMainRefreshControl *refreshControl;
|
|
|
+ UIRefreshControl *refreshControl;
|
|
|
|
|
|
CCHud *_hud;
|
|
|
|
|
@@ -141,38 +141,43 @@
|
|
|
self.searchController.searchResultsUpdater = self;
|
|
|
self.searchController.dimsBackgroundDuringPresentation = NO;
|
|
|
self.searchController.searchBar.translucent = NO;
|
|
|
+ self.automaticallyAdjustsScrollViewInsets = false;
|
|
|
[self.searchController.searchBar sizeToFit];
|
|
|
- self.searchController.searchBar.delegate = self;
|
|
|
- self.searchController.searchBar.barTintColor = NCBrandColor.sharedInstance.brand;
|
|
|
- self.searchController.searchBar.backgroundColor = NCBrandColor.sharedInstance.brand;
|
|
|
- self.searchController.searchBar.backgroundImage = [UIImage new];
|
|
|
+ self.searchController.searchBar.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
|
|
|
+ self.searchController.searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
|
|
UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
|
|
|
if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
|
|
|
- [searchButton setTitleColor:NCBrandColor.sharedInstance.brandText forState:UIControlStateNormal];
|
|
|
+ [searchButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
|
|
|
}
|
|
|
UITextField *searchTextView = [self.searchController.searchBar valueForKey:@"searchField"];
|
|
|
if (searchTextView && [searchTextView isKindOfClass:[UITextField class]]) {
|
|
|
- searchTextView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
|
|
|
searchTextView.textColor = NCBrandColor.sharedInstance.textView;
|
|
|
}
|
|
|
- heightSearchBar = self.searchController.searchBar.frame.size.height;
|
|
|
|
|
|
+ self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, self.searchController.searchBar.frame.size.height + 40)];
|
|
|
+
|
|
|
// Load Rich Workspace
|
|
|
self.viewRichWorkspace = [[[NSBundle mainBundle] loadNibNamed:@"NCRichWorkspace" owner:self options:nil] firstObject];
|
|
|
if (@available(iOS 11, *)) {
|
|
|
UITapGestureRecognizer *viewRichWorkspaceTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
|
|
|
viewRichWorkspaceTapped.numberOfTapsRequired = 1;
|
|
|
viewRichWorkspaceTapped.delegate = self;
|
|
|
- [self.viewRichWorkspace addGestureRecognizer:viewRichWorkspaceTapped];
|
|
|
+ [self.viewRichWorkspace.richView addGestureRecognizer:viewRichWorkspaceTapped];
|
|
|
}
|
|
|
- heightRichWorkspace = UIScreen.mainScreen.bounds.size.height/4 + heightSearchBar;
|
|
|
- self.viewRichWorkspace.textViewTopConstraint.constant = heightSearchBar;
|
|
|
- [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, heightRichWorkspace)];
|
|
|
|
|
|
+ self.sortButton = self.viewRichWorkspace.sortButton;
|
|
|
+ heightSearchBar = self.viewRichWorkspace.topView.frame.size.height;
|
|
|
+
|
|
|
+ [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
|
|
|
+ [self.sortButton setTitle: [NSString stringWithFormat:@"Sorted by %@ ", [CCUtility getOrderSettings]] forState:UIControlStateNormal];
|
|
|
+ [self.sortButton addTarget:self action:@selector(toggleReMainMenu) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+
|
|
|
+ heightRichWorkspace = UIScreen.mainScreen.bounds.size.height / 4 + heightSearchBar;
|
|
|
+ [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, heightRichWorkspace)];
|
|
|
+ [self.viewRichWorkspace.searchViewHolder addSubview:self.searchController.searchBar];
|
|
|
// Table Header View
|
|
|
[self.tableView setTableHeaderView:self.viewRichWorkspace];
|
|
|
- [self.tableView.tableHeaderView addSubview:self.searchController.searchBar];
|
|
|
-
|
|
|
+
|
|
|
// Register cell
|
|
|
[self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
|
|
|
[self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
|
|
@@ -197,7 +202,6 @@
|
|
|
|
|
|
// Title
|
|
|
[self setTitle];
|
|
|
-
|
|
|
// changeTheming
|
|
|
[self changeTheming];
|
|
|
}
|
|
@@ -313,6 +317,10 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
|
|
+ [self updateNavBarShadow:scrollView.contentOffset.y > 0];
|
|
|
+}
|
|
|
+
|
|
|
- (void)changeTheming
|
|
|
{
|
|
|
[appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
|
|
@@ -321,21 +329,21 @@
|
|
|
[[NCMainCommon sharedInstance] createImagesThemingColor];
|
|
|
|
|
|
// Refresh control
|
|
|
- refreshControl.tintColor = NCBrandColor.sharedInstance.brandText;
|
|
|
- refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand;
|
|
|
+ refreshControl.tintColor = UIColor.lightGrayColor;
|
|
|
+ refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
|
|
|
|
|
|
+ [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
|
|
|
// color searchbar
|
|
|
- self.searchController.searchBar.barTintColor = NCBrandColor.sharedInstance.brand;
|
|
|
- self.searchController.searchBar.backgroundColor = NCBrandColor.sharedInstance.brand;
|
|
|
+ self.searchController.searchBar.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
|
|
|
+ self.searchController.searchBar.tintColor = NCBrandColor.sharedInstance.brand;
|
|
|
// color searchbbar button text (cancel)
|
|
|
UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
|
|
|
if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
|
|
|
- [searchButton setTitleColor:NCBrandColor.sharedInstance.brandText forState:UIControlStateNormal];
|
|
|
+ [searchButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
|
|
|
}
|
|
|
// color textview searchbbar
|
|
|
UITextField *searchTextView = [self.searchController.searchBar valueForKey:@"searchField"];
|
|
|
if (searchTextView && [searchTextView isKindOfClass:[UITextField class]]) {
|
|
|
- searchTextView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
|
|
|
searchTextView.textColor = NCBrandColor.sharedInstance.textView;
|
|
|
}
|
|
|
|
|
@@ -689,9 +697,8 @@
|
|
|
|
|
|
self.tableView.refreshControl = refreshControl;
|
|
|
|
|
|
- refreshControl.tintColor = NCBrandColor.sharedInstance.brandText;
|
|
|
- refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand;
|
|
|
-
|
|
|
+ refreshControl.tintColor = UIColor.lightGrayColor;
|
|
|
+ refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
|
|
|
[refreshControl addTarget:self action:@selector(refreshControlTarget) forControlEvents:UIControlEventValueChanged];
|
|
|
}
|
|
|
|
|
@@ -730,33 +737,16 @@
|
|
|
self.navigationItem.title = [NSString stringWithFormat:@"%@ : %lu / %lu", NSLocalizedString(@"_selected_", nil), (unsigned long)selezionati, (unsigned long)totali];
|
|
|
|
|
|
} else {
|
|
|
-
|
|
|
- // we are in home : LOGO BRAND
|
|
|
- if ([_serverUrl isEqualToString:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]]) {
|
|
|
-
|
|
|
- self.navigationItem.title = nil;
|
|
|
-
|
|
|
- UIImage *image = [self getImageLogoHome];
|
|
|
-
|
|
|
- _imageTitleHome = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 30)]; // IMAGE = 120 x 60
|
|
|
- _imageTitleHome.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
- _imageTitleHome.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
- _imageTitleHome.image = image;
|
|
|
-
|
|
|
- // backbutton
|
|
|
- self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:nil action:nil];
|
|
|
-
|
|
|
- [_imageTitleHome setUserInteractionEnabled:YES];
|
|
|
- UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(menuLogo:)];
|
|
|
- [singleTap setNumberOfTapsRequired:1];
|
|
|
- [_imageTitleHome addGestureRecognizer:singleTap];
|
|
|
-
|
|
|
- self.navigationItem.titleView = _imageTitleHome;
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- self.navigationItem.title = _titleMain;
|
|
|
- self.navigationItem.titleView = nil;
|
|
|
+ if (@available(iOS 11.0, *)) {
|
|
|
+ if (_isRoot) {
|
|
|
+ self.navigationController.navigationBar.prefersLargeTitles = true;
|
|
|
+ self.navigationItem.title = NCBrandOptions.sharedInstance.brand;
|
|
|
+
|
|
|
+ self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -788,13 +778,9 @@
|
|
|
|
|
|
- (void)setUINavigationBarDefault
|
|
|
{
|
|
|
- UIBarButtonItem *buttonMore, *buttonNotification, *buttonSelect;
|
|
|
-
|
|
|
- // =
|
|
|
- buttonMore = [[UIBarButtonItem alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationSort"] width:50 height:50 color:NCBrandColor.sharedInstance.textView] style:UIBarButtonItemStylePlain target:self action:@selector(toggleReMainMenu)];
|
|
|
- buttonMore.enabled = true;
|
|
|
+ UIBarButtonItem *buttonNotification, *buttonSelect;
|
|
|
|
|
|
- buttonSelect = [[UIBarButtonItem alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"select"] width:50 height:50 color:NCBrandColor.sharedInstance.textView] style:UIBarButtonItemStylePlain target:self action:@selector(tableViewToggle)];
|
|
|
+ buttonSelect = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_select_", @"") style:UIBarButtonItemStylePlain target:self action:@selector(tableViewToggle)];
|
|
|
buttonSelect.enabled = true;
|
|
|
|
|
|
// <
|
|
@@ -809,9 +795,9 @@
|
|
|
}
|
|
|
|
|
|
if (buttonNotification)
|
|
|
- self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonMore, buttonSelect, buttonNotification, nil];
|
|
|
+ self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonSelect, buttonNotification, nil];
|
|
|
else
|
|
|
- self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonMore, buttonSelect, nil];
|
|
|
+ self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonSelect, nil];
|
|
|
|
|
|
self.navigationItem.leftBarButtonItem = nil;
|
|
|
}
|
|
@@ -1426,7 +1412,7 @@
|
|
|
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
|
|
|
{
|
|
|
// Color text "Cancel"
|
|
|
- [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:NCBrandColor.sharedInstance.brandText];
|
|
|
+ [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:NCBrandColor.sharedInstance.brand];
|
|
|
|
|
|
if (searchController.isActive) {
|
|
|
[self deleteRefreshControl];
|
|
@@ -2913,8 +2899,8 @@
|
|
|
[self.viewRichWorkspace setFrame:CGRectMake(self.tableView.tableHeaderView.frame.origin.x, self.tableView.tableHeaderView.frame.origin.y, self.tableView.frame.size.width, heightRichWorkspace)];
|
|
|
}
|
|
|
|
|
|
+ self.searchController.searchBar.frame = self.viewRichWorkspace.searchViewHolder.frame;
|
|
|
[self.viewRichWorkspace loadWithRichWorkspaceText:self.richWorkspaceText];
|
|
|
- self.searchController.searchBar.frame = CGRectMake(self.searchController.searchBar.frame.origin.x, self.searchController.searchBar.frame.origin.y, self.tableView.frame.size.width, heightSearchBar);
|
|
|
[self.tableView reloadData];
|
|
|
}
|
|
|
|