Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

and show song actionsheet in the middle of the selected cell on iPad …

…has come back!
  • Loading branch information...
commit 60b2561895b10913497a37c236db1bae60d9911f 1 parent 8a146ae
Giovanni Messina authored
Showing with 11 additions and 9 deletions.
  1. +11 −9 XBMC Remote/DetailViewController.m
View
20 XBMC Remote/DetailViewController.m
@@ -774,15 +774,17 @@ -(void)showActionSheet:(NSIndexPath *)indexPath{
int numActions=[sheetActions count];
if (numActions){
NSDictionary *item = nil;
-// UITableViewCell *cell = nil;
+ UITableViewCell *cell = nil;
+ CGPoint offsetPoint;
if ([self.searchDisplayController isActive]){
item = [self.filteredListContent objectAtIndex:indexPath.row];
-// cell = [self.searchDisplayController.searchResultsTableView cellForRowAtIndexPath:indexPath];
-
+ cell = [self.searchDisplayController.searchResultsTableView cellForRowAtIndexPath:indexPath];
+ offsetPoint = [self.searchDisplayController.searchResultsTableView contentOffset];
}
else{
item = [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
-// cell = [dataList cellForRowAtIndexPath:indexPath];
+ cell = [dataList cellForRowAtIndexPath:indexPath];
+ offsetPoint = [dataList contentOffset];
}
NSString *title=[NSString stringWithFormat:@"%@\n%@", [item objectForKey:@"label"], [item objectForKey:@"genre"]];
@@ -796,12 +798,12 @@ -(void)showActionSheet:(NSIndexPath *)indexPath{
[action addButtonWithTitle:[sheetActions objectAtIndex:i]];
}
action.cancelButtonIndex = [action addButtonWithTitle:@"Cancel"];
-// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
[action showInView:self.view];
-// }
-// else{
-// [action showFromRect:CGRectMake(cell.frame.origin.x + (cell.frame.size.width/2), cell.frame.origin.y - cell.frame.size.height/2, 1, 1) inView:self.view animated:YES];
-// }
+ }
+ else{
+ [action showFromRect:CGRectMake(cell.frame.origin.x + (cell.frame.size.width/2), cell.frame.origin.y + cell.frame.size.height/2 - offsetPoint.y, 1, 1) inView:self.view animated:YES];
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.