Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "CareEvolution/MarkdownAttributedString" "1.0.4"
github "CareEvolution/MarkdownAttributedString" "1.0.5"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 3 additions & 1 deletion ORK1Kit/ORK1Kit/Common/CEVRK1NavigationBarProgressView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

@interface CEVRK1NavigationBarProgressView : UIView

- (void)setProgress:(float)progress withTheme:(nullable CEVRK1Theme *)theme;
@property (nonatomic, readonly) float progress;

- (void)setProgress:(float)progress withTheme:(nullable CEVRK1Theme *)theme animated:(BOOL)animated;

@end
34 changes: 23 additions & 11 deletions ORK1Kit/ORK1Kit/Common/CEVRK1NavigationBarProgressView.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,31 @@ - (void)createConstraints {
[self addSubview:_progressView];
_progressView.translatesAutoresizingMaskIntoConstraints = NO;

// This forces the bar to stretch so the ORK1ProgressView will attempt to take up the entire available width
NSLayoutConstraint *widthConstraint = [self.widthAnchor constraintEqualToConstant:200];
widthConstraint.priority = UILayoutPriorityDefaultHigh;
[NSLayoutConstraint activateConstraints:@[
[_progressView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10],
[_progressView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-30],
[_progressView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
widthConstraint
]];
if (@available(iOS 26.0, *)) {
_progressView.backgroundColor = [UIColor whiteColor];
[NSLayoutConstraint activateConstraints:@[

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there are no vertical constraints on the progressView here leaving placement ambiguous. I think this could present problems. Here are a few edge cases I saw in the CEVRKUITestVehicle. One option is we could give the container a real constant height first, then pin the progress bar to the bottom. I'm not opposed to the current solution, just considering it may pose aesthetic problems in existing surveys without much spacing to top.

Image|Image

[_progressView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:0], //10],
Comment thread
mmertsock marked this conversation as resolved.
Outdated
[_progressView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:0], //-30],
]];
} else {
// This forces the bar to stretch so the ORK1ProgressView will attempt to take up the entire available width
NSLayoutConstraint *widthConstraint = [self.widthAnchor constraintEqualToConstant:200];
widthConstraint.priority = UILayoutPriorityDefaultHigh;
[NSLayoutConstraint activateConstraints:@[
[_progressView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10],
[_progressView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-30],
[_progressView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
widthConstraint
]];
}
}

- (float)progress {
return _progressView.progress;
}

- (void)setProgress:(float)progress withTheme:(nullable CEVRK1Theme *)theme {
_progressView.progress = progress;
- (void)setProgress:(float)progress withTheme:(nullable CEVRK1Theme *)theme animated:(BOOL)animated {
[_progressView setProgress:progress animated:animated];
Comment thread
mmertsock marked this conversation as resolved.
if (theme.progressBarColor) {
_progressView.tintColor = theme.progressBarColor;
}
Expand Down
47 changes: 39 additions & 8 deletions ORK1Kit/ORK1Kit/Common/ORK1TaskViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,15 @@ - (instancetype)commonInitWithTask:(id<ORK1Task>)task taskRunUUID:(NSUUID *)task

self.taskRunUUID = taskRunUUID;

[self.childNavigationController.navigationBar setShadowImage:[UIImage new]];
self.hairline = [self findHairlineViewUnder:self.childNavigationController.navigationBar];
self.hairline.alpha = 0.0f;
self.childNavigationController.toolbar.clipsToBounds = YES;

if (@available(iOS 26.0, *)) {
// ResearchKit views render poorly with translucent navigation bars on iOS 26
self.childNavigationController.navigationBar.backgroundColor = [UIColor whiteColor];
}

// Ensure taskRunUUID has non-nil valuetaskRunUUID
(void)[self taskRunUUID];
self.restorationClass = [ORK1TaskViewController class];
Expand Down Expand Up @@ -1027,6 +1031,7 @@ - (void)showViewController:(ORK1StepViewController *)viewController goForward:(B
// remove any progress
strongSelf.pageViewController.navigationItem.titleView = nil;
strongSelf.pageViewController.navigationItem.title = nil;
strongSelf.progressView.hidden = YES;
} else {
ORK1OrderedTask *orderedTask = (ORK1OrderedTask *)strongSelf.task;
if (orderedTask.progressIndicatorStyle == CEVRK1TaskProgressIndicatorStyleBar) {
Expand All @@ -1037,16 +1042,13 @@ - (void)showViewController:(ORK1StepViewController *)viewController goForward:(B
} else { // Linear
calculatedProgress = (float)taskProgress.current / (float)taskProgress.total;
}
[strongSelf.progressView setProgress:calculatedProgress withTheme:[CEVRK1Theme themeForElement:strongSelf.currentStepViewController]];
strongSelf.pageViewController.navigationItem.titleView = strongSelf.progressView;

// for UITesting, we will add a title that will not display, but should appear via accessibility
NSUInteger progressPercent = (NSUInteger)(calculatedProgress * 100);
strongSelf.pageViewController.navigationItem.title = [NSString stringWithFormat:@"ProgressBar:%@", @(progressPercent)];

[strongSelf.progressView setProgress:calculatedProgress withTheme:[CEVRK1Theme themeForElement:strongSelf.currentStepViewController] animated:animated];
[strongSelf configureProgressView];
strongSelf.progressView.hidden = NO;
} else {
strongSelf.pageViewController.navigationItem.titleView = nil;
strongSelf.pageViewController.navigationItem.title = [NSString localizedStringWithFormat:ORK1LocalizedString(@"STEP_PROGRESS_FORMAT", nil) ,ORK1LocalizedStringFromNumber(@(taskProgress.current)), ORK1LocalizedStringFromNumber(@(taskProgress.total))];
strongSelf.progressView.hidden = YES;
}
}
}
Expand All @@ -1058,6 +1060,35 @@ - (void)showViewController:(ORK1StepViewController *)viewController goForward:(B
}];
}

- (void)configureProgressView {
if (@available(iOS 26.0, *)) {
self.pageViewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
self.pageViewController.navigationItem.title = nil;

CEVRK1NavigationBarProgressView *progressView = self.progressView;
if (!progressView.superview) {
NSLog(@"configure progress");
Comment thread
mmertsock marked this conversation as resolved.
Outdated
UINavigationBar *navigationBar = self.childNavigationController.navigationBar;
navigationBar.opaque = YES;
navigationBar.translucent = NO;

progressView.translatesAutoresizingMaskIntoConstraints = NO;
[navigationBar addSubview:progressView];
[NSLayoutConstraint activateConstraints:@[
[NSLayoutConstraint constraintWithItem:progressView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:navigationBar attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0],
[NSLayoutConstraint constraintWithItem:progressView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:navigationBar.safeAreaLayoutGuide attribute:NSLayoutAttributeLeftMargin multiplier:1.0 constant:10],
[NSLayoutConstraint constraintWithItem:progressView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:navigationBar.safeAreaLayoutGuide attribute:NSLayoutAttributeRightMargin multiplier:1.0 constant:-10]
]];
}
} else {
self.pageViewController.navigationItem.titleView = self.progressView;

// for UITesting, we will add a title that will not display, but should appear via accessibility
NSUInteger progressPercent = (NSUInteger)(self.progressView.progress * 100);
self.pageViewController.navigationItem.title = [NSString stringWithFormat:@"ProgressBar:%@", @(progressPercent)];
}
}

- (BOOL)shouldPresentStep:(ORK1Step *)step {
BOOL shouldPresent = (step != nil);

Expand Down
14 changes: 2 additions & 12 deletions ORK1Kit/ORK1Kit/Common/UIBarButtonItem+ORK1BarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@implementation UIBarButtonItem (ORK1BarButtonItem)

+ (UIBarButtonItem *)ork_backBarButtonItemWithTarget:(id)target action:(SEL)selector {
NSString *regularImageName = @"arrowLeft";
NSString *landscapeImageName = @"arrowLeftLandscape";

if ([UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft ) {
regularImageName = @"arrowRight";
landscapeImageName = @"arrowRightLandscape";
}

UIImage *image = [UIImage imageNamed:regularImageName inBundle:ORK1Bundle() compatibleWithTraitCollection:nil];
UIImage *landscapeImage = [UIImage imageNamed:landscapeImageName inBundle:ORK1Bundle() compatibleWithTraitCollection:nil];
UIImage *image = [UIImage systemImageNamed:@"chevron.backward"];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:image
landscapeImagePhone:landscapeImage
style:UIBarButtonItemStyleDone
style:UIBarButtonItemStylePlain
target:target
action:selector];
item.accessibilityLabel = ORK1LocalizedString(@"AX_BUTTON_BACK", nil);
Expand Down
2 changes: 1 addition & 1 deletion ORK1Kit/ORK1Kit/Consent/ORK1ConsentReviewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ - (instancetype)initWithHTML:(NSString *)html delegate:(id<ORK1ConsentReviewCont
_delegate = delegate;
_webViewFinishedLoading = NO;

_agreeButton = [[UIBarButtonItem alloc] initWithTitle:ORK1LocalizedString(@"BUTTON_AGREE", nil) style:UIBarButtonItemStylePlain target:self action:@selector(ack)];
_agreeButton = [[UIBarButtonItem alloc] initWithTitle:ORK1LocalizedString(@"BUTTON_AGREE", nil) style:UIBarButtonItemStyleDone target:self action:@selector(ack)];
if (requiresScrollToBottom) {
_agreeButton.enabled = NO;
_agreeButton.accessibilityHint = @"must scroll to the bottom to enable this button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion ResearchKit.xcodeproj/xcshareddata/xcschemes/docs.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
16 changes: 11 additions & 5 deletions ResearchKit/Common/ORKAnswerTextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,17 @@ - (void)addAccessoryViewWithDoneButton {
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:nil];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self action:@selector(keyboardAccessoryViewDoneButtonPressed)];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:ORKLocalizedString(@"BUTTON_DONE", nil) style:UIBarButtonItemStylePlain target:self action:@selector(keyboardAccessoryViewDoneButtonPressed)];

if (@available(iOS 26.0, *)) {
doneButton.hidesSharedBackground = YES;
accessoryViewWithDoneButton.backgroundColor = ORKColor(ORKToolBarTintColorKey);
doneButton.tintColor = ORKViewTintColor(self);
} else {
[accessoryViewWithDoneButton setBarTintColor:ORKColor(ORKBackgroundColorKey)];
}

accessoryViewWithDoneButton.items = @[flexibleSpace, doneButton];
[accessoryViewWithDoneButton setBarTintColor:ORKColor(ORKBackgroundColorKey)];
self.inputAccessoryView = accessoryViewWithDoneButton;
}

Expand Down Expand Up @@ -104,4 +110,4 @@ - (CGRect)accessibilityFrame {
return [super accessibilityFrame];
}

@end
@end
14 changes: 10 additions & 4 deletions ResearchKit/Common/ORKAnswerTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ - (void)addAccessoryViewWithDoneButton {
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:nil];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self action:@selector(keyboardAccessoryViewDoneButtonPressed)];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:ORKLocalizedString(@"BUTTON_DONE", nil) style:UIBarButtonItemStylePlain target:self action:@selector(keyboardAccessoryViewDoneButtonPressed)];

if (@available(iOS 26.0, *)) {
doneButton.hidesSharedBackground = YES;
accessoryViewWithDoneButton.backgroundColor = ORKColor(ORKToolBarTintColorKey);
doneButton.tintColor = ORKViewTintColor(self);
} else {
[accessoryViewWithDoneButton setBarTintColor:ORKColor(ORKBackgroundColorKey)];
}

accessoryViewWithDoneButton.items = @[flexibleSpace, doneButton];
[accessoryViewWithDoneButton setBarTintColor:ORKColor(ORKBackgroundColorKey)];
self.inputAccessoryView = accessoryViewWithDoneButton;
}

Expand Down
6 changes: 5 additions & 1 deletion ResearchKit/Common/ORKTaskViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ - (UIBarButtonItem *)rightBarItemWithText:(NSString *)text {
}
[progressLabelNavigationItem setText:text];

return [[UIBarButtonItem alloc] initWithCustomView:progressLabelNavigationItem];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:progressLabelNavigationItem];
if (@available(iOS 26.0, *)) {
item.hidesSharedBackground = YES;
}
return item;
}

- (void)requestHealthStoreAccessWithReadTypes:(NSSet *)readTypes
Expand Down
14 changes: 2 additions & 12 deletions ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@implementation UIBarButtonItem (ORKBarButtonItem)

+ (UIBarButtonItem *)ork_backBarButtonItemWithTarget:(id)target action:(SEL)selector {
NSString *regularImageName = @"arrowLeft";
NSString *landscapeImageName = @"arrowLeftLandscape";

if ([UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft ) {
regularImageName = @"arrowRight";
landscapeImageName = @"arrowRightLandscape";
}

UIImage *image = [UIImage imageNamed:regularImageName inBundle:ORKBundle() compatibleWithTraitCollection:nil];
UIImage *landscapeImage = [UIImage imageNamed:landscapeImageName inBundle:ORKBundle() compatibleWithTraitCollection:nil];
UIImage *image = [UIImage systemImageNamed:@"chevron.backward"];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:image
landscapeImagePhone:landscapeImage
style:UIBarButtonItemStyleDone
style:UIBarButtonItemStylePlain
target:target
action:selector];
item.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions samples/ORKCatalog/ORKCatalog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
246DFA261BEAE26200591E9A /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = en_GB.lproj/Localizable.strings; sourceTree = "<group>"; };
246DFA271BEAE27000591E9A /* en-AU */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-AU"; path = en_AU.lproj/Localizable.strings; sourceTree = "<group>"; };
246DFA281BEAE2A800591E9A /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = zh_HK.lproj/Localizable.strings; sourceTree = "<group>"; };
3E39B9E81ABF675000C2ABE5 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
3E39B9E81ABF675000C2ABE5 /* readme.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = readme.md; sourceTree = "<group>"; };
3E39B9FA1ABF682D00C2ABE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3E39B9FD1ABF683700C2ABE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
3E39B9FF1ABF683F00C2ABE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,7 +152,7 @@
869230B51AAA890A00BFE11B = {
isa = PBXGroup;
children = (
3E39B9E81ABF675000C2ABE5 /* README.md */,
3E39B9E81ABF675000C2ABE5 /* readme.md */,
BC2A3C9E1C58E81500DA64B7 /* Frameworks */,
869230C01AAA890A00BFE11B /* ORKCatalog */,
869230BF1AAA890A00BFE11B /* Products */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -88,7 +87,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -90,7 +89,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -86,7 +85,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA87DBAF20B80FFD004ACAFF"
BuildableName = "ORKParkinsonStudy WatchKit App.app"
BlueprintName = "ORKParkinsonStudy WatchKit App"
ReferencedContainer = "container:ORKParkinsonStudy.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Loading