Skip to content

Commit cb358bf

Browse files
author
embeddedc
committed
Add sorting button
1 parent 5d3a48c commit cb358bf

File tree

8 files changed

+55
-3
lines changed

8 files changed

+55
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "[email protected]",
5+
"idiom" : "tv",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "[email protected]",
10+
"idiom" : "tv",
11+
"scale" : "2x"
12+
}
13+
],
14+
"info" : {
15+
"author" : "xcode",
16+
"version" : 1
17+
}
18+
}
2.25 KB
Loading
2.59 KB
Loading

Apple-TV/VLCOpenNetworkStreamTVViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
@property (readwrite, nonatomic, weak) IBOutlet UIImageView *nothingFoundConeImageView;
2323

2424
@property (readwrite, nonatomic, weak) IBOutlet UIButton *emptyListButton;
25+
@property (readwrite, nonatomic, weak) IBOutlet UIButton *reverseListSortingButton;
2526

2627
- (IBAction)URLEnteredInField:(id)sender;
2728
- (IBAction)emptyListAction:(id)sender;
29+
- (IBAction)reverseListSortingAction:(id)sender;
2830

2931
@end

Apple-TV/VLCOpenNetworkStreamTVViewController.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ @interface VLCOpenNetworkStreamTVViewController ()
1919
{
2020
NSMutableArray *_recentURLs;
2121
NSMutableDictionary *_recentURLTitles;
22+
BOOL newestFirst;
2223
}
2324
@property (nonatomic) NSIndexPath *currentlyFocusedIndexPath;
2425
@end
@@ -50,6 +51,9 @@ - (void)viewDidLoad {
5051
self.playURLField.textContentType = UITextContentTypeURL;
5152
}
5253
self.emptyListButton.accessibilityLabel = NSLocalizedString(@"BUTTON_RESET", nil);
54+
self.reverseListSortingButton.accessibilityLabel = NSLocalizedString(@"BUTTON_REVERSE", nil);
55+
56+
newestFirst = false;
5357

5458
self.previouslyPlayedStreamsTableView.backgroundColor = [UIColor clearColor];
5559
self.previouslyPlayedStreamsTableView.rowHeight = UITableViewAutomaticDimension;
@@ -129,6 +133,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
129133
if (count > 0) {
130134
self.nothingFoundView.hidden = YES;
131135
self.emptyListButton.hidden = NO;
136+
self.reverseListSortingButton.hidden = NO;
132137
}
133138
return count;
134139
}
@@ -204,6 +209,17 @@ - (void)emptyListAction:(id)sender
204209
[self presentViewController:alertController animated:YES completion:nil];
205210
}
206211

212+
- (IBAction)reverseListSortingAction:(id)sender
213+
{
214+
newestFirst = !newestFirst;
215+
216+
if (newestFirst) {
217+
self.reverseListSortingButton.transform = CGAffineTransformMakeRotation( M_PI );
218+
} else {
219+
self.reverseListSortingButton.transform = CGAffineTransformIdentity;
220+
}
221+
}
222+
207223
#pragma mark - editing
208224

209225
- (NSIndexPath *)indexPathToDelete

Apple-TV/VLCOpenNetworkStreamTVViewController.xib

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="20037" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="19529" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
33
<device id="appleTV" appearance="light"/>
44
<dependencies>
55
<deployment identifier="tvOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<objects>
1010
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCOpenNetworkStreamTVViewController">
1111
<connections>
1212
<outlet property="deleteHintView" destination="Wa3-IS-ztU" id="ipW-Hx-fMJ"/>
13-
<outlet property="emptyListButton" destination="OXZ-Zx-045" id="kJS-RB-MGp"/>
13+
<outlet property="emptyListButton" destination="OXZ-Zx-045" id="amt-Xy-VhT"/>
1414
<outlet property="nothingFoundConeImageView" destination="aAb-aY-bkT" id="Abp-Yt-oQb"/>
1515
<outlet property="nothingFoundLabel" destination="sdc-e1-PSc" id="dvi-jc-vaR"/>
1616
<outlet property="nothingFoundView" destination="dvt-CP-ALF" id="lg3-aJ-oHg"/>
1717
<outlet property="playURLField" destination="dWa-3n-YCa" id="Eoe-vT-AuM"/>
1818
<outlet property="preferredFocusedView" destination="dWa-3n-YCa" id="0Ez-4Z-KFF"/>
1919
<outlet property="previouslyPlayedStreamsTableView" destination="v0o-s0-Xaz" id="I1r-ie-lFf"/>
20+
<outlet property="reverseListSortingButton" destination="S9C-So-1TT" id="Wys-kF-xwY"/>
2021
<outlet property="view" destination="iN0-l3-epB" id="Eym-vH-oyN"/>
2122
</connections>
2223
</placeholder>
@@ -83,17 +84,29 @@
8384
<action selector="emptyListAction:" destination="-1" eventType="primaryActionTriggered" id="Pp6-st-y2N"/>
8485
</connections>
8586
</button>
87+
<button hidden="YES" opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S9C-So-1TT">
88+
<rect key="frame" x="1439" y="190" width="128" height="88"/>
89+
<inset key="contentEdgeInsets" minX="40" minY="20" maxX="40" maxY="20"/>
90+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
91+
<state key="normal" image="delete"/>
92+
<buttonConfiguration key="configuration" style="gray" image="sortingImage"/>
93+
<connections>
94+
<action selector="reverseListSortingAction:" destination="-1" eventType="primaryActionTriggered" id="pFj-w5-Hp2"/>
95+
</connections>
96+
</button>
8697
</subviews>
8798
<constraints>
8899
<constraint firstItem="Wa3-IS-ztU" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="0ms-Lt-g1Q"/>
89100
<constraint firstItem="dWa-3n-YCa" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="193" id="6FP-0U-Znd"/>
101+
<constraint firstItem="S9C-So-1TT" firstAttribute="centerY" secondItem="dWa-3n-YCa" secondAttribute="centerY" id="D1b-zy-Rwv"/>
90102
<constraint firstItem="dvt-CP-ALF" firstAttribute="centerY" secondItem="v0o-s0-Xaz" secondAttribute="centerY" id="GIx-LR-UOF"/>
91103
<constraint firstItem="dvt-CP-ALF" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="961" id="GfH-Fp-I0L"/>
92104
<constraint firstItem="OXZ-Zx-045" firstAttribute="trailing" secondItem="v0o-s0-Xaz" secondAttribute="trailing" id="HGJ-W8-lfl"/>
93105
<constraint firstItem="OXZ-Zx-045" firstAttribute="centerY" secondItem="dWa-3n-YCa" secondAttribute="centerY" id="O9J-Zz-Pur"/>
94106
<constraint firstAttribute="bottom" secondItem="Wa3-IS-ztU" secondAttribute="bottom" constant="50" id="ZDa-1f-46j"/>
95107
<constraint firstItem="v0o-s0-Xaz" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="elq-bO-Tb3"/>
96108
<constraint firstItem="v0o-s0-Xaz" firstAttribute="top" secondItem="dWa-3n-YCa" secondAttribute="bottom" constant="70" id="jCe-Gz-82c"/>
109+
<constraint firstItem="OXZ-Zx-045" firstAttribute="leading" secondItem="S9C-So-1TT" secondAttribute="trailing" constant="42.5" id="jlD-FU-9bO"/>
97110
<constraint firstItem="dWa-3n-YCa" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="oFS-xp-QJo"/>
98111
<constraint firstItem="dvt-CP-ALF" firstAttribute="centerX" secondItem="v0o-s0-Xaz" secondAttribute="centerX" id="uSF-XP-xr0"/>
99112
<constraint firstAttribute="bottom" secondItem="v0o-s0-Xaz" secondAttribute="bottom" constant="70" id="ydf-eT-5UK"/>
@@ -105,5 +118,6 @@
105118
<image name="cone" width="143" height="158"/>
106119
<image name="delete" width="24" height="24"/>
107120
<image name="deleteImage" width="48" height="48"/>
121+
<image name="sortingImage" width="48" height="48"/>
108122
</resources>
109123
</document>

Resources/de.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"BUTTON_CONTINUE" = "Fortsetzen";
6767
"BUTTON_SET" = "Einstellen";
6868
"BUTTON_RESET" = "Zurücksetzen";
69+
"BUTTON_REVERSE" = "Sortierung ändern";
6970
"BUTTON_RESCAN" = "Erneut durchsuchen";
7071
"PRIVATE_PLAYBACK_TOGGLE" = "Private Wiedergabe";
7172
"SCAN_SUBTITLE_TOGGLE" = "Untertitelsuche (nur HTTP)";

Resources/en.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"BUTTON_CONTINUE" = "Continue";
6767
"BUTTON_SET" = "Set";
6868
"BUTTON_RESET" = "Reset";
69+
"BUTTON_REVERSE" = "Reverse sorting order";
6970
"BUTTON_RESCAN" = "Rescan";
7071
"PRIVATE_PLAYBACK_TOGGLE" = "Private Playback";
7172
"SCAN_SUBTITLE_TOGGLE" = "Scan for Subtitles (http-only)";

0 commit comments

Comments
 (0)