Skip to content

Commit

Permalink
Merge branch 'main' into feat/#25
Browse files Browse the repository at this point in the history
  • Loading branch information
grootwo authored May 21, 2024
2 parents 4045f24 + a3b8059 commit 7f568a4
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 47 deletions.
8 changes: 6 additions & 2 deletions MC2-Team3-Pilling.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
939C88362BF6B9BC00572EDC /* OnboardingSecondView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 939C88352BF6B9BC00572EDC /* OnboardingSecondView.swift */; };
939C88382BF6DF7000572EDC /* SplashScreenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 939C88372BF6DF7000572EDC /* SplashScreenView.swift */; };
939C88742BFBA01C00572EDC /* PopoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 939C88732BFBA01C00572EDC /* PopoverView.swift */; };
93EF92D62BFC4187004DEEF1 /* ChooseStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93EF92D52BFC4187004DEEF1 /* ChooseStatusView.swift */; };
9B0411762BF593A0006F8BB9 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0411752BF593A0006F8BB9 /* MainView.swift */; };
9BE4AA1D2BF6E280008BE893 /* CustomFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE4AA1C2BF6E280008BE893 /* CustomFont.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -82,6 +83,7 @@
939C88352BF6B9BC00572EDC /* OnboardingSecondView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingSecondView.swift; sourceTree = "<group>"; };
939C88372BF6DF7000572EDC /* SplashScreenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreenView.swift; sourceTree = "<group>"; };
939C88732BFBA01C00572EDC /* PopoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopoverView.swift; sourceTree = "<group>"; };
93EF92D52BFC4187004DEEF1 /* ChooseStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChooseStatusView.swift; sourceTree = "<group>"; };
9B0411752BF593A0006F8BB9 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
9BE4AA1C2BF6E280008BE893 /* CustomFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFont.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -138,6 +140,7 @@
939C88372BF6DF7000572EDC /* SplashScreenView.swift */,
939C88732BFBA01C00572EDC /* PopoverView.swift */,
21B2730B2BFB7301002BCC67 /* SwiftDataTestView.swift */,
93EF92D52BFC4187004DEEF1 /* ChooseStatusView.swift */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -314,6 +317,7 @@
buildActionMask = 2147483647;
files = (
939C87E22BF307B600572EDC /* ContentView.swift in Sources */,
93EF92D62BFC4187004DEEF1 /* ChooseStatusView.swift in Sources */,
939C882E2BF5CC9100572EDC /* OnboardingFirstView.swift in Sources */,
9B0411762BF593A0006F8BB9 /* MainView.swift in Sources */,
21B2730E2BFB85E2002BCC67 /* Config.swift in Sources */,
Expand Down Expand Up @@ -354,7 +358,7 @@
INFOPLIST_FILE = LiveTimeWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = LiveTimeWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -383,7 +387,7 @@
INFOPLIST_FILE = LiveTimeWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = LiveTimeWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
Expand Down
Binary file modified MC2-Team3-Pilling/Assets.xcassets/clock.imageset/clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions MC2-Team3-Pilling/Extentsion/CustomFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ import SwiftUI

extension View {
func largeTitle() -> some View {
self.modifier(CustomFontStyle(fontType: .largeTitle, isBold: true, color: .black))
self.modifier(CustomFontStyle(fontType: .largeTitle, isBold: true, color: .black, kerning: -1))
}
func secondaryTitle() -> some View {
self.modifier(CustomFontStyle(fontType: .title2, isBold: false, color: .secondary))
self.modifier(CustomFontStyle(fontType: .title2, isBold: false, color: .secondary, kerning: -1))
}
func secondaryRegular() -> some View {
self.modifier(CustomFontStyle(fontType: .body, isBold: false, color: .secondary))
self.modifier(CustomFontStyle(fontType: .body, isBold: false, color: .secondary, kerning: -1))
}
func boldRegular() -> some View {
self.modifier(CustomFontStyle(fontType: .body, isBold: true, color: .black))
self.modifier(CustomFontStyle(fontType: .body, isBold: true, color: .black, kerning: -1))
}
func largeBold() -> some View {
self.modifier(CustomFontStyle(fontType: .title3, isBold: true, color: .black))
self.modifier(CustomFontStyle(fontType: .title2, isBold: true, color: .black, kerning: -1))
}
func regular() -> some View {
self.modifier(CustomFontStyle(fontType: .body, isBold: false, color: .black))
self.modifier(CustomFontStyle(fontType: .body, isBold: false, color: .black, kerning: -1))
}
func Icon() -> some View {
self.modifier(CustomFontStyle(fontType: .title, isBold: false, color: .secondary))
self.modifier(CustomFontStyle(fontType: .title, isBold: false, color: .secondary, kerning: -1))
}
}

struct CustomFontStyle: ViewModifier {
var fontType: Font
var isBold : Bool
var color: Color
var kerning: CGFloat

func body(content: Content) -> some View {
content
Expand Down
106 changes: 106 additions & 0 deletions MC2-Team3-Pilling/View/ChooseStatusView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//
// ChooseStatusView.swift
// MC2-Team3-Pilling
//
// Created by 이소현 on 5/21/24.
//

import SwiftUI

struct ChooseStatusView: View {
@State private var selectedNum = 0
@State private var takeMedicineTime: Date = Date()

// 부작용 섹션 vars
@State private var irrBleedingToggle = false
@State private var nauseaToggle = false
@State private var swellingToggle = false
@State var sideEffectMemo: String = ""


var body: some View {
VStack {
// 현재일 / 전체복용일수
HStack {
Text("4일차")
.largeTitle()
Text("/28")
.secondaryTitle()
}

// 약 복용 여부 확인
Picker("selection", selection: $selectedNum) {
ForEach(1..<4) { num in
Text("\(num)")
}
}
.pickerStyle(.segmented)
// selection Print 되는 값 확인
// .onChange(of: selectedNum) { newValue in
// print("Selected number: \(newValue)")
// }

// 복용시간 버튼
Button(action: {

}, label: {
ZStack{
HStack {
Image(systemName: "clock")
Text("복용 시간")
.secondaryRegular()
Spacer()

}
DatePicker("", selection: $takeMedicineTime, displayedComponents: .hourAndMinute)
}
.padding([.leading, .trailing], 20)
})
.padding(.vertical, 16)
.frame(maxWidth: .infinity)
.background(.customGray02)
.clipShape(RoundedRectangle(cornerRadius: 10))
.foregroundColor(.secondary)
.padding()

// 부작용 섹션
VStack {
Toggle("부정출혈", isOn: $irrBleedingToggle)
.padding([.leading, .trailing], 20)
Toggle("구역질", isOn: $nauseaToggle)
.padding([.leading, .trailing], 20)
Toggle("붓기", isOn: $swellingToggle)
.padding([.leading, .trailing], 20)

HStack {
Text("메모")

TextField("Enter your side effect", text: $sideEffectMemo)
.padding(5)
.background(Color(uiColor: .secondarySystemBackground))

}
.padding()
}


// footer button
Button(action: {}, label: {
Text("수정")
.font(.title3)
.bold()
})
.padding(.vertical, 30)
.frame(maxWidth: .infinity)
.background(.customGreen)
.clipShape(RoundedRectangle(cornerRadius: 20))
.foregroundColor(.black)
.padding()

}
}
}

#Preview {
ChooseStatusView()
}
10 changes: 7 additions & 3 deletions MC2-Team3-Pilling/View/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ struct ContentView: View {
NavigationLink(destination: SwiftDataTestView()){
Text("SwiftDataTestView")
}
NavigationLink(destination: SplashScreenView()){
Text("SplashScreenView")
}
NavigationLink(destination: ChooseStatusView()){
Text("ChooseStatusView")
}

}
NavigationLink(destination: SplashScreenView()){
Text("SplashScreenView")
}


Button(action: {
isTracking.toggle()
Expand Down
26 changes: 15 additions & 11 deletions MC2-Team3-Pilling/View/OnboardingFirstView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ struct OnboardingFirstView: View {
.frame(width: 240, height: 240)

// Text
VStack(alignment: .leading) {
Text("복용하고 계신 약을 알려주세요!")
.largeTitle()
.padding(.bottom, 2)

Text("설정은 추후에 변경 가능합니다.")
.secondaryRegular()
HStack {
VStack(alignment: .leading) {
Text("복용하고 계신 약을 알려주세요!")
.largeBold()
.padding(.bottom, 2)

Text("설정은 추후에 변경 가능합니다.")
.secondaryRegular()
}
Spacer()
}
.padding()


// Selecting box
Expand All @@ -30,7 +34,7 @@ struct OnboardingFirstView: View {
HStack {
Image(systemName: "pill.circle.fill")
Text("약 종류")
.secondaryTitle()
.secondaryRegular()
Spacer()
Image(systemName: "chevron.right")
}
Expand All @@ -41,7 +45,7 @@ struct OnboardingFirstView: View {
.background(.customGray02)
.clipShape(RoundedRectangle(cornerRadius: 10))
.foregroundColor(.secondary)
.padding([.leading, .trailing], 20)
.padding([.leading, .trailing], 16)
.sheet(isPresented: $showingMedicineSheet){
// MedicineSheetView(showingMedicineSheet: true)
MedicineSheetView(showingMedicineSheet: $showingMedicineSheet)
Expand All @@ -55,7 +59,7 @@ struct OnboardingFirstView: View {
HStack {
Image(systemName: "note")
Text("현재 복용 일수")
.secondaryTitle()
.secondaryRegular()
Spacer()
}
.padding([.leading, .trailing], 25)
Expand All @@ -65,7 +69,7 @@ struct OnboardingFirstView: View {
.background(.customGray02)
.clipShape(RoundedRectangle(cornerRadius: 10))
.foregroundColor(.secondary)
.padding([.leading, .trailing], 20)
.padding([.leading, .trailing], 16)

}

Expand Down
57 changes: 34 additions & 23 deletions MC2-Team3-Pilling/View/OnboardingSecondView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import SwiftUI

struct OnboardingSecondView: View {
@State var alarmTime: Date = Date()
@State var alarmToggle = false
@State private var alarmTime: Date = Date()
@State private var alarmToggle = false

var body: some View {
VStack{
Expand All @@ -18,30 +18,36 @@ struct OnboardingSecondView: View {
.frame(width: 240, height: 240)

// Text
VStack(alignment: .leading) {
// Text
Text("알람 받을 시간을 설정해주세요!")
.font(.title)
.fontWeight(.semibold)
.padding(.bottom, 2)

Text("설정은 추후에 변경 가능합니다.")
.font(.title3)
.foregroundStyle(.secondary)
HStack {
VStack(alignment: .leading) {
// Text
Text("알람 받을 시간을 설정해주세요!")
.largeBold() .padding(.bottom, 2)

Text("설정은 추후에 변경 가능합니다.")
.secondaryRegular()
}
Spacer()
}
.padding()


Button(action: {
DatePicker("", selection: $alarmTime, displayedComponents: .hourAndMinute)
}, label: {
HStack {
Image(systemName: "clock")
Text("복용 시간")
.font(.title3)
Spacer()
Text("17:00")

ZStack{
HStack {
Image(systemName: "clock")
Text("복용 시간")
.secondaryTitle()
Spacer()

}
DatePicker("", selection: $alarmTime, displayedComponents: .hourAndMinute)

}
.padding([.leading, .trailing], 25)
.padding([.leading, .trailing], 20)

})
.padding(.vertical, 20)
.frame(maxWidth: .infinity)
Expand All @@ -51,16 +57,21 @@ struct OnboardingSecondView: View {
.padding()


VStack{
VStack(alignment: .leading){
Toggle("소리 알람여부추가", isOn: $alarmToggle)
.padding([.leading, .trailing], 20)
.regular()
.padding(.bottom, 2)


HStack{

HStack {
Image(systemName: "info.circle.fill")
Text("소리를 OFF하면 라이브 액티비티로만 알려줘요!")
.font(.callout)
}
.foregroundStyle(.secondary)
}
.padding()

Spacer()

Expand Down

0 comments on commit 7f568a4

Please sign in to comment.