Commit 13b3fce5 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Add about panel

actual html content still needs to be updated

Note that UIScrollView on tvOS doesn't allow active scrolling by the user, so we need to do it ourselves
parent e8f4f2b0
{
"images" : [
{
"idiom" : "tv",
"filename" : "about-icon.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface VLCAboutViewController : UIViewController
@property (readwrite, weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (readwrite, weak, nonatomic) IBOutlet UILabel *versionLabel;
@property (readwrite, weak, nonatomic) IBOutlet UILabel *basedOnLabel;
@property (readwrite, weak, nonatomic) IBOutlet UITextView *blablaTextView;
@end
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "VLCAboutViewController.h"
@interface VLCAboutViewController ()
{
NSTimer *_scrollTimer;
NSTimeInterval _startInterval;
CGPoint _scrollPoint;
}
@end
@implementation VLCAboutViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSBundle *mainBundle = [NSBundle mainBundle];
self.versionLabel.text = [[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT", nil), [mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]] stringByAppendingFormat:@" (%@)", [mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]];
self.basedOnLabel.text = [[NSString stringWithFormat:NSLocalizedString(@"BASED_ON_FORMAT", nil),[[VLCLibrary sharedLibrary] version]] stringByReplacingOccurrencesOfString:@"<br />" withString:@" "];
self.titleLabel.text = self.title;
self.titleLabel.textColor = [UIColor colorWithWhite:0.5 alpha:1.];
self.blablaTextView.text = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil];
self.blablaTextView.scrollEnabled = YES;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
_scrollPoint = CGPointZero;
if (!_scrollTimer) {
_scrollTimer = [NSTimer scheduledTimerWithTimeInterval: 1/6
target:self
selector:@selector(scrollABit:)
userInfo:nil
repeats:YES];
}
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
if (_scrollTimer) {
[_scrollTimer invalidate];
_scrollTimer = nil;
}
}
- (void)resetScrolling
{
_scrollPoint = CGPointZero;
[self.blablaTextView setContentOffset:_scrollPoint animated:YES];
}
- (void)scrollABit:(NSTimer *)timer
{
CGFloat maxHeight = self.blablaTextView.contentSize.height;
if (!_startInterval) {
_startInterval = [NSDate timeIntervalSinceReferenceDate] + 2.0;
}
if ([NSDate timeIntervalSinceReferenceDate] >= _startInterval) {
if (_scrollPoint.y > maxHeight) {
[self resetScrolling];
return;
}
_scrollPoint.y++;
[self.blablaTextView setContentOffset:_scrollPoint animated:NO];
}
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="9527.1" systemVersion="15B42" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9525.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCAboutViewController">
<connections>
<outlet property="basedOnLabel" destination="Rjh-23-auY" id="pRf-0i-R2Z"/>
<outlet property="blablaTextView" destination="icn-Lc-xfi" id="4eu-Yt-xMA"/>
<outlet property="preferredFocusedView" destination="icn-Lc-xfi" id="KfY-eP-JSn"/>
<outlet property="titleLabel" destination="QoD-of-U1w" id="Me2-Ty-Yfz"/>
<outlet property="versionLabel" destination="rzP-zh-asV" id="nAG-07-cxD"/>
<outlet property="view" destination="iN0-l3-epB" id="Eym-vH-oyN"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" editable="NO" textAlignment="natural" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="icn-Lc-xfi">
<rect key="frame" x="449" y="168" width="1412" height="849"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="about-app-icon" translatesAutoresizingMaskIntoConstraints="NO" id="R08-li-qdl">
<rect key="frame" x="69" y="168" width="372" height="225"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version: %@ (%@)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rzP-zh-asV">
<rect key="frame" x="155" y="414" width="200" height="30"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rjh-23-auY">
<rect key="frame" x="197" y="452" width="116" height="58"/>
<string key="text">Based on:
lollipop 4.4</string>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption2"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QoD-of-U1w">
<rect key="frame" x="890" y="60" width="140" height="69"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle2"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="icn-Lc-xfi" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="168" id="518-q1-Xms"/>
<constraint firstAttribute="bottom" secondItem="icn-Lc-xfi" secondAttribute="bottom" constant="63" id="K65-n5-bFs"/>
<constraint firstAttribute="trailing" secondItem="icn-Lc-xfi" secondAttribute="trailing" constant="59" id="Kt4-h1-11h"/>
<constraint firstItem="R08-li-qdl" firstAttribute="top" secondItem="icn-Lc-xfi" secondAttribute="top" id="LkX-k6-Hcl"/>
<constraint firstItem="icn-Lc-xfi" firstAttribute="leading" secondItem="R08-li-qdl" secondAttribute="trailing" constant="8" id="VJs-eZ-VsC"/>
<constraint firstItem="rzP-zh-asV" firstAttribute="centerX" secondItem="R08-li-qdl" secondAttribute="centerX" id="dEL-qi-8f7"/>
<constraint firstItem="rzP-zh-asV" firstAttribute="top" secondItem="R08-li-qdl" secondAttribute="bottom" constant="21" id="ebQ-O6-Tkt"/>
<constraint firstItem="QoD-of-U1w" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="n53-d0-uXb"/>
<constraint firstItem="QoD-of-U1w" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="60" id="nBv-Lu-mM2"/>
<constraint firstItem="Rjh-23-auY" firstAttribute="top" secondItem="rzP-zh-asV" secondAttribute="bottom" constant="8" id="nNO-KC-G1O"/>
<constraint firstItem="R08-li-qdl" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="69" id="veM-Hm-xSQ"/>
<constraint firstItem="Rjh-23-auY" firstAttribute="centerX" secondItem="rzP-zh-asV" secondAttribute="centerX" id="xDc-V4-ia2"/>
</constraints>
</view>
</objects>
<resources>
<image name="about-app-icon" width="372" height="225"/>
</resources>
</document>
......@@ -12,6 +12,7 @@
#import "VLCSettingsTableViewController.h"
#import "IASKSettingsReader.h"
#import "IASKSpecifier.h"
#import "VLCAboutViewController.h"
#define SettingsReUseIdentifier @"SettingsReUseIdentifier"
#define SettingsHeaderReUseIdentifier @"SettingsHeaderReUseIdentifier"
......@@ -133,6 +134,12 @@
[_userDefaults setBool:![_userDefaults boolForKey:specifierKey] forKey:specifierKey];
[_userDefaults synchronize];
[self.tableView reloadData];
} else {
VLCAboutViewController *targetViewController = [[VLCAboutViewController alloc] initWithNibName:nil bundle:nil];
targetViewController.title = specifier.title;
[self presentViewController:targetViewController
animated:YES
completion:nil];
}
}
......
......@@ -71,7 +71,6 @@
7D1276621AADA0E600F0260C /* VLCMultiSelectionMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1276611AADA0E600F0260C /* VLCMultiSelectionMenuView.m */; };
7D1329411BA1F10100BE647E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1329401BA1F10100BE647E /* main.m */; };
7D1329441BA1F10100BE647E /* AppleTVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1329431BA1F10100BE647E /* AppleTVAppDelegate.m */; };
7D13294F1BA1F10100BE647E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D13294E1BA1F10100BE647E /* Assets.xcassets */; };
7D13347C1BE132EA0012E919 /* VLCLocalNetworkServiceBrowserUPnP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFF231BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserUPnP.m */; };
7D13347F1BE132ED0012E919 /* VLCLocalNetworkServiceUPnP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFF251BDEBCE500B68579 /* VLCLocalNetworkServiceUPnP.m */; };
7D1334801BE132F10012E919 /* VLCNetworkServerBrowserUPnP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFF271BDEBCE500B68579 /* VLCNetworkServerBrowserUPnP.m */; };
......@@ -204,6 +203,9 @@
7DC72D6317B7ED24008A26D0 /* WhiteRaccoon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC72D6217B7ED24008A26D0 /* WhiteRaccoon.m */; };
7DD2A3A9179C04A7003EB537 /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7DD2A3A8179C04A6003EB537 /* OpenSans-Regular.ttf */; };
7DDD0429172D98E5005A7B10 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DDD0428172D98E5005A7B10 /* CFNetwork.framework */; };
7DDE418F1BE9225A0065C53A /* VLCAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DDE418D1BE9225A0065C53A /* VLCAboutViewController.m */; };
7DDE41901BE9225A0065C53A /* VLCAboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7DDE418E1BE9225A0065C53A /* VLCAboutViewController.xib */; };
7DDE41931BE925820065C53A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D13294E1BA1F10100BE647E /* Assets.xcassets */; };
7DDFF4251BDFD23300913BD1 /* VLCCone512x512.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DDFF4241BDFD23300913BD1 /* VLCCone512x512.png */; };
7DE0648D1BE3F36700C706BE /* VLCOneDriveTableViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE0648C1BE3F36700C706BE /* VLCOneDriveTableViewController2.m */; };
7DE56C1A1AD93F9100E8CA00 /* VLCPlaybackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE56C191AD93F9100E8CA00 /* VLCPlaybackController.m */; };
......@@ -826,6 +828,9 @@
7DD2A3A8179C04A6003EB537 /* OpenSans-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OpenSans-Regular.ttf"; sourceTree = "<group>"; };
7DD32D22194F1946002510A9 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
7DDD0428172D98E5005A7B10 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
7DDE418C1BE9225A0065C53A /* VLCAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCAboutViewController.h; sourceTree = "<group>"; };
7DDE418D1BE9225A0065C53A /* VLCAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCAboutViewController.m; sourceTree = "<group>"; };
7DDE418E1BE9225A0065C53A /* VLCAboutViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCAboutViewController.xib; sourceTree = "<group>"; };
7DDFF4241BDFD23300913BD1 /* VLCCone512x512.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = VLCCone512x512.png; path = Resources/VLCCone512x512.png; sourceTree = SOURCE_ROOT; };
7DE0648B1BE3F36700C706BE /* VLCOneDriveTableViewController2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCOneDriveTableViewController2.h; path = SharedSources/Clouds/VLCOneDriveTableViewController2.h; sourceTree = SOURCE_ROOT; };
7DE0648C1BE3F36700C706BE /* VLCOneDriveTableViewController2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCOneDriveTableViewController2.m; path = SharedSources/Clouds/VLCOneDriveTableViewController2.m; sourceTree = SOURCE_ROOT; };
......@@ -1802,6 +1807,7 @@
7DC71D281BC83138001FACAA /* xibs */ = {
isa = PBXGroup;
children = (
7DDE418E1BE9225A0065C53A /* VLCAboutViewController.xib */,
7D6069711BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib */,
DD3EAC121BE26166003668DA /* VLCServerBrowsingTVCell.xib */,
7D3E528A1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib */,
......@@ -1931,6 +1937,8 @@
children = (
7DF90B421BE7A5380059C0E3 /* VLCSettingsTableViewController.h */,
7DF90B431BE7A5380059C0E3 /* VLCSettingsTableViewController.m */,
7DDE418C1BE9225A0065C53A /* VLCAboutViewController.h */,
7DDE418D1BE9225A0065C53A /* VLCAboutViewController.m */,
7DF90B451BE7A8030059C0E3 /* Mini-InAppSettingsKit */,
);
name = "Settings and stuff";
......@@ -2531,14 +2539,15 @@
7D6069721BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib in Resources */,
7DEC8BDF1BD67899006E1093 /* VLCFullscreenMovieTVViewController.xib in Resources */,
7D4CAAFC1BDE548A00A08EF5 /* Localizable.strings in Resources */,
7DDE41931BE925820065C53A /* Assets.xcassets in Resources */,
7DEC8C1E1BD69710006E1093 /* About Contents.html in Resources */,
DDEAECF61BDFEAFA00756C83 /* VLCLocalNetworkServerTVCell.xib in Resources */,
7D13294F1BA1F10100BE647E /* Assets.xcassets in Resources */,
DD8095EC1BE4F04E0065D8E1 /* VLCPlaybackInfoRateTVViewController.xib in Resources */,
7DEC8BE91BD68BC9006E1093 /* Settings.bundle in Resources */,
DD3EAC131BE26166003668DA /* VLCServerBrowsingTVCell.xib in Resources */,
7D3E528C1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib in Resources */,
7D7EF3DB1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.xib in Resources */,
7DDE41901BE9225A0065C53A /* VLCAboutViewController.xib in Resources */,
DD8095F31BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -2736,6 +2745,7 @@
7DF90B441BE7A5380059C0E3 /* VLCSettingsTableViewController.m in Sources */,
DD3EFF561BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserDSM.m in Sources */,
DD3EABF91BE14BD6003668DA /* BasicUPnPDevice+VLC.m in Sources */,
7DDE418F1BE9225A0065C53A /* VLCAboutViewController.m in Sources */,
7D0C34E71BD951080058CD19 /* NSString+SupportedMedia.m in Sources */,
DD8095F61BE624C00065D8E1 /* VLCPlaybackInfoTVAnimators.m in Sources */,
DDEAECBF1BDEBF6700756C83 /* VLCNetworkServerLoginInformation.m in Sources */,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment