Skip to content

Commit

Permalink
activeLayoutView shall use UTableView type
Browse files Browse the repository at this point in the history
  • Loading branch information
wutschel committed Sep 25, 2024
1 parent ac9ac42 commit 046a300
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion XBMC Remote/DetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
int fullscreenCellGridWidth;
int fullscreenCellGridHeight;
int cellMinimumLineSpacing;
id activeLayoutView;
UITableView *activeLayoutView;
UILongPressGestureRecognizer *longPressGestureCollection;
UILongPressGestureRecognizer *longPressGestureList;
int posterFontSize;
Expand Down
64 changes: 30 additions & 34 deletions XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ - (void)showMore {
}
choosedTab = MAX_NORMAL_BUTTONS;
[buttonsIB[choosedTab] setSelected:YES];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:viewWidth];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:viewWidth];
int i;
NSInteger count = menuItem.mainParameters.count;
NSMutableArray *moreMenu = [NSMutableArray new];
Expand Down Expand Up @@ -1134,12 +1134,11 @@ - (void)changeViewMode:(ViewModes)newViewMode forceRefresh:(BOOL)refresh {
duration: 0.2
options: UIViewAnimationOptionBeginFromCurrentState
animations: ^{
((UITableView*)activeLayoutView).alpha = 1.0;
CGRect frame;
frame = [activeLayoutView frame];
activeLayoutView.alpha = 1.0;
CGRect frame = activeLayoutView.frame;
frame.origin.x = viewWidth;
frame.origin.y = 0;
((UITableView*)activeLayoutView).frame = frame;
activeLayoutView.frame = frame;
}
completion:^(BOOL finished) {
[self changeViewMode:newViewMode];
Expand Down Expand Up @@ -1195,7 +1194,7 @@ - (void)configureLibraryView {
collectionView.dataSource = self;
dataList.scrollsToTop = NO;
collectionView.scrollsToTop = YES;
activeLayoutView = collectionView;
activeLayoutView = (UITableView*)collectionView;

[self setSearchBar:self.searchController.searchBar toDark:YES];
}
Expand Down Expand Up @@ -1239,7 +1238,7 @@ - (void)handleChangeTab:(int)newChoosedTab fromMoreItems:(BOOL)fromMoreItems {
return;
}
[activeLayoutView setUserInteractionEnabled:YES];
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];

mainMenu *menuItem = self.detailItem;
NSDictionary *methods = nil;
Expand Down Expand Up @@ -1324,11 +1323,11 @@ - (void)handleChangeTab:(int)newChoosedTab fromMoreItems:(BOOL)fromMoreItems {
[self setButtonViewContent:choosedTab];
[self checkDiskCache];

[Utilities SetView:(UITableView*)activeLayoutView Alpha:1.0 XPos:viewWidth];
[Utilities SetView:activeLayoutView Alpha:1.0 XPos:viewWidth];

enableCollectionView = newEnableCollectionView;
recentlyAddedView = [parameters[@"collectionViewRecentlyAdded"] boolValue];
[activeLayoutView setContentOffset:[(UITableView*)activeLayoutView contentOffset] animated:NO];
[activeLayoutView setContentOffset:activeLayoutView.contentOffset animated:NO];
[self checkFullscreenButton:NO];
[self addExtraProperties:mutableProperties newParams:mutableParameters params:parameters];
if ([parameters[@"blackTableSeparator"] boolValue] && ![Utilities getPreferTvPosterMode]) {
Expand All @@ -1343,7 +1342,7 @@ - (void)handleChangeTab:(int)newChoosedTab fromMoreItems:(BOOL)fromMoreItems {
}
else {
[activityIndicatorView stopAnimating];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
}
}

Expand Down Expand Up @@ -3731,12 +3730,11 @@ - (void)actionSheetHandler:(NSString*)actiontitle origin:(CGPoint)origin fromcon
duration: 0.2
options: UIViewAnimationOptionBeginFromCurrentState
animations: ^{
((UITableView*)activeLayoutView).alpha = 1.0;
CGRect frame;
frame = [activeLayoutView frame];
activeLayoutView.alpha = 1.0;
CGRect frame = activeLayoutView.frame;
frame.origin.x = viewWidth;
frame.origin.y = 0;
((UITableView*)activeLayoutView).frame = frame;
activeLayoutView.frame = frame;
}
completion:^(BOOL finished) {
NSString *sortMethod = sortDictionary[@"method"][sort_method_index];
Expand All @@ -3757,12 +3755,11 @@ - (void)actionSheetHandler:(NSString*)actiontitle origin:(CGPoint)origin fromcon
duration: 0.2
options: UIViewAnimationOptionBeginFromCurrentState
animations: ^{
((UITableView*)activeLayoutView).alpha = 1.0;
CGRect frame;
frame = [activeLayoutView frame];
activeLayoutView.alpha = 1.0;
CGRect frame = activeLayoutView.frame;
frame.origin.x = viewWidth;
frame.origin.y = 0;
((UITableView*)activeLayoutView).frame = frame;
activeLayoutView.frame = frame;
}
completion:^(BOOL finished) {
sortAscDesc = !([sortAscDesc isEqualToString:@"ascending"] || sortAscDesc == nil) ? @"ascending" : @"descending";
Expand Down Expand Up @@ -3965,10 +3962,10 @@ - (void)toggleFullscreen:(id)sender {
[self choseParams];
if (forceCollection) {
forceCollection = NO;
[Utilities SetView:(UITableView*)activeLayoutView Alpha:0.0 XPos:viewWidth];
[Utilities SetView:activeLayoutView Alpha:0.0 XPos:viewWidth];
enableCollectionView = NO;
[self configureLibraryView];
[Utilities SetView:(UITableView*)activeLayoutView Alpha:0.0 XPos:0];
[Utilities SetView:activeLayoutView Alpha:0.0 XPos:0];
}
[self setFlowLayoutParams];
[collectionView.collectionViewLayout invalidateLayout];
Expand Down Expand Up @@ -4010,10 +4007,10 @@ - (void)toggleFullscreen:(id)sender {
moreItemsViewController.view.hidden = YES;
if (!enableCollectionView) {
forceCollection = YES;
[Utilities SetView:(UITableView*)activeLayoutView Alpha:0.0 XPos:viewWidth];
[Utilities SetView:activeLayoutView Alpha:0.0 XPos:viewWidth];
enableCollectionView = YES;
[self configureLibraryView];
[Utilities SetView:(UITableView*)activeLayoutView Alpha:0.0 XPos:0];
[Utilities SetView:activeLayoutView Alpha:0.0 XPos:0];
}
else {
forceCollection = NO;
Expand Down Expand Up @@ -4154,7 +4151,7 @@ - (void)deleteTimer:(NSDictionary*)item indexPath:(NSIndexPath*)indexPath {
[self deselectAtIndexPath:indexPath];
if (error == nil && methodError == nil) {
[self.searchController setActive:NO];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:viewWidth];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:viewWidth];
[self startRetrieveDataWithRefresh:YES];
}
else {
Expand Down Expand Up @@ -4728,7 +4725,7 @@ - (void)startRetrieveDataWithRefresh:(BOOL)forceRefresh {
}
else {
[activityIndicatorView stopAnimating];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
}
}

Expand Down Expand Up @@ -4782,7 +4779,7 @@ - (void)loadDetailedData:(NSArray*)itemsAndTabs index:(int)index results:(NSMuta
self.richResults = richData;

// Stop refresh animation
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];
[activeLayoutView setUserInteractionEnabled:YES];

// Save and display
Expand Down Expand Up @@ -5120,15 +5117,15 @@ - (void)saveAndShowResultsRefresh:(BOOL)forceRefresh params:(NSMutableDictionary
filterModeType == ViewModeListened ||
filterModeType == ViewModeNotListened) {
if (forceRefresh) {
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];
[activeLayoutView setUserInteractionEnabled:YES];
[self saveData:mutableParameters];
}
[self changeViewMode:filterModeType forceRefresh:forceRefresh];
}
else {
if (forceRefresh) {
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];
[activeLayoutView setUserInteractionEnabled:YES];
}
[self saveData:mutableParameters];
Expand All @@ -5139,14 +5136,14 @@ - (void)saveAndShowResultsRefresh:(BOOL)forceRefresh params:(NSMutableDictionary
- (void)animateNoResultsFound {
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:1.0];
[activityIndicatorView stopAnimating];
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];
[self setGridListButtonImage:enableCollectionView];
[self setSortButtonImage:sortAscDesc];
}

- (void)showNoResultsFound:(NSMutableArray*)resultStoreArray refresh:(BOOL)forceRefresh {
if (forceRefresh) {
[((UITableView*)activeLayoutView).pullToRefreshView stopAnimating];
[activeLayoutView.pullToRefreshView stopAnimating];
[activeLayoutView setUserInteractionEnabled:YES];
}
[resultStoreArray removeAllObjects];
Expand Down Expand Up @@ -5491,7 +5488,7 @@ - (void)displayData {
[dataList setContentOffset:CGPointMake(0, iOSYDelta) animated:NO];
[collectionView layoutSubviews];
[collectionView setContentOffset:CGPointMake(0, iOSYDelta) animated:NO];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0 YPos:0];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0 YPos:0];
if (channelGuideView && autoScrollTable != nil && autoScrollTable.row < [dataList numberOfRowsInSection:autoScrollTable.section]) {
[dataList scrollToRowAtIndexPath:autoScrollTable atScrollPosition:UITableViewScrollPositionTop animated: NO];
}
Expand Down Expand Up @@ -6298,16 +6295,15 @@ - (void)handleChangeLibraryView {
delay:0.0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
CGRect frame;
frame = [activeLayoutView frame];
CGRect frame = activeLayoutView.frame;
frame.origin.x = viewWidth;
((UITableView*)activeLayoutView).frame = frame;
activeLayoutView.frame = frame;
}
completion:^(BOOL finished) {
recentlyAddedView = [parameters[@"collectionViewRecentlyAdded"] boolValue];
enableCollectionView = [self collectionViewIsEnabled];
[self configureLibraryView];
[Utilities AnimView:(UITableView*)activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
[Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:0];
[activeLayoutView setContentOffset:CGPointMake(0, iOSYDelta) animated:NO];
}];
}
Expand Down

0 comments on commit 046a300

Please sign in to comment.