Skip to content

Commit 1930bdb

Browse files
authored
Merge pull request #168 from TaskarCenterAtUW/feature-FloatingActionButton
Add floating button
2 parents 806ea43 + b1de0c7 commit 1930bdb

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
FAD5C5142AFCBE720040C61A /* GoInfoGameUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAD5C5132AFCBE720040C61A /* GoInfoGameUITests.swift */; };
219219
FAD5C5162AFCBE720040C61A /* GoInfoGameUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAD5C5152AFCBE720040C61A /* GoInfoGameUITestsLaunchTests.swift */; };
220220
FAE2584F2D39819300D2BB12 /* QuestCategoryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE2584E2D39819300D2BB12 /* QuestCategoryListView.swift */; };
221+
FAE258522D3A780F00D2BB12 /* FloatingActionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE258512D3A780F00D2BB12 /* FloatingActionButton.swift */; };
221222
FAF44FBD2B3084EC004FE664 /* OnboardingView1.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF44FBC2B3084EC004FE664 /* OnboardingView1.swift */; };
222223
FAF44FBF2B3084FB004FE664 /* OnboardingView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF44FBE2B3084FB004FE664 /* OnboardingView2.swift */; };
223224
FAF44FC12B30850A004FE664 /* OnboardingView3.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF44FC02B30850A004FE664 /* OnboardingView3.swift */; };
@@ -531,6 +532,7 @@
531532
FAD5C5132AFCBE720040C61A /* GoInfoGameUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoInfoGameUITests.swift; sourceTree = "<group>"; };
532533
FAD5C5152AFCBE720040C61A /* GoInfoGameUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoInfoGameUITestsLaunchTests.swift; sourceTree = "<group>"; };
533534
FAE2584E2D39819300D2BB12 /* QuestCategoryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestCategoryListView.swift; sourceTree = "<group>"; };
535+
FAE258512D3A780F00D2BB12 /* FloatingActionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingActionButton.swift; sourceTree = "<group>"; };
534536
FAF44FBC2B3084EC004FE664 /* OnboardingView1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView1.swift; sourceTree = "<group>"; };
535537
FAF44FBE2B3084FB004FE664 /* OnboardingView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView2.swift; sourceTree = "<group>"; };
536538
FAF44FC02B30850A004FE664 /* OnboardingView3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView3.swift; sourceTree = "<group>"; };
@@ -1279,6 +1281,7 @@
12791281
isa = PBXGroup;
12801282
children = (
12811283
FA87A80F2B68142F000A6BEA /* LoadingView.swift */,
1284+
FAE258512D3A780F00D2BB12 /* FloatingActionButton.swift */,
12821285
);
12831286
path = Utils;
12841287
sourceTree = "<group>";
@@ -2053,6 +2056,7 @@
20532056
05DBBB622B164D9A00B6F110 /* RealOPElement.swift in Sources */,
20542057
973FC0422B59467A00878269 /* BusStopLit.swift in Sources */,
20552058
97AC1C0A2B6B7F10004F0BF4 /* CustomVerticalButtonsList.swift in Sources */,
2059+
FAE258522D3A780F00D2BB12 /* FloatingActionButton.swift in Sources */,
20562060
973FC0352B592C0F00878269 /* StairNumberForm.swift in Sources */,
20572061
FA8C74C22C4E89C800D28220 /* LongForm.swift in Sources */,
20582062
FAC9E60F2B04F9C800E2C608 /* OverpassRequestManager.swift in Sources */,

GoInfoGame/GoInfoGame/UI/InitialView/InitialView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct InitialView: View {
2626
.resizable()
2727
.frame(width: 27, height: 27)
2828
.padding([.leading], 18)
29+
.foregroundStyle(Color(red: 135/255, green: 62/255, blue: 242/255))
2930

3031
}
3132
Spacer()

GoInfoGame/GoInfoGame/UI/Map/MapView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ struct MapView: View {
7676
}
7777
}
7878
}
79+
80+
FloatingActionButton()
81+
.padding([.bottom], 50)
7982
}
8083
.environmentObject(contextualInfo)
8184
.navigationBarHidden(isPresented)
@@ -84,6 +87,7 @@ struct MapView: View {
8487
ToolbarItem(placement: .navigationBarLeading) {
8588
NavigationLink(destination: UserProfileView()) {
8689
Image(systemName: "person.crop.circle.fill")
90+
.foregroundStyle(Color(red: 135/255, green: 62/255, blue: 242/255))
8791
}
8892
}
8993
ToolbarItem(placement: .navigationBarTrailing) {
@@ -93,6 +97,7 @@ struct MapView: View {
9397
}) {
9498
Image(systemName: "arrow.2.circlepath")
9599
.frame(width: 20, height: 20)
100+
.foregroundStyle(Color(red: 135/255, green: 62/255, blue: 242/255))
96101
}
97102
}
98103

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// FloatingActionButton.swift
3+
// GoInfoGame
4+
//
5+
// Created by Achyut Kumar M on 17/01/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct FloatingActionButton: View {
11+
12+
var body: some View {
13+
VStack {
14+
Spacer()
15+
HStack {
16+
Spacer()
17+
NavigationLink(destination: QuestCategoryListView()) {
18+
Image(systemName: "slider.horizontal.3")
19+
.font(.system(size: 25))
20+
.foregroundColor(.white)
21+
}
22+
.frame(width: 40, height: 40)
23+
.background(Color(red: 135/255, green: 62/255, blue: 242/255))
24+
.cornerRadius(30)
25+
.shadow(radius: 10)
26+
.offset(x: -25, y: 10)
27+
}
28+
}
29+
}
30+
}
31+
#Preview {
32+
FloatingActionButton()
33+
}

GoInfoGame/GoInfoGame/quests/QuestCategory/UI/QuestCategoryListView.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ struct QuestCategoryListView: View {
1515
List {
1616
ForEach(questManager.allQuests.indices, id: \.self) { index in
1717
HStack {
18-
Image(uiImage: questManager.allQuests[index].quest.icon)
19-
.resizable()
20-
.aspectRatio(contentMode: .fit)
21-
.frame(width: 30, height: 30)
22-
23-
Text(questManager.allQuests[index].quest.title)
24-
2518
Button(action: {
2619
questManager.allQuests[index].toggleIsDefault()
2720
}) {
2821
CheckBoxView(isChecked: questManager.allQuests[index].isDefault)
2922
}
23+
24+
Image(uiImage: questManager.allQuests[index].quest.icon)
25+
.resizable()
26+
.aspectRatio(contentMode: .fit)
27+
.frame(width: 30, height: 30)
28+
Text(questManager.allQuests[index].quest.title == "" ? questManager.longQuestModels[index].elementType : questManager.allQuests[index].quest.title)
3029
}
3130
}
3231
}

0 commit comments

Comments
 (0)