Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator and Tex…
…tInputInfoView (#639) * feat: 🎸 [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator feat: [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator and TextInputInfoView ✅ Closes: HCPSDKFIORIUIKIT-2458 * feat: 🎸 [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator and TextInputInfoView ✅ Closes: HCPSDKFIORIUIKIT-2458 * feat: 🎸 [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator [JIRA:HCPSDKFIORIUIKIT-2458]Linear Progress Indicator and TextInputInfoView ✅ Closes: HCPSDKFIORIUIKIT-2458 --------- Co-authored-by: I824136 <xiaoqing.he@sap.com>
- Loading branch information
1 parent
96b6220
commit a6c77ea
Showing
24 changed files
with
1,390 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Apps/Examples/Examples/FioriSwiftUICore/FormCells/TextInputInfoViewExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import FioriSwiftUICore | ||
import SwiftUI | ||
|
||
struct TextInputInfoViewExample: View { | ||
var body: some View { | ||
VStack(alignment: .leading) { | ||
Text("Default Fiori style, no icon") | ||
.textInputInfoView(description: AttributedString("test message"), counter: AttributedString("10/100")) | ||
|
||
Text("Error style") | ||
.textInputInfoView(description: AttributedString("test message, long messag long message long message long message long message long message long message long message"), counter: AttributedString("12/10")) | ||
.textInputInfoViewStyle(.error) | ||
|
||
Text("Warning style") | ||
.textInputInfoView(description: AttributedString("test message, long messag long message long message long message long message long message long message long message"), counter: AttributedString("10/10")) | ||
.textInputInfoViewStyle(.warning) | ||
|
||
Text("Informational style") | ||
.textInputInfoView(description: AttributedString("test message"), counter: AttributedString("0/10")) | ||
.textInputInfoViewStyle(.informational) | ||
|
||
Text("Success style") | ||
.textInputInfoView(description: AttributedString("test message"), counter: AttributedString("10/100")) | ||
.textInputInfoViewStyle(.success) | ||
|
||
Text("Customized icon") | ||
.textInputInfoView(icon: Image(systemName: "heart"), description: AttributedString("test message, long messag long message long message long message long message long message long message long message"), counter: AttributedString("10/100")) | ||
|
||
Text("Customized font and color") | ||
.textInputInfoView(icon: Image(systemName: "diamond"), description: AttributedString("test message"), counter: AttributedString("10/100")) | ||
.iconStyle(content: { iconConfiguration in | ||
iconConfiguration.icon | ||
.foregroundStyle(Color.preferredColor(.tintColor)) | ||
}) | ||
.descriptionStyle(content: { descriptionConfiguration in | ||
descriptionConfiguration.description | ||
.foregroundStyle(Color.preferredColor(.criticalLabel)) | ||
.font(.fiori(forTextStyle: .title2)) | ||
}) | ||
.counterStyle(content: { counterConfiguration in | ||
counterConfiguration.counter | ||
.foregroundStyle(Color.preferredColor(.criticalLabel)) | ||
.font(.fiori(forTextStyle: .title2)) | ||
}) | ||
|
||
Spacer() | ||
} | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
Apps/Examples/Examples/FioriSwiftUICore/Indicator/LinearProgressIndicatorExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import FioriSwiftUICore | ||
import SwiftUI | ||
|
||
struct LinearProgressIndicatorExample: View { | ||
@State var progress1: Double = 0.3 | ||
@State var progress2: Double = 0.1 | ||
@State var progress3: Double = 0.0 | ||
@State var progress4: Double = 1.0 | ||
|
||
var body: some View { | ||
VStack { | ||
Text("Determinate without Label") | ||
LinearProgressIndicator(indicatorProgress: $progress1) | ||
.linearProgressIndicatorStyle(.determinate) | ||
.padding(.bottom, 20) | ||
|
||
Text("Determinate with Label") | ||
LinearProgressIndicatorView(indicatorProgress: $progress2, icon: Image(systemName: "heart"), description: AttributedString("Loading...")) | ||
.linearProgressIndicatorStyle(.determinate) | ||
.padding(.bottom, 20) | ||
|
||
FioriButton( | ||
action: { _ in | ||
if progress2 > 0.9 { | ||
progress2 = 0 | ||
} else { | ||
progress2 += 0.1 | ||
} | ||
}, | ||
label: { _ in | ||
Text("Increment Progress") | ||
} | ||
) | ||
.disabled(false) | ||
.fioriButtonStyle(FioriPrimaryButtonStyle().eraseToAnyFioriButtonStyle()) | ||
.padding(.bottom, 20) | ||
|
||
Text("Error style") | ||
LinearProgressIndicatorView(indicatorProgress: $progress4, description: AttributedString("Loading...")) | ||
.linearProgressIndicatorViewStyle(.error) | ||
.padding(.bottom, 20) | ||
|
||
Text("Success style") | ||
LinearProgressIndicatorView(indicatorProgress: $progress4, description: AttributedString("Loading complete successfully. Please see the user registration view for more detail information.")) | ||
.linearProgressIndicatorViewStyle(.success) | ||
.padding(.bottom, 20) | ||
|
||
Text("Indeterminate without Label") | ||
LinearProgressIndicator(indicatorProgress: $progress3) | ||
.linearProgressIndicatorStyle(.indeterminate) | ||
.padding(.bottom, 20) | ||
|
||
Text("Indeterminate with Label") | ||
LinearProgressIndicatorView(indicatorProgress: $progress3, icon: Image(systemName: "heart"), description: AttributedString("Loading...")) | ||
.linearProgressIndicatorStyle(.indeterminate) | ||
.padding(.bottom, 20) | ||
|
||
Text("Indeterminate customized") | ||
LinearProgressIndicatorView(indicatorProgress: $progress3, icon: Image(systemName: "clock"), description: AttributedString("Downloading...")) | ||
.iconStyle { iconConfiguration in | ||
iconConfiguration.icon | ||
.font(.fiori(forTextStyle: .headline)).bold() | ||
.foregroundColor(.green) | ||
} | ||
.descriptionStyle { descriptionConfiguration in | ||
descriptionConfiguration.description | ||
.font(.fiori(forTextStyle: .headline)) | ||
.foregroundColor(.green) | ||
} | ||
.linearProgressIndicatorStyle(.indeterminate) | ||
.padding(.bottom, 20) | ||
} | ||
.padding() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.