Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Landing Screen, Notifications Screen, and updated all Onboarding Pages #4

Merged
merged 31 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5bedab1
Updated onboarding screens and made a landing page.
ckunchur Feb 8, 2023
5514924
added notification screen
ckunchur Feb 9, 2023
74ba390
added app logo as homescreen icon
ckunchur Feb 9, 2023
d24c132
Update PAWSModules/Sources/PAWSOnboardingFlow/OnboardingFlow.swift
ckunchur Feb 14, 2023
1914daf
Update PAWSModules/Sources/PAWSOnboardingFlow/OnboardingFlow.swift
ckunchur Feb 14, 2023
94d4967
Update PAWSModules/Sources/PAWSOnboardingFlow/InterestingModules.swift
ckunchur Feb 14, 2023
90ae055
Update PAWS/Home.swift
ckunchur Feb 14, 2023
31b935d
Update PAWS/PAWS.swift
ckunchur Feb 14, 2023
241e86f
Update PAWS/PAWS.swift
ckunchur Feb 14, 2023
7632261
Update PAWS/PAWS.swift
ckunchur Feb 14, 2023
f9f01e3
swiftlint errors
ckunchur Feb 14, 2023
4bef384
fixed lint errors
ckunchur Feb 14, 2023
9dd13ba
fixed merge issues in home file
ckunchur Feb 14, 2023
fa1360e
deleted stuff
ckunchur Feb 14, 2023
a05d559
deleted register screen
ckunchur Feb 14, 2023
67d962b
deleted image files
ckunchur Feb 14, 2023
20038a2
deleted image files
ckunchur Feb 14, 2023
b40a66e
added license file
ckunchur Feb 14, 2023
f1a609e
fixed swiftlint errors
ckunchur Feb 14, 2023
931dc66
update gitignore
ckunchur Feb 15, 2023
df2a15e
add logo license
ckunchur Feb 15, 2023
754eb5c
fixed swiftlint errors
ckunchur Feb 15, 2023
b4d5473
temporarily reomved onboarding and mock upload tests for first merge
ckunchur Feb 15, 2023
0c76221
temporarily reomved onboarding and mock upload tests for first merge
ckunchur Feb 15, 2023
5091cdb
Fix Tests
PSchmiedmayer Feb 15, 2023
969fc4e
Improve Code Structure
PSchmiedmayer Feb 15, 2023
1034441
Improve Code Structure
PSchmiedmayer Feb 15, 2023
311574d
Fix compilation error with the icon
PSchmiedmayer Feb 15, 2023
221b0bc
Increase the timeouts in the HealthKit tests
PSchmiedmayer Feb 15, 2023
489d1ad
Remove unused code
PSchmiedmayer Feb 15, 2023
b862063
Fix unused import
PSchmiedmayer Feb 16, 2023
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
22 changes: 18 additions & 4 deletions PAWS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
2F5E32BD297E05EA003432F8 /* PAWSAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E32BC297E05EA003432F8 /* PAWSAppDelegate.swift */; };
2FC9759F2978E39600BA99FE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2FC9759E2978E39600BA99FE /* Localizable.strings */; };
2FC975A82978F11A00BA99FE /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC975A72978F11A00BA99FE /* Home.swift */; };
3637947E2992F3B000B3C006 /* PAWSLandingScreen in Frameworks */ = {isa = PBXBuildFile; productRef = 3637947D2992F3B000B3C006 /* PAWSLandingScreen */; };
36379481299308AA00B3C006 /* PAWSNotificationScreen in Frameworks */ = {isa = PBXBuildFile; productRef = 36379480299308AA00B3C006 /* PAWSNotificationScreen */; };
653A2551283387FE005D4D48 /* PAWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A2550283387FE005D4D48 /* PAWS.swift */; };
653A255528338800005D4D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 653A255428338800005D4D48 /* Assets.xcassets */; };
653A256228338800005D4D48 /* PAWSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A256128338800005D4D48 /* PAWSTests.swift */; };
Expand Down Expand Up @@ -79,9 +81,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
36379481299308AA00B3C006 /* PAWSNotificationScreen in Frameworks */,
2F59B941298C628800C5107F /* PAWSOnboardingFlow in Frameworks */,
2F49B7822980419C00BCB272 /* Questionnaires in Frameworks */,
2F49B77E2980407C00BCB272 /* Scheduler in Frameworks */,
3637947E2992F3B000B3C006 /* PAWSLandingScreen in Frameworks */,
2F59B93F298C628800C5107F /* PAWSMockDataStorageProvider in Frameworks */,
2F49B77A2980407C00BCB272 /* HealthKitDataSource in Frameworks */,
2F59B945298C628800C5107F /* PAWSSharedContext in Frameworks */,
Expand Down Expand Up @@ -224,6 +228,8 @@
2F59B940298C628800C5107F /* PAWSOnboardingFlow */,
2F59B942298C628800C5107F /* PAWSSchedule */,
2F59B944298C628800C5107F /* PAWSSharedContext */,
3637947D2992F3B000B3C006 /* PAWSLandingScreen */,
36379480299308AA00B3C006 /* PAWSNotificationScreen */,
);
productName = TemplateApplication;
productReference = 653A254D283387FE005D4D48 /* PAWS.app */;
Expand Down Expand Up @@ -519,8 +525,8 @@
INFOPLIST_FILE = "PAWS/Supporting Files/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = PAWS;
INFOPLIST_KEY_NSCameraUsageDescription = "This message should never appear. Please adjust this when you start using camera information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSHealthShareUsageDescription = "The CS342 2023 PAWS Team Application uses the step count to demonstrate CardinalKit's integration with HealthKit.";
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "The CS342 2023 PAWS Team Application uses the step count to demonstrate CardinalKit's integration with HealthKit.";
INFOPLIST_KEY_NSHealthShareUsageDescription = "The PAWS Application uses the heart rate information to extract ECG data and provide it to the researchers. ";
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "The PAWS Application uses the heart rate information to extract ECG data and provide it to the researchers. ";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "This message should never appear. Please adjust this when you start using location information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This message should never appear. Please adjust this when you start using location information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "This message should never appear. Please adjust this when you start using microphone information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
Expand Down Expand Up @@ -566,8 +572,8 @@
INFOPLIST_FILE = "PAWS/Supporting Files/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = PAWS;
INFOPLIST_KEY_NSCameraUsageDescription = "This message should never appear. Please adjust this when you start using camera information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSHealthShareUsageDescription = "The CS342 2023 PAWS Team Application uses the step count to demonstrate CardinalKit's integration with HealthKit.";
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "The CS342 2023 PAWS Team Application uses the step count to demonstrate CardinalKit's integration with HealthKit.";
INFOPLIST_KEY_NSHealthShareUsageDescription = "The PAWS Application uses the heart rate information to extract ECG data and provide it to the researchers. ";
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "The PAWS Application uses the heart rate information to extract ECG data and provide it to the researchers. ";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "This message should never appear. Please adjust this when you start using location information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This message should never appear. Please adjust this when you start using location information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "This message should never appear. Please adjust this when you start using microphone information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
Expand Down Expand Up @@ -801,6 +807,14 @@
isa = XCSwiftPackageProductDependency;
productName = PAWSSharedContext;
};
3637947D2992F3B000B3C006 /* PAWSLandingScreen */ = {
isa = XCSwiftPackageProductDependency;
productName = PAWSLandingScreen;
};
36379480299308AA00B3C006 /* PAWSNotificationScreen */ = {
isa = XCSwiftPackageProductDependency;
productName = PAWSNotificationScreen;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 653A2545283387FE005D4D48 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
6 changes: 6 additions & 0 deletions PAWS.xcodeproj/xcshareddata/xcschemes/PAWS.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
ReferencedContainer = "container:PAWS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--showOnboarding"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
17 changes: 12 additions & 5 deletions PAWS/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,34 @@
import PAWSContacts
import PAWSMockDataStorageProvider
import PAWSSchedule
import PAWSNotificationScreen
import PAWSSharedContext
import SwiftUI


struct HomeView: View {
enum Tabs: String {
case schedule
//case schedule
ckunchur marked this conversation as resolved.
Show resolved Hide resolved
case notifications
case contact
case mockUpload
}


@AppStorage(StorageKeys.homeTabSelection) var selectedTab = Tabs.schedule
@AppStorage(StorageKeys.homeTabSelection) var selectedTab = Tabs.notifications


var body: some View {
TabView(selection: $selectedTab) {
ScheduleView()
.tag(Tabs.schedule)
// ScheduleView()
// .tag(Tabs.schedule)
// .tabItem {
// Label("SCHEDULE_TAB_TITLE", systemImage: "square.and.arrow.up")
// }
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
NotificationScreen()
.tag(Tabs.notifications)
.tabItem {
Label("SCHEDULE_TAB_TITLE", systemImage: "list.clipboard")
Label("NOTIFICATIONS_TAB_TITLE", systemImage: "bell.fill")
}
Contacts()
.tag(Tabs.contact)
Expand Down
29 changes: 24 additions & 5 deletions PAWS/PAWS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,41 @@ import CardinalKit
import PAWSOnboardingFlow
import PAWSSharedContext
import SwiftUI

import PAWSLandingScreen

@main
struct PAWS: App {
@UIApplicationDelegateAdaptor(PAWSAppDelegate.self) var appDelegate
@AppStorage(StorageKeys.onboardingFlowComplete) var completedOnboardingFlow = false
// @AppStorage(StorageKeys.accountCreated) var completedAccountSetup = false
ckunchur marked this conversation as resolved.
Show resolved Hide resolved

@State var pressedStart = false

var isSheetPresented: Binding<Bool> {
Binding(
get: {
!completedOnboardingFlow && pressedStart
}, set: { _ in }
)
}

var body: some Scene {
WindowGroup {
HomeView()
.sheet(isPresented: !$completedOnboardingFlow) {
OnboardingFlow()
// if completedAccountSetup {
ckunchur marked this conversation as resolved.
Show resolved Hide resolved
Group {
if completedOnboardingFlow {
HomeView()
} else {
LandingScreen(pressedStart: $pressedStart)
}
.testingSetup()
}
.sheet(isPresented: isSheetPresented) {
OnboardingFlow()
}
.interactiveDismissDisabled(true)
.testingSetup()
ckunchur marked this conversation as resolved.
Show resolved Hide resolved
.cardinalKit(appDelegate)

}
}
}
15 changes: 14 additions & 1 deletion PAWS/PAWSAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ class PAWSAppDelegate: CardinalKitAppDelegate {
if HKHealthStore.isHealthDataAvailable() {
HealthKit {
CollectSample(
HKQuantityType(.stepCount),
HKQuantityType(.heartRate),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
)
CollectSample(
HKQuantityType(.heartRateVariabilitySDNN),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
)
CollectSample(
HKQuantityType(.restingHeartRate),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
)

PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
CollectSample(
HKQuantityType.electrocardiogramType(),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
)
} adapter: {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "1024.png",
"filename" : "paws-logo.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "aydin_zahedivash.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "scott-ceresnak.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions PAWS/Supporting Files/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//


// MARK: - Notifications
"NOTIFICATIONS_TAB_TITLE" = "Notifications";

// MARK: - Contacts
"CONTACTS_TAB_TITLE" = "Contacts";

Expand Down
27 changes: 26 additions & 1 deletion PAWSModules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ let package = Package(
.library(name: "PAWSMockDataStorageProvider", targets: ["PAWSMockDataStorageProvider"]),
.library(name: "PAWSOnboardingFlow", targets: ["PAWSOnboardingFlow"]),
.library(name: "PAWSSchedule", targets: ["PAWSSchedule"]),
.library(name: "PAWSSharedContext", targets: ["PAWSSharedContext"])
.library(name: "PAWSSharedContext", targets: ["PAWSSharedContext"]),
.library(name: "PAWSLandingScreen", targets: ["PAWSLandingScreen"]),
.library(name: "PAWSNotificationScreen", targets: ["PAWSNotificationScreen"]),


PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
],
dependencies: [
.package(url: "https://github.com/StanfordBDHG/CardinalKit.git", .upToNextMinor(from: "0.2.1"))
Expand Down Expand Up @@ -73,6 +77,27 @@ let package = Package(
.target(
name: "PAWSSharedContext",
dependencies: []
),
.target(
name: "PAWSLandingScreen",
dependencies: [],
resources: [
.process("Resources")
]
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
),
.target(
name: "PAWSNotificationScreen",
dependencies: [],
resources: [
.process("Resources")
]
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
),
.target(
name: "PAWSRegisterScreen",
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
dependencies: [],
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
resources: [
.process("Resources")
]
)
]
)
57 changes: 45 additions & 12 deletions PAWSModules/Sources/PAWSContacts/Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,64 @@ public struct Contacts: View {
let contacts = [
Contact(
name: PersonNameComponents(
givenName: "Leland",
familyName: "Stanford"
givenName: "Scott",
familyName: "Ceresnak"
),
image: Image(systemName: "figure.wave.circle"),
title: "University Founder",
description: String(localized: "LELAND_STANFORD_BIO", bundle: .module),
image: Image(systemName: "person.circle"),
title: "Professor of Pediatrics (Cardiology)",
description: String(localized: "SCOTT_CERESNAK_BIO", bundle: .module),
organization: "Stanford University",
address: {
let address = CNMutablePostalAddress()
address.country = "USA"
address.state = "CA"
address.postalCode = "94305"
address.city = "Stanford"
address.street = "450 Serra Mall"
address.postalCode = "94304"
address.city = "Palo Alto"
address.street = "725 Welch Rd"
return address
}(),
contactOptions: [
.call("+1 (650) 723-2300"),
.text("+1 (650) 723-2300"),
.email(addresses: ["contact@stanford.edu"]),
//.call("+1 (650) 723-2300"),
//.text("+1 (650) 723-2300"),
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
.email(addresses: ["ceresnak@stanford.edu"]),
ContactOption(
image: Image(systemName: "safari.fill"),
title: "Website",
action: {
if let url = URL(string: "https://stanford.edu") {
if let url = URL(string: "https://profiles.stanford.edu/intranet/scott-ceresnak?tab=bio") {
UIApplication.shared.open(url)
}
}
)
]
),
Contact(
name: PersonNameComponents(
givenName: "Aydin",
familyName: "Zahedivash"
),
image: Image(systemName: "person.circle"),
title: "Pediatric Stanford Cardiology Fellow",
description: String(localized: "AYDIN_ZAHEDIVASH_BIO", bundle: .module),
organization: "Stanford University",
address: {
let address = CNMutablePostalAddress()
address.country = "USA"
address.state = "CA"
address.postalCode = "94304"
address.city = "Palo Alto"
address.street = "725 Welch Rd"
return address
}(),
contactOptions: [
//.call("+1 (650) 723-2300"),
//.text("+1 (650) 723-2300"),
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
.email(addresses: ["[email protected]"]),
ContactOption(
image: Image(systemName: "safari.fill"),
title: "Website",
action: {
if let url = URL(string: "https://profiles.stanford.edu/intranet/scott-ceresnak?tab=bio") {
UIApplication.shared.open(url)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

// MARK: - Contacts
"CONTACTS_NAVIGATION_TITLE" = "Contacts";
"LELAND_STANFORD_BIO" = "Amasa Leland Stanford (March 9, 1824 – June 21, 1893) was an American industrialist and politician. [...] He and his wife Jane were also the founders of Stanford University, which they named after their late son.
[https://en.wikipedia.org/wiki/Leland_Stanford]";
"SCOTT_CERESNAK_BIO" = "Dr. Scott R. Ceresnak is a pediatric cardiologist in Walnut Creek, California and is affiliated with multiple hospitals in the area, including California Pacific Medical Center and Stanford Health Care-Stanford Hospital. He received his medical degree from Rutgers Robert Wood Johnson Medical School and has been in practice for more than 20 years.";
PSchmiedmayer marked this conversation as resolved.
Show resolved Hide resolved
"AYDIN_ZAHEDIVASH_BIO" = "";
Loading