generated from element-hq/.github
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#40: Add OnboardingSplashScreen from EI.
Update SplashScreen for EXI
- Loading branch information
Showing
32 changed files
with
1,050 additions
and
104 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
ElementX/Resources/Assets.xcassets/Colors/CodeBlockBackground.colorset/Contents.json
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
ElementX/Resources/Assets.xcassets/Images/Splash Screen/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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...esources/Assets.xcassets/Images/Splash Screen/Splash Screen Page 1.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,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "OnboardingSplashScreenPage1.pdf", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "OnboardingSplashScreenPage1-Dark.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+25 KB
...s/Images/Splash Screen/Splash Screen Page 1.imageset/OnboardingSplashScreenPage1-Dark.pdf
Binary file not shown.
Binary file added
BIN
+32.4 KB
...assets/Images/Splash Screen/Splash Screen Page 1.imageset/OnboardingSplashScreenPage1.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
...esources/Assets.xcassets/Images/Splash Screen/Splash Screen Page 2.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,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "OnboardingSplashScreenPage2.pdf", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "OnboardingSplashScreenPage2-Dark.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+238 KB
...s/Images/Splash Screen/Splash Screen Page 2.imageset/OnboardingSplashScreenPage2-Dark.pdf
Binary file not shown.
Binary file added
BIN
+230 KB
...assets/Images/Splash Screen/Splash Screen Page 2.imageset/OnboardingSplashScreenPage2.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
...esources/Assets.xcassets/Images/Splash Screen/Splash Screen Page 3.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,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "OnboardingSplashScreenPage3.pdf", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "OnboardingSplashScreenPage3-Dark.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+37 KB
...s/Images/Splash Screen/Splash Screen Page 3.imageset/OnboardingSplashScreenPage3-Dark.pdf
Binary file not shown.
Binary file added
BIN
+37 KB
...assets/Images/Splash Screen/Splash Screen Page 3.imageset/OnboardingSplashScreenPage3.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
...esources/Assets.xcassets/Images/Splash Screen/Splash Screen Page 4.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,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "OnboardingSplashScreenPage4.pdf", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "OnboardingSplashScreenPage4-Dark.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+276 KB
...s/Images/Splash Screen/Splash Screen Page 4.imageset/OnboardingSplashScreenPage4-Dark.pdf
Binary file not shown.
Binary file added
BIN
+229 KB
...assets/Images/Splash Screen/Splash Screen Page 4.imageset/OnboardingSplashScreenPage4.pdf
Binary file not shown.
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
26 changes: 26 additions & 0 deletions
26
ElementX/Sources/Other/SwiftUI/Views/ViewFrameReader/FramePreferenceKey.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,26 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import SwiftUI | ||
|
||
/// A SwiftUI `PreferenceKey` for `CGRect` values such as a view's frame. | ||
struct FramePreferenceKey: PreferenceKey { | ||
static var defaultValue: CGRect = .zero | ||
|
||
static func reduce(value: inout CGRect, nextValue: () -> CGRect) { | ||
value = nextValue() | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
ElementX/Sources/Other/SwiftUI/Views/ViewFrameReader/ViewFrameReader.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,42 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
/// Used to calculate the frame of a view. | ||
/// | ||
/// Useful in situations as with `ZStack` where you might want to layout views using alignment guides. | ||
/// ``` | ||
/// @State private var frame: CGRect = CGRect.zero | ||
/// ... | ||
/// SomeView() | ||
/// .background(ViewFrameReader(frame: $frame)) | ||
/// ``` | ||
struct ViewFrameReader: View { | ||
@Binding var frame: CGRect | ||
|
||
var body: some View { | ||
GeometryReader { geometry in | ||
Color.clear | ||
.preference(key: FramePreferenceKey.self, | ||
value: geometry.frame(in: .local)) | ||
} | ||
.onPreferenceChange(FramePreferenceKey.self) { | ||
frame = $0 | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
ElementX/Sources/Screens/Onboarding/Common/OnboardingMetrics.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,39 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import SwiftUI | ||
|
||
/// Metrics used across the entire onboarding flow. | ||
struct OnboardingMetrics { | ||
static let maxContentWidth: CGFloat = 600 | ||
static let maxContentHeight: CGFloat = 750 | ||
|
||
/// The padding used between the top of the main content and the navigation bar. | ||
static let topPaddingToNavigationBar: CGFloat = 16 | ||
/// The padding used between the footer and the bottom of the view. | ||
static let actionButtonBottomPadding: CGFloat = 24 | ||
/// The width/height used for the main icon shown in most of the screens. | ||
static let iconSize: CGFloat = 90 | ||
|
||
/// The padding used to the top of the view for breaker screens that don't have a navigation bar. | ||
static let breakerScreenTopPadding: CGFloat = 80 | ||
static let breakerScreenIconBottomPadding: CGFloat = 42 | ||
|
||
/// The height to use for top/bottom spacers to pad the views to fit the `maxContentHeight`. | ||
static func spacerHeight(in geometry: GeometryProxy) -> CGFloat { | ||
max(0, (geometry.size.height - maxContentHeight) / 2) | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
ElementX/Sources/Screens/Onboarding/Common/String-Tinting.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,29 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension String { | ||
func tinting(_ character: Character, color: Color = .accentColor) -> AttributedString { | ||
var string = AttributedString(self) | ||
let characterView = string.characters | ||
for index in characterView.indices where characterView[index] == character { | ||
string[index..<characterView.index(after: index)].foregroundColor = color | ||
} | ||
|
||
return string | ||
} | ||
} |
Oops, something went wrong.