Skip to content

Commit

Permalink
Improvements/bal 175 body sensation rewards (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
gperissetcelteeka authored Sep 20, 2023
1 parent 638a705 commit c15259a
Show file tree
Hide file tree
Showing 49 changed files with 229 additions and 124 deletions.
4 changes: 4 additions & 0 deletions Balance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
6CC177282A3A6BA900121B72 /* CellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC177272A3A6BA900121B72 /* CellView.swift */; };
6CE62D552A014BF300BB4F90 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6CE62D542A014BF300BB4F90 /* LaunchScreen.storyboard */; };
6CE62D572A028F3400BB4F90 /* Country.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE62D562A028F3400BB4F90 /* Country.swift */; };
6CE8A7892AA291A4003CD727 /* ChillCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE8A7882AA291A4003CD727 /* ChillCellView.swift */; };
6CF510C029C8FD25008A2F55 /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF510BF29C8FD25008A2F55 /* LocationView.swift */; };
6CF6BEE62A31103A00A337F3 /* Bundle+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF6BEE12A31103A00A337F3 /* Bundle+Image.swift */; };
6CF6BEE72A31103A00A337F3 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF6BEE22A31103A00A337F3 /* FeatureFlags.swift */; };
Expand Down Expand Up @@ -358,6 +359,7 @@
6CC177272A3A6BA900121B72 /* CellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellView.swift; sourceTree = "<group>"; };
6CE62D542A014BF300BB4F90 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
6CE62D562A028F3400BB4F90 /* Country.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Country.swift; sourceTree = "<group>"; };
6CE8A7882AA291A4003CD727 /* ChillCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChillCellView.swift; path = Balance/Chill/ChillCellView.swift; sourceTree = SOURCE_ROOT; };
6CF510BF29C8FD25008A2F55 /* LocationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationView.swift; sourceTree = "<group>"; };
6CF6BEE12A31103A00A337F3 /* Bundle+Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Image.swift"; sourceTree = "<group>"; };
6CF6BEE22A31103A00A337F3 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -797,6 +799,7 @@
children = (
4ACC786029AC0B590048D1D1 /* Meditation */,
6C370AAC29D38F7F001781B3 /* ChillView.swift */,
6CE8A7882AA291A4003CD727 /* ChillCellView.swift */,
6CE62D5D2A030B6800BB4F90 /* Timer */,
6C85C6DD2A0554610053F759 /* BodySensationView.swift */,
);
Expand Down Expand Up @@ -1213,6 +1216,7 @@
6C55770F2A3A505F003FD6EE /* SpotifyDataController.swift in Sources */,
6CB5181A29E45678007AADB4 /* ImageCollectionView.swift in Sources */,
6C3248482A8D85AB00223F8C /* SketchView.swift in Sources */,
6CE8A7892AA291A4003CD727 /* ChillCellView.swift in Sources */,
6C55243829F8722B00F802D9 /* ContentView.swift in Sources */,
6CC177262A3A5E2900121B72 /* ActivityLogStore.swift in Sources */,
89EB7BB129B45D2B000470FC /* HeaderMenu.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "5034479ca0c4f32f299677fb0ba1fe4d3e3e20b4",
"version" : "10.10.0"
"revision" : "2bfe6abe1014aafe5cf28401708f7d39f9926a76",
"version" : "10.14.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "69f5b8425dd473d2f2475bba7f88f82cd9da0e36",
"version" : "10.10.0"
"revision" : "03b9beee1a61f62d32c521e172e192a1663a5e8b",
"version" : "10.13.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "7874c1b48cbffd086ce8a052c4be873a78613775",
"version" : "9.2.3"
"revision" : "aae45a320fd0d11811820335b1eabc8753902a40",
"version" : "9.2.5"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "871d43135925cde39ef7421d8723ce47edfdcc39",
"version" : "7.11.1"
"revision" : "c38ce365d77b04a9a300c31061c5227589e5597b",
"version" : "7.11.5"
}
},
{
Expand All @@ -86,8 +86,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/HealthKitOnFHIR",
"state" : {
"revision" : "d10f408766264183cd50bb117b99580255520aa3",
"version" : "0.2.3"
"revision" : "fdf8e4543718a940643598e4bd5e750e9c4c5540",
"version" : "0.2.4"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
Expand All @@ -96,7 +105,7 @@
"location" : "https://github.com/spotify/ios-sdk.git",
"state" : {
"branch" : "master",
"revision" : "c12c8630949492439e54b6482219c34bc7d65157"
"revision" : "cdbdcb341ace5defa863cf323749376f7e4888e9"
}
},
{
Expand All @@ -122,17 +131,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "ec957ccddbcc710ccc64c9dcbd4c7006fcf8b73a",
"version" : "2.2.0"
"revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
"version" : "2.3.1"
}
},
{
"identity" : "researchkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/ResearchKit",
"state" : {
"revision" : "3ea06dcc596bd49571ae3353c9c1555776114072",
"version" : "2.2.9"
"revision" : "d66e17369cfa238179db8ab65285fe6e7fa3e3c8",
"version" : "2.2.12"
}
},
{
Expand All @@ -149,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "f25867a208f459d3c5a06935dceb9083b11cd539",
"version" : "1.22.0"
"revision" : "cf62cdaea48b77f1a631e5cb3aeda6047c2cba1d",
"version" : "1.23.0"
}
},
{
Expand All @@ -167,17 +176,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/XCTHealthKit",
"state" : {
"revision" : "19395bbd14a2554e4c9d3fe5cf38aa626c807269",
"version" : "0.3.3"
"revision" : "6e9344a2d632b801d94fe3bbd1d891817e032103",
"version" : "0.3.5"
}
},
{
"identity" : "youtubeplayerkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SvenTiigi/YouTubePlayerKit.git",
"state" : {
"revision" : "b2cf1e0c0b081594a51b229347d7c3b7d3aca5a1",
"version" : "1.5.0"
"revision" : "6bbba75c8a8927e8073765849e22707d96b55205",
"version" : "1.5.2"
}
}
],
Expand Down
5 changes: 4 additions & 1 deletion Balance/ActivityLogging/ActivityStorageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ class ActivityLogEntry: ObservableObject, Codable {
actionDescription.contains("Closed Mandala Selected") ||
actionDescription.contains("Closed Coloring Saved") ||
actionDescription.contains("Closed Draw Saved") ||
actionDescription.contains("Closed Playing Spotify") {
actionDescription.contains("Closed Playing Spotify") ||
actionDescription.contains("Closed Body sensations Part") ||
actionDescription.contains("Closed Breathing Feature") ||
actionDescription.contains("Closed Guided meditation Feature") {
if (interval.second ?? 0) > coinsTime {
NotificationCenter.default.post(name: Notification.Name.coinsUpdate, object: nil)
}
Expand Down
26 changes: 13 additions & 13 deletions Balance/Chill/BodySensationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ struct BodySensationView: View {
var headButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Head",
viewName: "Body sensations Part Head",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .head,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -71,13 +71,13 @@ struct BodySensationView: View {
var feetButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Feet",
viewName: "Body sensations Part Feet",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .feet,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -95,13 +95,13 @@ struct BodySensationView: View {
var shouldersButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Shoulders",
viewName: "Body sensations Part Shoulders",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .shoulders,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -119,13 +119,13 @@ struct BodySensationView: View {
var handsButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Hands",
viewName: "Body sensations Part Hands",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .hands,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -143,13 +143,13 @@ struct BodySensationView: View {
var kneeButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Knee",
viewName: "Body sensations Part Knee",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .knee,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -167,13 +167,13 @@ struct BodySensationView: View {
var legsButton: some View {
NavigationLink(
destination: ActivityLogBaseView(
viewName: "Body sensations Legs",
viewName: "Body sensations Part Legs",
isDirectChildToContainer: true,
content: {
NewTimerView(
chillType: .legs,
navTitleText: "Body sensations",
subTitleText: "Relax your self and focus on this part of your body"
subTitleText: "Relax yourself and focus on this part of your body"
)
}
)
Expand All @@ -193,7 +193,7 @@ struct BodySensationView: View {
.resizable()
.scaledToFit()
.frame(width: 230, height: 230, alignment: .center)
.accessibilityLabel("imageBS")
.accessibility(hidden: true)
}

var titleText: some View {
Expand Down
67 changes: 67 additions & 0 deletions Balance/Chill/ChillCellView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// This source file is part of the CS342 2023 Balance Team Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// SPDX-License-Identifier: MIT
//

import SwiftUI

struct ChillCellView: View {
var image: String
var text: String
var pointVal: String

var body: some View {
HStack {
Image(image)
.resizable()
.scaledToFit()
.accessibility(hidden: true)
.frame(width: 80, height: 80)
Spacer()
Text(text)
.padding(.leading, 20.0)
.minimumScaleFactor(0.5)
.font(.custom("Nunito-Bold", size: 25))
.lineLimit(2)
.multilineTextAlignment(.leading)
.frame(maxWidth: .infinity, alignment: .leading)
.frame(height: 80)
Spacer()
VStack {
pointValueView
Spacer()
}
}
.padding(EdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 0))
.frame(maxWidth: 311, maxHeight: 114)
.foregroundColor(darkBlueColor)
.background(RoundedRectangle(cornerRadius: 20).fill(.white))
.clipped()
.shadow(color: Color.black.opacity(0.10), radius: 7, x: 2, y: 2)
.padding(EdgeInsets(top: 0, leading: 24, bottom: 0, trailing: 24))
}

var pointValueView: some View {
ZStack {
Text(pointVal)
.font(.custom("Nunito-Bold", size: 14))
.frame(width: 30, height: 20)
.padding(.trailing, 25.0)
.padding(.vertical, 3.0)
.background(primaryColor .opacity(0.4))
.cornerRadius(5)
.offset(x: -10)
Image("pointsStarIcon")
.accessibility(hidden: true)
}.offset(y: -15)
}
}

struct ChillCellViewPreview: PreviewProvider {
static var previews: some View {
ChillCellView(image: "BalanceLogo", text: "diary", pointVal: "5")
}
}
8 changes: 4 additions & 4 deletions Balance/Chill/ChillView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "writeIcon", text: "Write Something")
ChillCellView(image: "writeIcon", text: "Write Something", pointVal: "5")
}
}

Expand All @@ -62,7 +62,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "meditationIcon", text: "Guided Meditation")
ChillCellView(image: "meditationIcon", text: "Guided Meditation", pointVal: "5")
}
}

Expand All @@ -76,7 +76,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "breathIcon", text: "Breathing")
ChillCellView(image: "breathIcon", text: "Breathing", pointVal: "5")
}
}

Expand All @@ -90,7 +90,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "bodySensationIcon", text: "Body Sensations")
ChillCellView(image: "bodySensationIcon", text: "Body Sensations", pointVal: "5")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Balance/Chill/Meditation/MeditationSpotifyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct MeditationSpotifyView: View {
.resizable()
.frame(width: 130, height: 130, alignment: .leading)
.aspectRatio(contentMode: .fill)
.accessibilityLabel("Thumbnail for song")
.accessibility(hidden: true)
VStack(alignment: .leading) {
Text(song.title).font(.custom("Nunito-Bold", size: 15))
Text(song.artist).font(.custom("Nunito-Bold", size: 10))
Expand Down
Loading

0 comments on commit c15259a

Please sign in to comment.