Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Binary file added .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions ManageDose.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
7EBEDBBF2C02FA6000DC4035 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBB92C02FA6000DC4035 /* Button.swift */; };
7EBEDBC32C02FA7200DC4035 /* BudgetingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */; };
7EBEDBC42C02FA7200DC4035 /* DetailBudget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC12C02FA7100DC4035 /* DetailBudget.swift */; };
7EBEDBC52C02FA7200DC4035 /* IncomeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */; };
7EBEDBC52C02FA7200DC4035 /* IncomeDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */; };
7EBEDBC92C02FB2E00DC4035 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC82C02FB2E00DC4035 /* Preview Assets.xcassets */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -61,7 +61,7 @@
7EBEDBB92C02FA6000DC4035 /* Button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Button.swift; path = ManageDose/Components/Button.swift; sourceTree = SOURCE_ROOT; };
7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BudgetingView.swift; sourceTree = "<group>"; };
7EBEDBC12C02FA7100DC4035 /* DetailBudget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailBudget.swift; sourceTree = "<group>"; };
7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IncomeDetail.swift; sourceTree = "<group>"; };
7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IncomeDetailView.swift; sourceTree = "<group>"; };
7EBEDBC82C02FB2E00DC4035 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -128,7 +128,6 @@
7E9506CD2BFB3E7E00BDF341 /* Components */ = {
isa = PBXGroup;
children = (
7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */,
7EBEDBB42C02FA6000DC4035 /* AddButton.swift */,
7EBEDBB72C02FA6000DC4035 /* BudgetProgressCard.swift */,
7EBEDBB92C02FA6000DC4035 /* Button.swift */,
Expand All @@ -151,6 +150,7 @@
7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */,
7E9506C92BFB35C200BDF341 /* TransactionHistoryView.swift */,
7E71FC382BFAEC2500F58890 /* HomeView.swift */,
7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */,
3F76959B2C0037EF00FEE52D /* AddNewExpenseView.swift */,
);
path = Views;
Expand Down Expand Up @@ -262,7 +262,7 @@
7EB947E42BFB59EB00A7C723 /* TransactionHistoryViewModel.swift in Sources */,
7EBEDBBC2C02FA6000DC4035 /* IncomeCard.swift in Sources */,
3F76959C2C0037EF00FEE52D /* AddNewExpenseView.swift in Sources */,
7EBEDBC52C02FA7200DC4035 /* IncomeDetail.swift in Sources */,
7EBEDBC52C02FA7200DC4035 /* IncomeDetailView.swift in Sources */,
7E9506CA2BFB35C200BDF341 /* TransactionHistoryView.swift in Sources */,
7E0EDBB42BF6F66E00C384B8 /* ManageDoseApp.swift in Sources */,
3F7695982C00238600FEE52D /* AddNewExpenseCard.swift in Sources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "996542E3-E327-4440-8F6C-2FF44878134E"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "68477073-EB47-4DCB-8C3C-75926996A721"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ManageDose/Components/BudgetProgressCard.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "118"
endingLineNumber = "118"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>ManageDose.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Binary file modified ManageDose/.DS_Store
Binary file not shown.
Binary file modified ManageDose/Assets.xcassets/.DS_Store
Binary file not shown.
13 changes: 7 additions & 6 deletions ManageDose/Components/BudgetProgressCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct TopCornersRoundedShape: Shape {

struct BudgetProgressCard: View {
let progressPercentage: Double = 0.7
let colorAlert: String
let colorAlert: Color
var body: some View {
ZStack(alignment: .topLeading){
//logo and progress
Expand Down Expand Up @@ -75,10 +75,11 @@ struct BudgetProgressCard: View {
ZStack(alignment: .leading){
Capsule()
.frame(width: UIScreen.main.bounds.width-80)
.foregroundColor(Color("#E2E2E2"))
.foregroundColor(Color(red: 226 / 255, green: 226 / 255, blue: 226 / 255, opacity: 1))
Capsule()
.frame(width: CGFloat(progressPercentage) * (UIScreen.main.bounds.width - 80))
.foregroundColor(Color("#1FCA9D"))
.foregroundColor(Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))

}
.frame(height: 6)
.padding(.top, 8)
Expand All @@ -102,7 +103,7 @@ struct BudgetProgressCard: View {
.frame(height: 110)
.padding(15)
.padding(.top, 45)
.background(Color("#F6F6F6"))
.background(Color(red: 246 / 255, green: 246 / 255, blue: 246 / 255, opacity: 1))
.cornerRadius(10)

//reminder
Expand All @@ -119,13 +120,13 @@ struct BudgetProgressCard: View {
}
.frame(maxWidth: 400, alignment: .leading)
.padding(15)
.background(Color("\(colorAlert)"))
.background(colorAlert)
.clipShape(TopCornersRoundedShape(radius: 10))
}

}
}

#Preview {
BudgetProgressCard(colorAlert: "#E93700")
BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))
}
18 changes: 0 additions & 18 deletions ManageDose/Components/IncomeDetail.swift

This file was deleted.

26 changes: 20 additions & 6 deletions ManageDose/Extension/ColorExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@

import SwiftUI

struct ColorExtension: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
extension Color {
init(hex: String) {
let scanner = Scanner(string: hex)
scanner.currentIndex = hex.startIndex

var rgbValue: UInt64 = 0
scanner.scanHexInt64(&rgbValue)

let r = (rgbValue & 0xff0000) >> 16
let g = (rgbValue & 0x00ff00) >> 8
let b = rgbValue & 0x0000ff

self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: 1
)
}
}

#Preview {
ColorExtension()
}

6 changes: 3 additions & 3 deletions ManageDose/Views/BudgetingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ struct BudgetingView: View {
}
.padding(EdgeInsets(top: 5, leading: 15, bottom: 0, trailing: 20))
NavigationLink(destination: DetailBudget()) {
BudgetProgressCard(colorAlert: "#1FCA9D")
BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))
}
BudgetProgressCard(colorAlert: "#5339EE")
BudgetProgressCard(colorAlert: "#E93700")
BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))
BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))
}
.padding(.horizontal)
}
Expand Down
2 changes: 1 addition & 1 deletion ManageDose/Views/DetailBudget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
struct DetailBudget: View {
var body: some View {
VStack{
BudgetProgressCard(colorAlert: "#1FCA9D")
BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1))
.padding(.top, 10)
Rectangle()
.fill(Color(red: 220/255, green: 213/255, blue: 255/255, opacity: 1))
Expand Down
88 changes: 88 additions & 0 deletions ManageDose/Views/IncomeDetailView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// IncomeDetail.swift
// ManageDose
//
// Created by MacBook Pro on 26/05/24.
//

import SwiftUI

struct IncomeDetailView: View {
var body: some View {
VStack{
VStack(alignment: .leading){
Text("Insert Insertion Source")
.font(.title3)
.fontWeight(.semibold)
Text("Enter Your Income in one month")
.font(.system(size: 14))
.fontWeight(.semibold)
.foregroundStyle(.gray)
}
.padding(.horizontal, 15)
.frame(maxWidth: .infinity, alignment: .leading)
Rectangle()
.fill(Color(red: 220/255, green: 213/255, blue: 255/255, opacity: 1))
.frame(width:400, height: 10)
.offset(y: 8)
ScrollView(.vertical, showsIndicators: false){
LazyVStack(){
ExpenseCard()
ExpenseCard()
ExpenseCard()
ExpenseCard()
ExpenseCard()
ExpenseCard()
ExpenseCard()
ExpenseCard()

}

}
.overlay(
HStack{
Spacer()
ZStack {
Circle()
.fill(Color(red: 83/255, green: 57/255, blue: 238/255, opacity: 1))
.frame(width: 60, height: 60)
Image(systemName: "plus")
.font(.title)
.foregroundColor(.white)
}
}
.offset(x: -10, y: 230)
)

Divider()
.background(Color.gray)
.frame(width:400)
.offset(y: -8)


HStack{
Text("Total Income")
.font(.system(size: 18))
.fontWeight(.regular)
.foregroundStyle(.gray)

Spacer()
Text("Rp. 23.112.999")
.font(.title3)
.fontWeight(.semibold)
}
.padding(.top, 0)
CustomButton()
}
.padding(.horizontal, 15)
.navigationBarTitle(Text("Detail Budget")
.font(.title3)
.fontWeight(.semibold)
, displayMode: .inline)

}
}

#Preview {
IncomeDetailView()
}