Skip to content

Commit

Permalink
fix: πŸ› [BCP:2170177121] InlineSignature flickering problem (SAP#449)
Browse files Browse the repository at this point in the history
βœ… Closes: BCP:2170177121

(cherry picked from commit ff32b9f)
  • Loading branch information
janhuachu committed Sep 6, 2022
1 parent c337008 commit 090e255
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions Sources/FioriSwiftUICore/Views/SignatureCaptureView+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ extension Fiori {

extension SignatureCaptureView: View {
public var body: some View {
VStack {
VStack(spacing: 0) {
HStack {
Text(_title ?? NSLocalizedString("Signature", tableName: "FioriSwiftUICore", bundle: Bundle.accessor, comment: ""))
.font(titleFont)
.foregroundColor(titleColor)
Spacer()
if isEditing {
cancelAction
.simultaneousGesture(
TapGesture()
.onEnded { _ in
clear()
isEditing = false
}
)
}
}.padding(EdgeInsets(top: 0, leading: 0, bottom: 11, trailing: 0))
cancelAction
.simultaneousGesture(
TapGesture()
.onEnded { _ in
clear()
isEditing = false
}
)
.frame(minWidth: 44, minHeight: 44)
.setHidden(!isEditing)
}
.frame(minHeight: 44)

if fullSignatureImage != nil || (_signatureImage != nil && !isReenterTapped) {
ZStack {
Expand Down Expand Up @@ -115,7 +116,7 @@ extension SignatureCaptureView: View {
}
RoundedRectangle(cornerRadius: 10)
.stroke(Color.preferredColor(.separator), lineWidth: 1)
.background(Color.preferredColor(.quarternaryFill)).cornerRadius(10)
.background(Color.preferredColor(.quaternaryFill)).cornerRadius(10)
.frame(minHeight: _drawingViewMinHeight, maxHeight: imageMaxHeight())
.padding(.zero)
}.padding(.zero)
Expand Down Expand Up @@ -144,6 +145,7 @@ extension SignatureCaptureView: View {
}
)
.disabled(drawings.isEmpty)
.frame(minWidth: 44, minHeight: 44)
Spacer()
saveAction
.simultaneousGesture(
Expand All @@ -153,7 +155,9 @@ extension SignatureCaptureView: View {
}
)
.disabled(drawings.isEmpty)
}.padding(.top, 11)
.frame(minWidth: 44, minHeight: 44)
}
.padding(.top, 8)
} else if (_signatureImage != nil && !isReenterTapped) || fullSignatureImage != nil {
restartAction
.simultaneousGesture(
Expand All @@ -165,10 +169,11 @@ extension SignatureCaptureView: View {
self.isEditing = true
}
)
.padding(.top, 11)
.frame(minWidth: 44, minHeight: 44)
.padding(.top, 8)
}
}
.padding(EdgeInsets(top: 11, leading: 16, bottom: isEditing || (_signatureImage != nil && !isReenterTapped) ? 11 : 16, trailing: 16))
.padding(EdgeInsets(top: 0, leading: 16, bottom: isEditing || (_signatureImage != nil && !isReenterTapped) ? 0 : 16, trailing: 16))
.background(VStackPreferenceSetter())
.onPreferenceChange(VStackPreferenceKey.self) { heights in
guard let height = heights.first else {
Expand Down Expand Up @@ -199,7 +204,7 @@ extension SignatureCaptureView: View {
} else {
ZStack(alignment: .bottom) {
ZStack {
Color.preferredColor(.quarternaryFill).cornerRadius(10)
Color.preferredColor(.quaternaryFill).cornerRadius(10)
startAction
.simultaneousGesture(
TapGesture()
Expand Down

0 comments on commit 090e255

Please sign in to comment.