Skip to content
Snippets Groups Projects
Commit eb956208 authored by jakobsbode's avatar jakobsbode
Browse files

update on boarding

parent 8eacde64
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,11 @@ typedef void (^action_callback)(OnboardingViewController *onboardController); ...@@ -38,6 +38,11 @@ typedef void (^action_callback)(OnboardingViewController *onboardController);
*/ */
@property (nonatomic) BOOL movesToNextViewController; @property (nonatomic) BOOL movesToNextViewController;
/**
* @brief Determines if only the inpuview will be shown.
*/
@property (nonatomic) BOOL onlyInputView;
/** /**
* @brief The image view used to show the top icon. * @brief The image view used to show the top icon.
......
...@@ -104,6 +104,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -104,6 +104,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
return nil; return nil;
} }
self.onlyInputView = false;
// Icon image view // Icon image view
self.iconImageView = [[UIImageView alloc] initWithImage:image]; self.iconImageView = [[UIImageView alloc] initWithImage:image];
self.iconWidth = image ? image.size.width : kDefaultImageViewSize; self.iconWidth = image ? image.size.width : kDefaultImageViewSize;
...@@ -168,6 +170,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -168,6 +170,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
return nil; return nil;
} }
self.onlyInputView = false;
// Icon image view // Icon image view
self.iconImageView = [[UIImageView alloc] initWithImage:image]; self.iconImageView = [[UIImageView alloc] initWithImage:image];
self.iconWidth = image ? image.size.width : kDefaultImageViewSize; self.iconWidth = image ? image.size.width : kDefaultImageViewSize;
...@@ -236,6 +240,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -236,6 +240,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
return nil; return nil;
} }
self.onlyInputView = false;
// Icon image view // Icon image view
self.iconImageView = [[UIImageView alloc] initWithImage:image]; self.iconImageView = [[UIImageView alloc] initWithImage:image];
self.iconWidth = image ? image.size.width : kDefaultImageViewSize; self.iconWidth = image ? image.size.width : kDefaultImageViewSize;
...@@ -414,6 +420,7 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -414,6 +420,7 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
- (void)viewWillLayoutSubviews { - (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews]; [super viewWillLayoutSubviews];
if (!self.onlyInputView) {
if (self.videoURL) { if (self.videoURL) {
self.moviePlayerController.view.frame = self.view.frame; self.moviePlayerController.view.frame = self.view.frame;
} }
...@@ -451,6 +458,19 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -451,6 +458,19 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
} }
} }
} }
else {
CGFloat viewWidth = CGRectGetWidth(self.view.frame);
CGFloat contentWidth = viewWidth * kContentWidthMultiplier;
CGFloat xPadding = (viewWidth - contentWidth) / 2.0;
if (self.inputView) {
self.inputView.frame = CGRectMake(xPadding, self.topPadding, contentWidth, CGRectGetHeight(self.inputView.frame));
for (UIView *view in self.inputView.subviews){
view.frame = CGRectMake(CGRectGetMinX(view.frame), CGRectGetMinY(view.frame), contentWidth, CGRectGetHeight(view.frame));
}
}
}
}
#pragma mark - Transition alpha #pragma mark - Transition alpha
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment