Skip to content

Commit b8181b8

Browse files
authored
Merge pull request mastodon#323 from mastodon/feature/v2-onboarding
Implement v2 Onboarding scene
2 parents b3ec9ee + 0d96fd9 commit b8181b8

File tree

148 files changed

+3515
-5700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3515
-5700
lines changed

.github/scripts/build.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set -eo pipefail
77

88
xcodebuild -workspace Mastodon.xcworkspace \
99
-scheme Mastodon \
10-
-disableAutomaticPackageResolution \
1110
-destination "platform=iOS Simulator,name=iPhone SE (2nd generation)" \
1211
clean \
13-
build | xcpretty
12+
build | xcpretty

AppShared/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.2.0</string>
18+
<string>1.3.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>88</string>
20+
<string>90</string>
2121
</dict>
2222
</plist>

CoreDataStack/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.2.0</string>
18+
<string>1.3.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>88</string>
20+
<string>90</string>
2121
</dict>
2222
</plist>

CoreDataStackTests/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.2.0</string>
18+
<string>1.3.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>88</string>
20+
<string>90</string>
2121
</dict>
2222
</plist>

Localization/app.json

+18-8
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,14 @@
193193
},
194194
"scene": {
195195
"welcome": {
196-
"slogan": "Social networking\nback in your hands."
196+
"slogan": "Social networking\nback in your hands.",
197+
"get_started": "Get Started",
198+
"log_in": "Log In"
197199
},
198200
"server_picker": {
199-
"title": "Pick a server,\nany server.",
201+
"title": "Mastodon is made of users in different communities.",
202+
"subtitle": "Pick a community based on your interests, region, or a general purpose one.",
203+
"subtitle_extend": "Pick a community based on your interests, region, or a general purpose one. Each community is operated by an entirely independent organization or individual.",
200204
"button": {
201205
"category": {
202206
"all": "All",
@@ -223,7 +227,7 @@
223227
"category": "CATEGORY"
224228
},
225229
"input": {
226-
"placeholder": "Find a server or join your own..."
230+
"placeholder": "Search communities"
227231
},
228232
"empty_state": {
229233
"finding_servers": "Finding available servers...",
@@ -232,7 +236,7 @@
232236
}
233237
},
234238
"register": {
235-
"title": "Tell us about you.",
239+
"title": "Let’s get you set up on %s",
236240
"input": {
237241
"avatar": {
238242
"delete": "Delete"
@@ -249,6 +253,12 @@
249253
},
250254
"password": {
251255
"placeholder": "password",
256+
"require": "Your password needs at least:",
257+
"character_limit": "8 characters",
258+
"accessibility": {
259+
"checked": "checked",
260+
"unchecked": "unchecked"
261+
},
252262
"hint": "Your password needs at least eight characters"
253263
},
254264
"invite": {
@@ -286,7 +296,7 @@
286296
},
287297
"server_rules": {
288298
"title": "Some ground rules.",
289-
"subtitle": "These rules are set by the admins of %s.",
299+
"subtitle": "These are set and enforced by the %s moderators.",
290300
"prompt": "By continuing, you’re subject to the terms of service and privacy policy for %s.",
291301
"terms_of_service": "terms of service",
292302
"privacy_policy": "privacy policy",
@@ -296,10 +306,10 @@
296306
},
297307
"confirm_email": {
298308
"title": "One last thing.",
299-
"subtitle": "We just sent an email to %s,\ntap the link to confirm your account.",
309+
"subtitle": "Tap the link we emailed to you to verify your account.",
300310
"button": {
301311
"open_email_app": "Open Email App",
302-
"dont_receive_email": "I never got an email"
312+
"resend": "Resend"
303313
},
304314
"dont_receive_email": {
305315
"title": "Check your email",
@@ -554,4 +564,4 @@
554564
"accessibility_hint": "Double tap to dismiss this wizard"
555565
}
556566
}
557-
}
567+
}

Mastodon.xcodeproj/project.pbxproj

+199-781
Large diffs are not rendered by default.

Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
<key>AppShared.xcscheme_^#shared#^_</key>
88
<dict>
99
<key>orderHint</key>
10-
<integer>44</integer>
10+
<integer>26</integer>
1111
</dict>
1212
<key>CoreDataStack.xcscheme_^#shared#^_</key>
1313
<dict>
1414
<key>orderHint</key>
15-
<integer>45</integer>
15+
<integer>27</integer>
1616
</dict>
1717
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
1818
<dict>
1919
<key>orderHint</key>
20-
<integer>4</integer>
20+
<integer>2</integer>
2121
</dict>
2222
<key>Mastodon - RTL.xcscheme_^#shared#^_</key>
2323
<dict>
@@ -27,7 +27,7 @@
2727
<key>Mastodon - Release.xcscheme_^#shared#^_</key>
2828
<dict>
2929
<key>orderHint</key>
30-
<integer>3</integer>
30+
<integer>1</integer>
3131
</dict>
3232
<key>Mastodon - ar.xcscheme_^#shared#^_</key>
3333
<dict>
@@ -102,7 +102,7 @@
102102
<key>MastodonIntent.xcscheme_^#shared#^_</key>
103103
<dict>
104104
<key>orderHint</key>
105-
<integer>43</integer>
105+
<integer>25</integer>
106106
</dict>
107107
<key>MastodonIntents.xcscheme_^#shared#^_</key>
108108
<dict>
@@ -117,12 +117,12 @@
117117
<key>NotificationService.xcscheme_^#shared#^_</key>
118118
<dict>
119119
<key>orderHint</key>
120-
<integer>7</integer>
120+
<integer>3</integer>
121121
</dict>
122122
<key>ShareActionExtension.xcscheme_^#shared#^_</key>
123123
<dict>
124124
<key>orderHint</key>
125-
<integer>42</integer>
125+
<integer>24</integer>
126126
</dict>
127127
</dict>
128128
<key>SuppressBuildableAutocreation</key>

Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
77
"state": {
88
"branch": null,
9-
"revision": "d120af1e8638c7da36c8481fd61a66c0c08dc4fc",
10-
"version": "5.4.4"
9+
"revision": "f82c23a8a7ef8dc1a49a8bfc6a96883e79121864",
10+
"version": "5.5.0"
1111
}
1212
},
1313
{
@@ -141,8 +141,8 @@
141141
"repositoryURL": "https://github.com/SDWebImage/SDWebImage.git",
142142
"state": {
143143
"branch": null,
144-
"revision": "a72df4849408da7e5d3c1b586797b7c601c41d1b",
145-
"version": "5.12.1"
144+
"revision": "0fff0d7505b5306348263ea64fcc561253bbeb21",
145+
"version": "5.12.2"
146146
}
147147
},
148148
{

Mastodon/Coordinator/SceneCoordinator.swift

+2-12
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,6 @@ extension SceneCoordinator {
157157
case mastodonConfirmEmail(viewModel: MastodonConfirmEmailViewModel)
158158
case mastodonResendEmail(viewModel: MastodonResendEmailViewModel)
159159
case mastodonWebView(viewModel:WebViewModel)
160-
161-
#if ASDK
162-
// ASDK
163-
case asyncHome
164-
#endif
165160

166161
// search
167162
case searchDetail(viewModel: SearchDetailViewModel)
@@ -260,7 +255,7 @@ extension SceneCoordinator {
260255
DispatchQueue.main.async {
261256
self.present(
262257
scene: .welcome,
263-
from: nil,
258+
from: self.sceneDelegate.window?.rootViewController,
264259
transition: .modal(animated: animated, completion: nil)
265260
)
266261
}
@@ -311,7 +306,7 @@ extension SceneCoordinator {
311306
case .modal(let animated, let completion):
312307
let modalNavigationController: UINavigationController = {
313308
if scene.isOnboarding {
314-
return AdaptiveStatusBarStyleNavigationController(rootViewController: viewController)
309+
return OnboardingNavigationController(rootViewController: viewController)
315310
} else {
316311
return UINavigationController(rootViewController: viewController)
317312
}
@@ -412,11 +407,6 @@ private extension SceneCoordinator {
412407
let _viewController = WebViewController()
413408
_viewController.viewModel = viewModel
414409
viewController = _viewController
415-
#if ASDK
416-
case .asyncHome:
417-
let _viewController = AsyncHomeTimelineViewController()
418-
viewController = _viewController
419-
#endif
420410
case .searchDetail(let viewModel):
421411
let _viewController = SearchDetailViewController()
422412
_viewController.viewModel = viewModel
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
//
2+
// PickServerCategoriesCell.swift
3+
// Mastodon
4+
//
5+
// Created by BradGao on 2021/2/23.
6+
//
7+
8+
//import os.log
9+
//import UIKit
10+
//import MastodonSDK
11+
//
12+
//protocol PickServerCategoriesCellDelegate: AnyObject {
13+
// func pickServerCategoriesCell(_ cell: PickServerCategoriesCell, collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
14+
//}
15+
//
16+
//final class PickServerCategoriesCell: UITableViewCell {
17+
//
18+
// weak var delegate: PickServerCategoriesCellDelegate?
19+
//
20+
// var diffableDataSource: UICollectionViewDiffableDataSource<CategoryPickerSection, CategoryPickerItem>?
21+
//
22+
// let metricView = UIView()
23+
//
24+
// let collectionView: UICollectionView = {
25+
// let flowLayout = UICollectionViewFlowLayout()
26+
// flowLayout.scrollDirection = .horizontal
27+
// let view = ControlContainableCollectionView(frame: .zero, collectionViewLayout: flowLayout)
28+
// view.register(PickServerCategoryCollectionViewCell.self, forCellWithReuseIdentifier: String(describing: PickServerCategoryCollectionViewCell.self))
29+
// view.backgroundColor = .clear
30+
// view.showsHorizontalScrollIndicator = false
31+
// view.showsVerticalScrollIndicator = false
32+
// view.layer.masksToBounds = false
33+
// view.translatesAutoresizingMaskIntoConstraints = false
34+
// return view
35+
// }()
36+
//
37+
// override func prepareForReuse() {
38+
// super.prepareForReuse()
39+
//
40+
// delegate = nil
41+
// }
42+
//
43+
// override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
44+
// super.init(style: style, reuseIdentifier: reuseIdentifier)
45+
// _init()
46+
// }
47+
//
48+
// required init?(coder: NSCoder) {
49+
// super.init(coder: coder)
50+
// _init()
51+
// }
52+
//}
53+
//
54+
//extension PickServerCategoriesCell {
55+
//
56+
// private func _init() {
57+
// selectionStyle = .none
58+
// backgroundColor = Asset.Theme.Mastodon.systemGroupedBackground.color
59+
// configureMargin()
60+
//
61+
// metricView.translatesAutoresizingMaskIntoConstraints = false
62+
// contentView.addSubview(metricView)
63+
// NSLayoutConstraint.activate([
64+
// metricView.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),
65+
// metricView.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),
66+
// metricView.topAnchor.constraint(equalTo: contentView.topAnchor),
67+
// metricView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
68+
// metricView.heightAnchor.constraint(equalToConstant: 80).priority(.defaultHigh),
69+
// ])
70+
//
71+
// contentView.addSubview(collectionView)
72+
// NSLayoutConstraint.activate([
73+
// collectionView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
74+
// collectionView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
75+
// collectionView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10),
76+
// contentView.bottomAnchor.constraint(equalTo: collectionView.bottomAnchor, constant: 20),
77+
// collectionView.heightAnchor.constraint(equalToConstant: 80).priority(.defaultHigh),
78+
// ])
79+
//
80+
// collectionView.delegate = self
81+
// }
82+
//
83+
// override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
84+
// super.traitCollectionDidChange(previousTraitCollection)
85+
//
86+
// configureMargin()
87+
// }
88+
//
89+
// override func layoutSubviews() {
90+
// super.layoutSubviews()
91+
//
92+
// collectionView.collectionViewLayout.invalidateLayout()
93+
// }
94+
//
95+
//}
96+
//
97+
//extension PickServerCategoriesCell {
98+
// private func configureMargin() {
99+
// switch traitCollection.horizontalSizeClass {
100+
// case .regular:
101+
// let margin = MastodonPickServerViewController.viewEdgeMargin
102+
// contentView.layoutMargins = UIEdgeInsets(top: 0, left: margin, bottom: 0, right: margin)
103+
// default:
104+
// contentView.layoutMargins = .zero
105+
// }
106+
// }
107+
//}
108+
//
109+
//// MARK: - UICollectionViewDelegateFlowLayout
110+
//extension PickServerCategoriesCell: UICollectionViewDelegateFlowLayout {
111+
//
112+
// func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
113+
// os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: indexPath: %s", ((#file as NSString).lastPathComponent), #line, #function, indexPath.debugDescription)
114+
// collectionView.selectItem(at: indexPath, animated: true, scrollPosition: .centeredHorizontally)
115+
// delegate?.pickServerCategoriesCell(self, collectionView: collectionView, didSelectItemAt: indexPath)
116+
// }
117+
//
118+
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
119+
// layoutIfNeeded()
120+
// return UIEdgeInsets(top: 0, left: metricView.frame.minX - collectionView.frame.minX, bottom: 0, right: collectionView.frame.maxX - metricView.frame.maxX)
121+
// }
122+
//
123+
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
124+
// return 16
125+
// }
126+
//
127+
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
128+
// return CGSize(width: 60, height: 80)
129+
// }
130+
//
131+
//}
132+
//
133+
//extension PickServerCategoriesCell {
134+
//
135+
// override func accessibilityElementCount() -> Int {
136+
// guard let diffableDataSource = diffableDataSource else { return 0 }
137+
// return diffableDataSource.snapshot().itemIdentifiers.count
138+
// }
139+
//
140+
// override func accessibilityElement(at index: Int) -> Any? {
141+
// guard let item = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) else { return nil }
142+
// return item
143+
// }
144+
//
145+
//}

0 commit comments

Comments
 (0)