Skip to content

Commit

Permalink
Merge pull request #7 from touchapp/feat/unit_progress_line_improvements
Browse files Browse the repository at this point in the history
chore: added one more state and change inset what fixes dark mode
  • Loading branch information
forgotvas authored Jan 19, 2024
2 parents e77e1bc + fd16f64 commit 96e5d72
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Course/Course/Presentation/Unit/CourseUnitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public struct CourseUnitView: View {
.frame(
width: reader.size.width,
height: isHorizontal ?
(viewModel.courseUnitProgressEnabled ? 85 : 75) :
(viewModel.courseUnitProgressEnabled ? 60 : 50)
(viewModel.courseUnitProgressEnabled ? 78 : 75) :
(viewModel.courseUnitProgressEnabled ? 68 : 50)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ struct LessonLineProgressView: View {
let data = Array(vertical.childs.enumerated())
ForEach(data, id: \.offset) { index, item in
let selected = viewModel.verticals[viewModel.verticalIndex].childs[index]
if selected == viewModel.selectedLesson() {
let isSelected = selected == viewModel.selectedLesson()
let isDone = item.completion == 1.0 || vertical.completion == 1.0
if isSelected && isDone {
Theme.Colors.progressSelectedAndDone
.frame(height: 7)
} else if isSelected {
Theme.Colors.onProgress
} else if item.completion == 1.0 || vertical.completion == 1.0 {
.frame(height: 7)
} else if isDone {
Theme.Colors.progressDone
} else {
Theme.Colors.progressSkip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0xD2",
"red" : "0xF1"
"green" : "0xCC",
"red" : "0xF0"
}
},
"idiom" : "universal"
Expand All @@ -24,8 +24,8 @@
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0xD2",
"red" : "0xF1"
"green" : "0xCC",
"red" : "0xF0"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x7D",
"green" : "0xAA",
"red" : "0x34"
"blue" : "0xD7",
"green" : "0xE6",
"red" : "0xBB"
}
},
"idiom" : "universal"
Expand All @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x7D",
"green" : "0xAA",
"red" : "0x34"
"blue" : "0x71",
"green" : "0xA1",
"red" : "0x30"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x71",
"green" : "0xA1",
"red" : "0x30"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x4D",
"green" : "0x7D",
"red" : "0x0D"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
1 change: 1 addition & 0 deletions Theme/Theme/SwiftGen/ThemeAssets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public enum ThemeAssets {
public static let onProgress = ColorAsset(name: "OnProgress")
public static let progressDone = ColorAsset(name: "ProgressDone")
public static let progressSkip = ColorAsset(name: "ProgressSkip")
public static let selectedAndDone = ColorAsset(name: "SelectedAndDone")
public static let appLogo = ImageAsset(name: "appLogo")
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
Expand Down
1 change: 1 addition & 0 deletions Theme/Theme/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public struct Theme {
public private(set) static var onProgress = ThemeAssets.onProgress.swiftUIColor
public private(set) static var progressDone = ThemeAssets.progressDone.swiftUIColor
public private(set) static var progressSkip = ThemeAssets.progressSkip.swiftUIColor
public private(set) static var progressSelectedAndDone = ThemeAssets.selectedAndDone.swiftUIColor
public private(set) static var loginNavigationText = ThemeAssets.loginNavigationText.swiftUIColor

public static func update(
Expand Down

0 comments on commit 96e5d72

Please sign in to comment.