diff --git a/XBMC Remote/DetailViewController.m b/XBMC Remote/DetailViewController.m index 603640a0c..c6818ce46 100644 --- a/XBMC Remote/DetailViewController.m +++ b/XBMC Remote/DetailViewController.m @@ -1507,6 +1507,7 @@ - (void)viewChild:(NSIndexPath*)indexPath item:(NSDictionary*)item displayPoint: else { [self addPlayback:item indexPath:indexPath position:indexPath.row shuffle:NO]; } + [self deselectAtIndexPath:indexPath]; return; } else { @@ -1550,6 +1551,7 @@ - (void)viewChild:(NSIndexPath*)indexPath item:(NSDictionary*)item displayPoint: } - (void)didSelectItemAtIndexPath:(NSIndexPath*)indexPath item:(NSDictionary*)item displayPoint:(CGPoint)point { + [self selectAtIndexPath:indexPath]; mainMenu *menuItem = [self getMainMenu:item]; int activeTab = [self getActiveTab:item]; NSDictionary *methods = menuItem.subItem.mainMethod[activeTab]; @@ -1606,6 +1608,7 @@ - (void)didSelectItemAtIndexPath:(NSIndexPath*)indexPath item:(NSDictionary*)ite NSString *message = [NSString stringWithFormat:@"%@ (type = '%@')", LOCALIZED_STR(@"Cannot do that"), item[@"type"]]; [Utilities showMessage:message color:[Utilities getSystemRed:0.95]]; } + [self deselectAtIndexPath:indexPath]; } else if (methods[@"method"] != nil && ![parameters[@"forceActionSheet"] boolValue] && !stackscrollFullscreen) { // There is a child and we want to show it (only when not in fullscreen) @@ -1625,6 +1628,7 @@ - (void)didSelectItemAtIndexPath:(NSIndexPath*)indexPath item:(NSDictionary*)ite else { [self addPlayback:item indexPath:indexPath position:indexPath.row shuffle:NO]; } + [self deselectAtIndexPath:indexPath]; } } } @@ -2847,7 +2851,6 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*) int rectOriginX = cell.frame.origin.x + cell.frame.size.width / 2; int rectOriginY = cell.frame.origin.y + cell.frame.size.height / 2 - offsetPoint.y; [self didSelectItemAtIndexPath:indexPath item:item displayPoint:CGPointMake(rectOriginX, rectOriginY)]; - return; } - (NSUInteger)indexOfObjectWithSeason:(NSString*)seasonNumber inArray:(NSArray*)array { @@ -3213,6 +3216,15 @@ - (id)getCell:(NSIndexPath*)indexPath { return cell; } +- (void)selectAtIndexPath:(NSIndexPath*)indexPath { + if (enableCollectionView) { + [collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + } + else { + [dataList selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; + } +} + - (void)deselectAtIndexPath:(NSIndexPath*)indexPath { if (enableCollectionView) { [collectionView deselectItemAtIndexPath:indexPath animated:NO]; @@ -3284,18 +3296,6 @@ - (void)handleLongPress:(UILongPressGestureRecognizer*)activeRecognizer { selectedIndexPath = indexPath; NSDictionary *item = [self getItemFromIndexPath:indexPath]; - - if ([self doesShowSearchResults]) { - [dataList selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; - } - else { - if (enableCollectionView) { - [collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; - } - else { - [dataList selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; - } - } mainMenu *menuItem = [self getMainMenu:item]; int activeTab = [self getActiveTab:item]; NSMutableArray *sheetActions = [menuItem.sheetActions[activeTab] mutableCopy]; @@ -3351,7 +3351,6 @@ - (void)showActionSheetOptions:(NSString*)title options:(NSArray*)sheetActions r UIAlertAction *action_cancel = [UIAlertAction actionWithTitle:LOCALIZED_STR(@"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { forceMusicAlbumMode = NO; - [self deselectAtIndexPath:selectedIndexPath]; }]; for (NSString *actionName in sheetActions) { @@ -3525,7 +3524,6 @@ - (void)actionSheetHandler:(NSString*)actiontitle origin:(CGPoint)origin fromvie UIAlertAction *action_cancel = [UIAlertAction actionWithTitle:LOCALIZED_STR(@"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { forceMusicAlbumMode = NO; - [self deselectAtIndexPath:selectedIndexPath]; }]; for (NSString *actiontitle in sheetActions) { @@ -4071,7 +4069,6 @@ - (void)deleteTimer:(NSDictionary*)item indexPath:(NSIndexPath*)indexPath { withParameters:parameters onCompletion:^(NSString *methodName, NSInteger callId, id methodResult, DSJSONRPCError *methodError, NSError *error) { [cellActivityIndicator stopAnimating]; - [self deselectAtIndexPath:indexPath]; if (error == nil && methodError == nil) { [self.searchController setActive:NO]; [Utilities AnimView:activeLayoutView AnimDuration:0.3 Alpha:1.0 XPos:viewWidth]; @@ -4118,7 +4115,6 @@ - (void)recordChannel:(NSDictionary*)item indexPath:(NSIndexPath*)indexPath { withParameters:parameters onCompletion:^(NSString *methodName, NSInteger callId, id methodResult, DSJSONRPCError *methodError, NSError *error) { [cellActivityIndicator stopAnimating]; - [self deselectAtIndexPath:indexPath]; if (error == nil && methodError == nil) { id cell = [self getCell:indexPath]; UIImageView *timerView = (UIImageView*)[cell viewWithTag:EPG_VIEW_CELL_RECORDING_ICON]; @@ -5473,14 +5469,9 @@ - (void)viewWillAppear:(BOOL)animated { self.slidingViewController.anchorLeftRevealAmount = 0; } NSIndexPath *selection = [dataList indexPathForSelectedRow]; - if (selection) { - [dataList deselectRowAtIndexPath:selection animated:NO]; - } - selection = [dataList indexPathForSelectedRow]; if (selection) { - [dataList deselectRowAtIndexPath:selection animated:YES]; + [dataList deselectRowAtIndexPath:selection animated:NO]; } - for (selection in [collectionView indexPathsForSelectedItems]) { [collectionView deselectItemAtIndexPath:selection animated:YES]; } diff --git a/XBMC Remote/iPad/StackScrollViewController.m b/XBMC Remote/iPad/StackScrollViewController.m index e746655c1..2d99ccc04 100644 --- a/XBMC Remote/iPad/StackScrollViewController.m +++ b/XBMC Remote/iPad/StackScrollViewController.m @@ -77,8 +77,6 @@ - (id)init { UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanFrom:)]; panRecognizer.delegate = self; panRecognizer.maximumNumberOfTouches = 1; - panRecognizer.delaysTouchesBegan = YES; - panRecognizer.delaysTouchesEnded = YES; panRecognizer.cancelsTouchesInView = YES; [self.view addGestureRecognizer:panRecognizer]; [self.view addSubview:slideViews];