-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task/adopt stepperview styling (#68)
* Implementation of rounded lines and life cycle status for each of the steps * Swift lint configuraation for implicit getter and empty enum arguments * Added Lifecycle tab and corrected comments * Added more examples for life style * Updated jazzy documentation for 1.6.0 * Pictorial representation of lien customizations and life cycle events * Updates to jazzy docs Co-authored-by: Badarinath Venkatnarayansetty <[email protected]>
- Loading branch information
1 parent
a60fde9
commit bee85d4
Showing
144 changed files
with
3,221 additions
and
719 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Example/Pods/Target Support Files/StepperView-iOS/StepperView-iOS-Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Example/Pods/Target Support Files/StepperView-watchOS/StepperView-watchOS-Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,115 @@ | ||
// | ||
// ExampleView11.swift | ||
// StepperView_Example | ||
// | ||
// Created by Venkatnarayansetty, Badarinath on 4/3/21. | ||
// Copyright © 2021 CocoaPods. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import UIKit | ||
import StepperView | ||
|
||
let customGreen = UIColor(red: 0.00, green: 0.80, blue: 0.66, alpha: 1.00) | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
struct ExampleView11: View { | ||
let cells = [ CustomStepTextView(text: "Basic Details"), | ||
CustomStepTextView(text: "Company Details"), | ||
CustomStepTextView(text: "Subscription plan"), | ||
CustomStepTextView(text: "Payment details") | ||
] | ||
|
||
//Custom Indicators to point. | ||
let indicators = [ | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()), | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()), | ||
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView()), | ||
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView()) | ||
] | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 10) { | ||
StepperView() | ||
.addSteps([ | ||
CustomStepTextView(text: "Announced"), | ||
CustomStepTextView(text: "Dividend Payment") | ||
]) | ||
.indicators([ | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed")), | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed")) | ||
]) | ||
.lineOptions(StepperLineOptions.custom(4, Color(customGreen))) | ||
.stepLifeCycles([StepLifeCycle.completed, .completed ]) | ||
.spacing(50) | ||
|
||
Divider() | ||
|
||
StepperView() | ||
.addSteps(cells) | ||
.indicators(indicators) | ||
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen))) | ||
.stepLifeCycles([StepLifeCycle.completed, .completed, .pending, .pending]) | ||
.spacing(40) | ||
.padding(.leading, 50) | ||
|
||
Divider() | ||
|
||
StepperView() | ||
.addSteps([ | ||
CustomStepTextView(text: "Card details"), | ||
CustomStepTextView(text: "Application review"), | ||
CustomStepTextView(text: "Authenticate OTP"), | ||
CustomStepTextView(text: "Create password") | ||
]) | ||
.indicators([ | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed")), | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed")), | ||
StepperIndicationType.custom(IndicatorImageView(name: "completed")), | ||
StepperIndicationType.custom(IndicatorImageView(name:"pending")) | ||
]) | ||
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen))) | ||
.stepLifeCycles([StepLifeCycle.completed, .completed, .completed, .pending]) | ||
.spacing(40) | ||
.padding(.leading, 50) | ||
|
||
Spacer() | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
struct IndicatorImageView: View { | ||
var name:String | ||
var body: some View { | ||
ZStack { | ||
Circle() | ||
.foregroundColor(Color.white) | ||
.overlay(Image(name) | ||
.resizable() | ||
.frame(width: 30, height: 30)) | ||
.frame(width: 40, height: 40) | ||
} | ||
|
||
} | ||
} | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
struct CustomStepTextView: View { | ||
var text:String | ||
var body: some View { | ||
VStack { | ||
TextView(text: text, font: Font.system(size: 16, weight: Font.Weight.regular)) | ||
.foregroundColor(Color.black) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.offset(x: -15) | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
struct ExampleView11_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ExampleView11() | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Example/StepperView/Images.xcassets/completed.imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "tick.svg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
Example/StepperView/Images.xcassets/completed.imageset/tick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Example/StepperView/Images.xcassets/inprogress.imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "completed.svg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Example/StepperView/Images.xcassets/inprogress.imageset/completed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Example/StepperView/Images.xcassets/pending.imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "placeholderCircle.svg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Example/StepperView/Images.xcassets/pending.imageset/placeholderCircle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.