Commit 0babd4b4 authored by Felix Paul Kühne's avatar Felix Paul Kühne

rework passcode VC to finally suit iOS 7+ and make sure it actually works on 8 (closes #13166)

parent 5d202762
PAPasscode/Assets/papasscode_marker.png

1.04 KB | W: | H:

PAPasscode/Assets/papasscode_marker.png

3.63 KB | W: | H:

PAPasscode/Assets/papasscode_marker.png
PAPasscode/Assets/papasscode_marker.png
PAPasscode/Assets/papasscode_marker.png
PAPasscode/Assets/papasscode_marker.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -26,16 +26,16 @@
#import <QuartzCore/QuartzCore.h>
#import "PAPasscodeViewController.h"
#define NAVBAR_HEIGHT 44
#define PROMPT_HEIGHT 74
#define DIGIT_SPACING 10
#define DIGIT_WIDTH 61
#define DIGIT_HEIGHT 53
#define NAVBAR_HEIGHT 66
#define PROMPT_HEIGHT 90
#define DIGIT_SPACING 25
#define DIGIT_WIDTH 19
#define DIGIT_HEIGHT 1
#define MARKER_WIDTH 16
#define MARKER_HEIGHT 16
#define MARKER_X 22
#define MARKER_Y 18
#define MESSAGE_HEIGHT 74
#define MARKER_HEIGHT 1
#define MARKER_X 1.5
#define MARKER_Y -18
#define MESSAGE_HEIGHT 90
#define FAILED_LCAP 19
#define FAILED_RCAP 19
#define FAILED_HEIGHT 26
......@@ -88,9 +88,20 @@
UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.navigationController.navigationBarHidden = YES;
UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, view.bounds.size.width, NAVBAR_HEIGHT)];
navigationBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
navigationBar.items = @[self.navigationItem];
if (SYSTEM_RUNS_IOS7_OR_LATER) {
navigationBar.barTintColor = [UIColor VLCOrangeTintColor];
navigationBar.tintColor = [UIColor whiteColor];
navigationBar.titleTextAttributes = @{ UITextAttributeTextColor : [UIColor whiteColor] };
} else {
[navigationBar setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault];
navigationBar.translucent = NO;
navigationBar.opaque = YES;
}
[view addSubview:navigationBar];
contentView = [[UIView alloc] initWithFrame:CGRectMake(0, NAVBAR_HEIGHT, view.bounds.size.width, view.bounds.size.height-NAVBAR_HEIGHT)];
......@@ -98,18 +109,20 @@
if (_backgroundView) {
[contentView addSubview:_backgroundView];
}
contentView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
contentView.backgroundColor = [UIColor VLCDarkBackgroundColor];
[view addSubview:contentView];
CGFloat panelWidth = DIGIT_WIDTH*4+DIGIT_SPACING*3;
if (_simple) {
UIView *digitPanel = [[UIView alloc] initWithFrame:CGRectMake(0, 0, panelWidth, DIGIT_HEIGHT)];
digitPanel.frame = CGRectOffset(digitPanel.frame, (contentView.bounds.size.width-digitPanel.bounds.size.width)/2, PROMPT_HEIGHT);
NSLog(@"cw width %f, panel width %f",contentView.bounds.size.width, panelWidth);
digitPanel.frame = CGRectOffset(digitPanel.frame, (contentView.bounds.size.width - panelWidth) / 2., PROMPT_HEIGHT);
digitPanel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
[contentView addSubview:digitPanel];
UIImage *backgroundImage = [UIImage imageNamed:@"papasscode_background"];
UIImage *markerImage = [UIImage imageNamed:@"papasscode_marker"];
CGFloat xLeft = 0;
for (int i=0;i<4;i++) {
UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage];
......@@ -118,6 +131,7 @@
digitImageViews[i] = [[UIImageView alloc] initWithImage:markerImage];
digitImageViews[i].autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
digitImageViews[i].frame = CGRectOffset(digitImageViews[i].frame, backgroundImageView.frame.origin.x+MARKER_X, MARKER_Y);
[digitPanel addSubview:digitImageViews[i]];
xLeft += DIGIT_SPACING + backgroundImage.size.width;
}
......@@ -150,9 +164,9 @@
promptLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, contentView.bounds.size.width, PROMPT_HEIGHT)];
promptLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
promptLabel.backgroundColor = [UIColor clearColor];
promptLabel.textColor = [UIColor colorWithRed:0.30 green:0.34 blue:0.42 alpha:1.0];
promptLabel.textColor = [UIColor VLCLightTextColor];
promptLabel.font = [UIFont boldSystemFontOfSize:17];
promptLabel.shadowColor = [UIColor whiteColor];
promptLabel.shadowColor = [UIColor VLCDarkTextShadowColor];
promptLabel.shadowOffset = CGSizeMake(0, 1);
promptLabel.textAlignment = NSTextAlignmentCenter;
promptLabel.numberOfLines = 0;
......
......@@ -318,6 +318,12 @@
7D9870581A3DEE68009CF27D /* Drive@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870571A3DEE68009CF27D /* Drive@3x.png */; };
7D98705A1A3DEE88009CF27D /* TVBroadcastIcon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870591A3DEE88009CF27D /* TVBroadcastIcon@3x.png */; };
7D98705C1A3DEEF6009CF27D /* vlc-xmas@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D98705B1A3DEEF6009CF27D /* vlc-xmas@3x.png */; };
7D9870641A3E03D5009CF27D /* papasscode_background.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D98705E1A3E03D5009CF27D /* papasscode_background.png */; };
7D9870651A3E03D5009CF27D /* papasscode_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D98705F1A3E03D5009CF27D /* papasscode_background@2x.png */; };
7D9870661A3E03D5009CF27D /* papasscode_failed_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870601A3E03D5009CF27D /* papasscode_failed_bg.png */; };
7D9870671A3E03D5009CF27D /* papasscode_failed_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870611A3E03D5009CF27D /* papasscode_failed_bg@2x.png */; };
7D9870681A3E03D5009CF27D /* papasscode_marker.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870621A3E03D5009CF27D /* papasscode_marker.png */; };
7D9870691A3E03D5009CF27D /* papasscode_marker@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D9870631A3E03D5009CF27D /* papasscode_marker@2x.png */; };
7DA7C905186324FA00B56120 /* serverIcon@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DA7C902186324FA00B56120 /* serverIcon@1x.png */; };
7DA7C906186324FA00B56120 /* serverIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DA7C903186324FA00B56120 /* serverIcon@2x.png */; };
7DA7C907186324FA00B56120 /* serverIcon@4x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DA7C904186324FA00B56120 /* serverIcon@4x.png */; };
......@@ -1009,6 +1015,12 @@
7D9870571A3DEE68009CF27D /* Drive@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Drive@3x.png"; sourceTree = "<group>"; };
7D9870591A3DEE88009CF27D /* TVBroadcastIcon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TVBroadcastIcon@3x.png"; sourceTree = "<group>"; };
7D98705B1A3DEEF6009CF27D /* vlc-xmas@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vlc-xmas@3x.png"; sourceTree = "<group>"; };
7D98705E1A3E03D5009CF27D /* papasscode_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = papasscode_background.png; sourceTree = "<group>"; };
7D98705F1A3E03D5009CF27D /* papasscode_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "papasscode_background@2x.png"; sourceTree = "<group>"; };
7D9870601A3E03D5009CF27D /* papasscode_failed_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = papasscode_failed_bg.png; sourceTree = "<group>"; };
7D9870611A3E03D5009CF27D /* papasscode_failed_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "papasscode_failed_bg@2x.png"; sourceTree = "<group>"; };
7D9870621A3E03D5009CF27D /* papasscode_marker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = papasscode_marker.png; sourceTree = "<group>"; };
7D9870631A3E03D5009CF27D /* papasscode_marker@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "papasscode_marker@2x.png"; sourceTree = "<group>"; };
7D9B6B0817C9625F00F9425D /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Localizable.strings; sourceTree = "<group>"; };
7D9B6B0917C9625F00F9425D /* sl */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = sl; path = "sl.lproj/badgeUnread@2x~ipad.png"; sourceTree = "<group>"; };
7D9B6B0A17C9626000F9425D /* sl */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = sl; path = "sl.lproj/badgeUnread@2x~iphone.png"; sourceTree = "<group>"; };
......@@ -2051,6 +2063,20 @@
path = AspenProject;
sourceTree = "<group>";
};
7D98705D1A3E03D5009CF27D /* PAPasscode */ = {
isa = PBXGroup;
children = (
7D98705E1A3E03D5009CF27D /* papasscode_background.png */,
7D98705F1A3E03D5009CF27D /* papasscode_background@2x.png */,
7D9870601A3E03D5009CF27D /* papasscode_failed_bg.png */,
7D9870611A3E03D5009CF27D /* papasscode_failed_bg@2x.png */,
7D9870621A3E03D5009CF27D /* papasscode_marker.png */,
7D9870631A3E03D5009CF27D /* papasscode_marker@2x.png */,
);
name = PAPasscode;
path = PAPasscode/Assets;
sourceTree = SOURCE_ROOT;
};
7DADC55C1704FAA8001DAC63 /* XIBs */ = {
isa = PBXGroup;
children = (
......@@ -2306,6 +2332,7 @@
A7924697170F0ED20036AAF2 /* Resources */ = {
isa = PBXGroup;
children = (
7D98705D1A3E03D5009CF27D /* PAPasscode */,
7DC19AEC1868CC0000810BF7 /* First steps */,
7D47D6C81760CD2700E86BAD /* Movie VIew */,
7D6B08FB174D773C00A05173 /* Settings.bundle */,
......@@ -2633,6 +2660,7 @@
7D588D64187DD9B700469FCF /* modernSliderKnob@2x.png in Resources */,
7D278D6F18E9D6750063E109 /* tvShow@2x~ipad.png in Resources */,
7DBBF1A7183AB4300009A339 /* VLCNetworkLoginViewController.xib in Resources */,
7D9870661A3E03D5009CF27D /* papasscode_failed_bg.png in Resources */,
7D27EC0C19DF30CB00EF0370 /* connector-cable@2x.png in Resources */,
7D07F726175688D300CDE21C /* doneButton.png in Resources */,
7D588D65187DD9B700469FCF /* modernSliderKnob.png in Resources */,
......@@ -2643,6 +2671,7 @@
7D07F729175688D300CDE21C /* doneButtonHighlight@2x.png in Resources */,
7D07F72E175691CC00CDE21C /* backButton.png in Resources */,
7D27EC3219DF314F00EF0370 /* wifi@3x.png in Resources */,
7D9870681A3E03D5009CF27D /* papasscode_marker.png in Resources */,
7D98703C1A3DEDB2009CF27D /* serverIcon@3x.png in Resources */,
9BF07090185122AA009B23DD /* audio@2x~ipad.png in Resources */,
7D07F72F175691CC00CDE21C /* backButton@2x.png in Resources */,
......@@ -2653,6 +2682,7 @@
49CC60B6195F4F3F00ACB586 /* TVBroadcastIcon~ipad.png in Resources */,
7D07F730175691CC00CDE21C /* backButtonHighlight.png in Resources */,
9BD3F368185DEC0A00569ADC /* arrows@2x.png in Resources */,
7D9870691A3E03D5009CF27D /* papasscode_marker@2x.png in Resources */,
9BF0708E185122AA009B23DD /* audio.png in Resources */,
7D07F731175691CC00CDE21C /* backButtonHighlight@2x.png in Resources */,
7D27EC3019DF314F00EF0370 /* wifi.png in Resources */,
......@@ -2749,6 +2779,7 @@
7DBBF19E183AB4300009A339 /* VLCEmptyLibraryView~ipad.xib in Resources */,
7D63C19518774E0100BD5256 /* VLCFirstStepsThirdPageViewController~ipad.xib in Resources */,
7D6BD1861762026700AD311A /* thumbOverlayPhone.png in Resources */,
7D9870651A3E03D5009CF27D /* papasscode_background@2x.png in Resources */,
7D6BD1871762026700AD311A /* thumbOverlay.png in Resources */,
7D1AC3041762996100BD2EB5 /* resetIcon.png in Resources */,
7D1AC3051762996100BD2EB5 /* resetIcon@2x.png in Resources */,
......@@ -2839,6 +2870,7 @@
7D9870541A3DEE43009CF27D /* Downloads@3x.png in Resources */,
7D0699D917CB1FAE00713BEB /* WifiUp.png in Resources */,
41F475D51899A438001B919F /* folderIcon~ipad.png in Resources */,
7D9870671A3E03D5009CF27D /* papasscode_failed_bg@2x.png in Resources */,
7D897875185DEF79009BAB5D /* repeat@2x.png in Resources */,
7DF3B78919DF01550041A02E /* fsarrow-time@2x.png in Resources */,
7D0699DA17CB1FAE00713BEB /* WifiUp@2x.png in Resources */,
......@@ -2869,6 +2901,7 @@
7D0699E517CB1FAE00713BEB /* About.png in Resources */,
7D0699E617CB1FAE00713BEB /* About@2x.png in Resources */,
7D0699E717CB1FAE00713BEB /* AllFiles.png in Resources */,
7D9870641A3E03D5009CF27D /* papasscode_background.png in Resources */,
7DF3B78A19DF01550041A02E /* fsarrow-time@3x.png in Resources */,
7D27EC2819DF30EA00EF0370 /* vlcsnap@3x.png in Resources */,
7D0699E817CB1FAE00713BEB /* AllFiles@2x.png in Resources */,
......
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