Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Source/JTSImageViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ extern CGFloat const JTSImageViewController_DefaultBackgroundBlurRadius;
Defaults to `JTSImageViewController_DefaultAlphaForBackgroundDimmingOverlay`.
*/
- (CGFloat)alphaForBackgroundDimmingOverlayInImageViewer:(JTSImageViewController *)imageViewer;
/**
The default color is `[UIColor blackColor]`.
*/
- (UIColor *)colorForBackgroundDimmingOverlayInImageViewer:(JTSImageViewController *)imageViewer;

/**
Used with a JTSImageViewControllerBackgroundStyle_ScaledDimmedBlurred background style.
Expand Down
17 changes: 15 additions & 2 deletions Source/JTSImageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ - (void)viewDidLoadForImageMode {
self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

self.blackBackdrop = [[UIView alloc] initWithFrame:CGRectInset(self.view.bounds, -512, -512)];
self.blackBackdrop.backgroundColor = [UIColor blackColor];
self.blackBackdrop.backgroundColor = self.colorForBackgroundDimmingOverlay;
self.blackBackdrop.alpha = 0;
[self.view addSubview:self.blackBackdrop];

Expand Down Expand Up @@ -496,7 +496,7 @@ - (void)viewDidLoadForAltTextMode {
self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

self.blackBackdrop = [[UIView alloc] initWithFrame:CGRectInset(self.view.bounds, -512, -512)];
self.blackBackdrop.backgroundColor = [UIColor blackColor];
self.blackBackdrop.backgroundColor = self.colorForBackgroundDimmingOverlay;
self.blackBackdrop.alpha = 0;
[self.view addSubview:self.blackBackdrop];

Expand Down Expand Up @@ -996,6 +996,19 @@ - (UIColor *)backgroundColorForImageView {
return backgroundColor;
}

- (UIColor *)colorForBackgroundDimmingOverlay {

UIColor *color;

if ([self.optionsDelegate respondsToSelector:@selector(colorForBackgroundDimmingOverlayInImageViewer:)]) {
color = [self.optionsDelegate colorForBackgroundDimmingOverlayInImageViewer:self];
} else {
color = [UIColor blackColor];
}

return color;
}

#pragma mark - Dismissal

- (void)dismissByCollapsingImageBackToOriginalPosition {
Expand Down