Skip to content

Commit

Permalink
[DEV][Designed Settings]
Browse files Browse the repository at this point in the history
  • Loading branch information
developersancho committed Mar 5, 2022
1 parent b78e9cf commit d0cef3a
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 11 deletions.
2 changes: 1 addition & 1 deletion SwiftRorty.iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@
E2291D6827A5EA72006D3FD8 /* detail */ = {
isa = PBXGroup;
children = (
E2B5A95C27D0237600C14287 /* DetailStatusView.swift */,
E26BD3A227D01629006CA548 /* DetailHeaderView.swift */,
E26BD3A427D01769006CA548 /* DetailContentView.swift */,
E2555C0E27A872E4007E5266 /* DetailScreen.swift */,
E26BD39E27CFFE51006CA548 /* DetailViewModel.swift */,
E2B5A95C27D0237600C14287 /* DetailStatusView.swift */,
);
path = detail;
sourceTree = "<group>";
Expand Down
20 changes: 20 additions & 0 deletions SwiftRorty.iOS/Assets.xcassets/ToggleRed.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x2F",
"green" : "0x2F",
"red" : "0xD3"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct DetailContentView: View {
}
Divider()
}
}.padding(EdgeInsets(top: 16, leading: 12, bottom: 0, trailing: 12))
}
.padding(.init(top: 16, leading: 12, bottom: 0, trailing: 12))
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions SwiftRorty.iOS/presentation/features/detail/DetailScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ struct DetailScreen: View {
var body: some View {
ZStack {
Color.Background.edgesIgnoringSafeArea(.all)
ScrollView {
LazyVStack {
DetailHeaderView(dto: viewModel.dto)
DetailContentView(contents: viewModel.details, dto: viewModel.dto)
}.padding(12)
LazyVStack {
ScrollView {
LazyVStack {
DetailHeaderView(dto: viewModel.dto)
DetailContentView(contents: viewModel.details, dto: viewModel.dto)
}.padding(12)
}
}
}
.navigationBarTitleDisplayMode(.inline)
Expand Down
41 changes: 37 additions & 4 deletions SwiftRorty.iOS/presentation/features/settings/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,45 @@
import SwiftUI

struct SettingsScreen: View {
@State private var nightMode = false

fileprivate func SettingsContentView() -> some View {
return ZStack(alignment: .topLeading) {
RoundedRectangle(cornerRadius: 8, style: .continuous)
.fill(Color.Card).shadow(radius: 1)

VStack(alignment: .leading, spacing: 12) {
HStack(alignment: .center) {
Text("Theme Mode")
.fontTemplate(AppFontTemplate.body4)
Spacer()
Toggle("", isOn: $nightMode)
.toggleStyle(SwitchToggleStyle(tint: .ToggleRed))
}
Divider()
HStack(alignment: .center) {
Text("App Version")
.fontTemplate(AppFontTemplate.body4)
Spacer()
Text("\(UIApplication.appVersion())")
.fontTemplate(AppFontTemplate.body2)
}

}.padding(12)

}.padding(12)
}

var body: some View {
NavigationView {
ZStack {
Color.Background.edgesIgnoringSafeArea(.all)
Text("Settings Screen, Version: \(UIApplication.appVersion())")
.fontTemplate(AppFontTemplate.title)
ZStack(alignment: .topLeading) {
//Color.Background.edgesIgnoringSafeArea(.bottom)
Color.Background.ignoresSafeArea()
LazyVStack(alignment: .leading) {
ScrollView {
SettingsContentView()
}
}
}
.navigationBarTitleDisplayMode(.inline)
.toolbar {
Expand Down
2 changes: 2 additions & 0 deletions SwiftRorty.iOS/theme/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extension Color {

static let Card = Color(Color.Key.card.rawValue)
static let Text = Color(Color.Key.text.rawValue)
static let ToggleRed = Color(Color.Key.toggleRed.rawValue)

enum Key: String {
case primary = "Primary"
Expand All @@ -29,5 +30,6 @@ extension Color {
case unSelectedBottomItem = "UnselectedBottomItemColor"
case card = "Card"
case text = "Text"
case toggleRed = "ToggleRed"
}
}

0 comments on commit d0cef3a

Please sign in to comment.