Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions XBMC Remote/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ - (void)registerDefaultsFromSettingsBundle {
}

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
// iOS 13 and later use appearance for the navigationbar, from iOS 15 this is required as it else defaults to unwanted transparency
// Make navigation bar transparent
if (@available(iOS 13, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
[appearance configureWithTransparentBackground];
appearance.backgroundEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
appearance.titleTextAttributes = @{NSForegroundColorAttributeName : UIColor.whiteColor};
appearance.backgroundColor = NAVBAR_TINT_COLOR;
appearance.backgroundColor = UIColor.clearColor;
[UINavigationBar appearance].standardAppearance = appearance;
[UINavigationBar appearance].scrollEdgeAppearance = appearance;
}
Expand Down
33 changes: 20 additions & 13 deletions XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,9 @@ - (void)showMore {
if (moreItemsViewController == nil) {
moreItemsViewController = [[MoreItemsViewController alloc] initWithFrame:CGRectMake(dataList.bounds.size.width, 0, dataList.bounds.size.width, dataList.bounds.size.height) mainMenu:moreMenu];
moreItemsViewController.view.backgroundColor = UIColor.clearColor;
UIEdgeInsets tableViewInsets = UIEdgeInsetsZero;
tableViewInsets.bottom = buttonsViewBgToolbar.frame.size.height;
moreItemsViewController.tableView.contentInset = tableViewInsets;
moreItemsViewController.tableView.scrollIndicatorInsets = tableViewInsets;
[moreItemsViewController.tableView setContentOffset:CGPointMake(0, - tableViewInsets.top) animated:NO];
moreItemsViewController.tableView.contentInset = activeLayoutView.contentInset;
[self setViewInset:moreItemsViewController.tableView bottom:buttonsViewBgToolbar.frame.size.height];
[moreItemsViewController.tableView setContentOffset:CGPointMake(0, -moreItemsViewController.tableView.contentInset.top) animated:NO];
[maskView insertSubview:moreItemsViewController.view aboveSubview:dataList];
}

Expand Down Expand Up @@ -1910,13 +1908,13 @@ - (void)indexViewValueChanged:(BDKCollectionIndexView*)sender {
}
else if (sender.currentIndex == 0) {
if (enableCollectionView) {
[collectionView setContentOffset:CGPointZero animated:NO];
[collectionView setContentOffset:CGPointMake(0, -collectionView.contentInset.top) animated:NO];
if (sectionNameOverlayView == nil && stackscrollFullscreen) {
[self initSectionNameOverlayView];
}
}
else {
[dataList setContentOffset:CGPointZero animated:NO];
[dataList setContentOffset:CGPointMake(0, -dataList.contentInset.top) animated:NO];
}
sectionNameLabel.text = @"🔍";
return;
Expand Down Expand Up @@ -1957,7 +1955,7 @@ - (void)indexViewValueChanged:(BDKCollectionIndexView*)sender {
if (index != NSNotFound) {
NSIndexPath *path = [NSIndexPath indexPathForItem:index inSection:0];
[collectionView scrollToItemAtIndexPath:path atScrollPosition:UICollectionViewScrollPositionTop animated:NO];
collectionView.contentOffset = CGPointMake(collectionView.contentOffset.x, collectionView.contentOffset.y - GRID_SECTION_HEADER_HEIGHT);
collectionView.contentOffset = CGPointMake(collectionView.contentOffset.x, collectionView.contentOffset.y - GRID_SECTION_HEADER_HEIGHT + [Utilities getTopPadding]);
}
return;
}
Expand Down Expand Up @@ -2120,6 +2118,10 @@ - (void)setCellLayoutParameters {

#pragma mark - Table Management

- (CGFloat)getTableInsetTop {
return IS_IPHONE ? [Utilities getTopPaddingWithNavBar:self.navigationController] : 0;
}

- (void)setSearchBar:(UISearchBar*)searchBar toDark:(BOOL)isDark {
if (isDark) {
searchBar.backgroundColor = SYSTEMGRAY6_DARKMODE;
Expand Down Expand Up @@ -5478,7 +5480,7 @@ - (void)buildButtons:(int)activeTab {
// no button, no toolbar
button1.hidden = button2.hidden = button3.hidden = button4.hidden = button5.hidden = YES;
frame = dataList.frame;
frame.size.height = self.view.bounds.size.height;
frame.size.height = maskView.bounds.size.height;
dataList.frame = frame;
break;
case 1:
Expand Down Expand Up @@ -5828,7 +5830,7 @@ - (void)viewDidLoad {
[self initSearchController];
self.navigationController.view.backgroundColor = UIColor.blackColor;
self.definesPresentationContext = NO;
iOSYDelta = self.searchController.searchBar.frame.size.height;
iOSYDelta = self.searchController.searchBar.frame.size.height - [self getTableInsetTop];
dataList.tableHeaderView = [self createFakeSearchbarInDark:NO];

if (@available(iOS 15.0, *)) {
Expand All @@ -5839,11 +5841,16 @@ - (void)viewDidLoad {

[button7 addTarget:self action:@selector(handleChangeSortLibrary) forControlEvents:UIControlEventTouchUpInside];
self.edgesForExtendedLayout = UIRectEdgeNone;
UIEdgeInsets viewInsets = dataList.contentInset;
viewInsets.top = [self getTableInsetTop];
dataList.contentInset = viewInsets;
dataList.indicatorStyle = UIScrollViewIndicatorStyleDefault;

CGRect frame = dataList.frame;
frame.size.height = self.view.bounds.size.height;
dataList.frame = frame;
CGRect frame = maskView.frame;
frame.origin.y -= [self getTableInsetTop];
frame.size.height += [self getTableInsetTop];
maskView.frame = frame;

buttonsViewBgToolbar.hidden = NO;

__weak DetailViewController *weakSelf = self;
Expand Down
9 changes: 8 additions & 1 deletion XBMC Remote/Utilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,14 @@ + (CGFloat)getTopPadding {
}

+ (CGFloat)getTopPaddingWithNavBar:(UINavigationController*)navCtrl {
CGFloat topPadding = UIApplication.sharedApplication.statusBarFrame.size.height + navCtrl.navigationBar.frame.size.height;
// Workaround: Using CGRectGetMaxY resolves a layout issue where otherwise the inset ends below the navbar (e.g.
// iPhone 14 Pro iOS18), but at the same time it causes an issue with the inset not taking into account the status
// bar (e.g. iPod Touch iOS15.5). This seems to be caused by calling this method from viewDidLoad instead
// of willLayoutSubviews. This workaround avoids rework of DetailVC's delicate layout.
CGFloat topPadding = CGRectGetMaxY(navCtrl.navigationBar.frame);
if (topPadding <= navCtrl.navigationBar.frame.size.height) {
topPadding = UIApplication.sharedApplication.statusBarFrame.size.height + navCtrl.navigationBar.frame.size.height;
}
return topPadding;
}

Expand Down