From 6458c50a90f047a443e046875d3547662795519a Mon Sep 17 00:00:00 2001 From: Hugo Pezziardi Date: Tue, 19 Sep 2023 13:25:42 +0200 Subject: [PATCH 1/2] :lipstick: (GameEngineKit): Upgrade Colored & Text AnswerView UI style --- .../Sources/UI/Views/ColoredAnswerView.swift | 9 +++++---- .../Sources/UI/Views/TextAnswerView.swift | 13 ++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift b/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift index f01fc57dc6..9ea00bc63d 100644 --- a/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift +++ b/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift @@ -14,11 +14,12 @@ struct ColoredAnswerView: View { @ViewBuilder var view: some View { - let circle = Circle() - .foregroundColor(color) + let circle = Image(systemName: "circle.fill") + .foregroundStyle(color) + .font(.system(size: size)) .frame( - width: size, - height: size + width: size * 1.05, + height: size * 1.05 ) switch status { diff --git a/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift b/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift index 5dfeddfa0b..4a69af8760 100644 --- a/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift +++ b/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift @@ -2,6 +2,7 @@ // Copyright 2023 APF France handicap // SPDX-License-Identifier: Apache-2.0 +import DesignKit import SwiftUI struct TextAnswerView: View { @@ -15,15 +16,17 @@ struct TextAnswerView: View { @ViewBuilder var view: some View { let circle = ZStack { - Circle() - .fill(.gray.opacity(0.8)) + Image(systemName: "circle.fill") + .foregroundStyle(DesignKitAsset.Colors.lekaDarkBlue.swiftUIColor) + .font(.system(size: size)) .frame( - width: size, - height: size + width: size * 1.05, + height: size * 1.05 ) Text(text.uppercased()) - .font(.title.bold()) + .font(.largeTitle.uppercaseSmallCaps()) + .foregroundColor(.white) } switch status { From 0083f1024f4e66830adc996370eb1f7f05fc2014 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 19 Sep 2023 23:53:41 +0200 Subject: [PATCH 2/2] :technologist: (GameEngineKit): TextAnswerView - Add preview --- .../Sources/UI/Views/ColoredAnswerView.swift | 9 +++++++++ .../GameEngineKit/Sources/UI/Views/TextAnswerView.swift | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift b/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift index 9ea00bc63d..372813b0a4 100644 --- a/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift +++ b/Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift @@ -75,3 +75,12 @@ struct ColoredAnswerView: View { view } } + +struct ColoredAnswerView_Previews: + PreviewProvider +{ + static var previews: some View { + ColoredAnswerView(color: "red", size: 500, status: .playingRightAnimation) + .previewInterfaceOrientation(.landscapeLeft) + } +} diff --git a/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift b/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift index 4a69af8760..dc13afe212 100644 --- a/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift +++ b/Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift @@ -70,3 +70,12 @@ struct TextAnswerView: View { view } } + +struct TextAnswerView_Previews: + PreviewProvider +{ + static var previews: some View { + TextAnswerView(text: "Hello", size: 500, status: .playingRightAnimation) + .previewInterfaceOrientation(.landscapeLeft) + } +}