From d540b7a298b7a383f786f6c5909be42680f50ac2 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 14 Feb 2025 08:47:48 +0100 Subject: [PATCH 1/3] fix: Ensure CustomProgressBar has a minimum width --- .../Components/CustomProgressBar.swift | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Sources/MyKSuite/Sources/Components/CustomProgressBar.swift b/Sources/MyKSuite/Sources/Components/CustomProgressBar.swift index d4b7bcc..6c50d2b 100644 --- a/Sources/MyKSuite/Sources/Components/CustomProgressBar.swift +++ b/Sources/MyKSuite/Sources/Components/CustomProgressBar.swift @@ -19,23 +19,41 @@ import SwiftUI struct CustomProgressBar: ProgressViewStyle { + let barHeight: CGFloat = 14 + func makeBody(configuration: Configuration) -> some View { ZStack(alignment: .leading) { - RoundedRectangle(cornerRadius: 10) - .frame(height: 14) + RoundedRectangle(cornerRadius: barHeight / 2) + .frame(height: barHeight) .foregroundStyle(ColorHelper.reversedPrimary) .overlay { GeometryReader { geometry in - RoundedRectangle(cornerRadius: 10) - .frame(width: geometry.size.width * CGFloat(configuration.fractionCompleted ?? 0.0), height: 14) + RoundedRectangle(cornerRadius: barHeight / 2) + .frame( + width: filledProgressBarWidth( + progressBarWidth: geometry.size.width, + fractionCompleted: configuration.fractionCompleted ?? 0 + ), + height: barHeight + ) } } } } + + func filledProgressBarWidth(progressBarWidth: CGFloat, fractionCompleted: CGFloat) -> CGFloat { + max(barHeight, progressBarWidth * CGFloat(fractionCompleted)) + } } #Preview { - ProgressView(value: 2.3, total: 15) - .progressViewStyle(CustomProgressBar()) - .foregroundStyle(.blue) + VStack { + ProgressView(value: 2.3, total: 15) + .progressViewStyle(CustomProgressBar()) + .foregroundStyle(.blue) + ProgressView(value: 1, total: 1000) + .progressViewStyle(CustomProgressBar()) + .foregroundStyle(.blue) + } + .padding() } From ee5e50502fc225293aec7a9e4331ec55c465712f Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 14 Feb 2025 09:19:02 +0100 Subject: [PATCH 2/3] fix: Correct tint for chevron --- .../MyKSuite/Sources/Dashboard/SubscriptionFreeDetailsView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/MyKSuite/Sources/Dashboard/SubscriptionFreeDetailsView.swift b/Sources/MyKSuite/Sources/Dashboard/SubscriptionFreeDetailsView.swift index 9ef6052..c64179a 100644 --- a/Sources/MyKSuite/Sources/Dashboard/SubscriptionFreeDetailsView.swift +++ b/Sources/MyKSuite/Sources/Dashboard/SubscriptionFreeDetailsView.swift @@ -60,6 +60,7 @@ struct SubscriptionFreeDetailsView: View { } .padding(.vertical, value: .mini) } + .tint(ColorHelper.secondary) } .font(FontHelper.body) .foregroundStyle(ColorHelper.primary) From d2935f50d4a77f5c1cd406b634ffc62479feb0df Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 14 Feb 2025 09:28:35 +0100 Subject: [PATCH 3/3] fix(MyKSuiteView): Centered button + Full size background --- Sources/MyKSuite/Sources/MyKSuiteView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/MyKSuite/Sources/MyKSuiteView.swift b/Sources/MyKSuite/Sources/MyKSuiteView.swift index ccbc231..b665afa 100644 --- a/Sources/MyKSuite/Sources/MyKSuiteView.swift +++ b/Sources/MyKSuite/Sources/MyKSuiteView.swift @@ -34,6 +34,7 @@ public struct MyKSuiteView: View { MyKSuiteResources.Assets.gradient.swiftUIImage .resizable() .scaledToFit() + .ignoresSafeArea() VStack(alignment: .leading, spacing: IKPadding.huge) { VStack(alignment: .leading, spacing: IKPadding.medium) { @@ -66,6 +67,7 @@ public struct MyKSuiteView: View { .ikButtonFullWidth(true) .controlSize(.large) .buttonStyle(.ikBorderedProminent) + .frame(maxWidth: .infinity, alignment: .center) } .padding(.horizontal, value: .large) .font(FontHelper.body)