diff --git a/Apple-TV/Assets.xcassets/sortingImage.imageset/Contents.json b/Apple-TV/Assets.xcassets/sortingImage.imageset/Contents.json new file mode 100644 index 0000000000..af6880b721 --- /dev/null +++ b/Apple-TV/Assets.xcassets/sortingImage.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "sortingImage@1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "sortingImage@2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@1.png b/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@1.png new file mode 100644 index 0000000000..0633bf6b0f Binary files /dev/null and b/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@1.png differ diff --git a/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@2.png b/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@2.png new file mode 100644 index 0000000000..09c4cf94d8 Binary files /dev/null and b/Apple-TV/Assets.xcassets/sortingImage.imageset/sortingImage@2.png differ diff --git a/Apple-TV/VLCOpenNetworkStreamTVViewController.h b/Apple-TV/VLCOpenNetworkStreamTVViewController.h index e514cbb41c..40590bd924 100644 --- a/Apple-TV/VLCOpenNetworkStreamTVViewController.h +++ b/Apple-TV/VLCOpenNetworkStreamTVViewController.h @@ -22,8 +22,10 @@ @property (readwrite, nonatomic, weak) IBOutlet UIImageView *nothingFoundConeImageView; @property (readwrite, nonatomic, weak) IBOutlet UIButton *emptyListButton; +@property (readwrite, nonatomic, weak) IBOutlet UIButton *reverseListSortingButton; - (IBAction)URLEnteredInField:(id)sender; - (IBAction)emptyListAction:(id)sender; +- (IBAction)reverseListSortingAction:(id)sender; @end diff --git a/Apple-TV/VLCOpenNetworkStreamTVViewController.m b/Apple-TV/VLCOpenNetworkStreamTVViewController.m index 91ff2bfdac..3a43812ba6 100644 --- a/Apple-TV/VLCOpenNetworkStreamTVViewController.m +++ b/Apple-TV/VLCOpenNetworkStreamTVViewController.m @@ -19,6 +19,7 @@ @interface VLCOpenNetworkStreamTVViewController () { NSMutableArray *_recentURLs; NSMutableDictionary *_recentURLTitles; + BOOL newestFirst; } @property (nonatomic) NSIndexPath *currentlyFocusedIndexPath; @end @@ -50,6 +51,9 @@ - (void)viewDidLoad { self.playURLField.textContentType = UITextContentTypeURL; } self.emptyListButton.accessibilityLabel = NSLocalizedString(@"BUTTON_RESET", nil); + self.reverseListSortingButton.accessibilityLabel = NSLocalizedString(@"BUTTON_REVERSE", nil); + + newestFirst = false; self.previouslyPlayedStreamsTableView.backgroundColor = [UIColor clearColor]; self.previouslyPlayedStreamsTableView.rowHeight = UITableViewAutomaticDimension; @@ -129,6 +133,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger if (count > 0) { self.nothingFoundView.hidden = YES; self.emptyListButton.hidden = NO; + self.reverseListSortingButton.hidden = NO; } return count; } @@ -204,6 +209,17 @@ - (void)emptyListAction:(id)sender [self presentViewController:alertController animated:YES completion:nil]; } +- (IBAction)reverseListSortingAction:(id)sender +{ + newestFirst = !newestFirst; + + if (newestFirst) { + self.reverseListSortingButton.transform = CGAffineTransformMakeRotation( M_PI ); + } else { + self.reverseListSortingButton.transform = CGAffineTransformIdentity; + } +} + #pragma mark - editing - (NSIndexPath *)indexPathToDelete diff --git a/Apple-TV/VLCOpenNetworkStreamTVViewController.xib b/Apple-TV/VLCOpenNetworkStreamTVViewController.xib index 32fa966cd1..00d73dac2a 100644 --- a/Apple-TV/VLCOpenNetworkStreamTVViewController.xib +++ b/Apple-TV/VLCOpenNetworkStreamTVViewController.xib @@ -1,22 +1,23 @@ - + - + - + + @@ -83,10 +84,21 @@ + + @@ -94,6 +106,7 @@ + @@ -105,5 +118,6 @@ + diff --git a/Resources/de.lproj/Localizable.strings b/Resources/de.lproj/Localizable.strings index 11691600dc..100e2f6748 100644 --- a/Resources/de.lproj/Localizable.strings +++ b/Resources/de.lproj/Localizable.strings @@ -66,6 +66,7 @@ "BUTTON_CONTINUE" = "Fortsetzen"; "BUTTON_SET" = "Einstellen"; "BUTTON_RESET" = "Zurücksetzen"; +"BUTTON_REVERSE" = "Sortierung umkehren"; "BUTTON_RESCAN" = "Erneut durchsuchen"; "PRIVATE_PLAYBACK_TOGGLE" = "Private Wiedergabe"; "SCAN_SUBTITLE_TOGGLE" = "Untertitelsuche (nur HTTP)"; diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index dce46086f6..eea430dabf 100644 --- a/Resources/en.lproj/Localizable.strings +++ b/Resources/en.lproj/Localizable.strings @@ -66,6 +66,7 @@ "BUTTON_CONTINUE" = "Continue"; "BUTTON_SET" = "Set"; "BUTTON_RESET" = "Reset"; +"BUTTON_REVERSE" = "Reverse sorting order"; "BUTTON_RESCAN" = "Rescan"; "PRIVATE_PLAYBACK_TOGGLE" = "Private Playback"; "SCAN_SUBTITLE_TOGGLE" = "Scan for Subtitles (http-only)";