chore: make UI appearance match between onboarding scenes

This commit is contained in:
CMK 2021-02-26 16:43:59 +08:00
parent 2498254c38
commit ccf599feaa
35 changed files with 940 additions and 521 deletions

View File

@ -692,18 +692,20 @@
name = Frameworks;
sourceTree = "<group>";
};
DB01409B25C40BB600F9F3CF /* Authentication */ = {
DB01409B25C40BB600F9F3CF /* Onboarding */ = {
isa = PBXGroup;
children = (
0FAA0FDD25E0B5700017CCDE /* Welcome */,
0FAA102525E1125D0017CCDE /* PickServer */,
DBE0821A25CD382900FD6BBD /* Register */,
DB72602125E36A2500235243 /* ServerRules */,
2D364F7025E66D5B00204FDC /* ResendEmail */,
2D59819925E4A55C000FB903 /* ConfirmEmail */,
DB0140A625C40C0900F9F3CF /* PinBased */,
DBE0821A25CD382900FD6BBD /* Register */,
DB72602125E36A2500235243 /* ServerRules */,
DB01409525C40B6700F9F3CF /* AuthenticationViewController.swift */,
DB98334625C8056600AD9700 /* AuthenticationViewModel.swift */,
);
path = Authentication;
path = Onboarding;
sourceTree = "<group>";
};
DB0140A625C40C0900F9F3CF /* PinBased */ = {
@ -956,9 +958,7 @@
children = (
2D7631A425C1532200929FB9 /* Share */,
DB8AF54E25C13703002E6C99 /* MainTab */,
0FAA0FDD25E0B5700017CCDE /* Welcome */,
0FAA102525E1125D0017CCDE /* PickServer */,
DB01409B25C40BB600F9F3CF /* Authentication */,
DB01409B25C40BB600F9F3CF /* Onboarding */,
2D38F1D325CD463600561493 /* HomeTimeline */,
2D76316325C14BAC00929FB9 /* PublicTimeline */,
DB9D6BEE25E4F5370051B173 /* Search */,
@ -1513,7 +1513,6 @@
DB9D6BFF25E4F5940051B173 /* ProfileViewController.swift in Sources */,
0FB3D30825E524C600AAD544 /* PickServerCategoriesCell.swift in Sources */,
2D38F1FE25CD481700561493 /* StatusProvider.swift in Sources */,
2D5A3D1125CF87AA002347D6 /* AvatarBarButtonItem.swift in Sources */,
0FB3D31E25E534C700AAD544 /* PickServerCategoryCollectionViewCell.swift in Sources */,
DB45FB0F25CA87D0005A8AC7 /* AuthenticationService.swift in Sources */,
);

View File

@ -5,6 +5,11 @@
<key>SchemeUserState</key>
<dict>
<key>CoreDataStack.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>9</integer>
</dict>
<key>Mastodon - RTL.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>8</integer>

View File

@ -39,6 +39,7 @@ internal enum Asset {
}
internal enum Button {
internal static let actionToolbar = ColorAsset(name: "Colors/Button/action.toolbar")
internal static let disabled = ColorAsset(name: "Colors/Button/disabled")
internal static let highlight = ColorAsset(name: "Colors/Button/highlight")
}
internal enum Icon {
@ -67,7 +68,10 @@ internal enum Asset {
internal static let lightWhite = ColorAsset(name: "Colors/lightWhite")
internal static let systemOrange = ColorAsset(name: "Colors/system.orange")
}
internal static let welcomeLogo = ImageAsset(name: "welcome.logo")
internal enum Welcome {
internal static let mastodonLogo = ImageAsset(name: "Welcome/mastodon.logo")
internal static let mastodonLogoLarge = ImageAsset(name: "Welcome/mastodon.logo.large")
}
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name

View File

@ -8,23 +8,52 @@
import UIKit
protocol OnboardingViewControllerAppearance: UIViewController {
static var viewBottomPaddingHeight: CGFloat { get }
func setupOnboardingAppearance()
func setupNavigationBarAppearance()
}
extension OnboardingViewControllerAppearance {
static var actionButtonHeight: CGFloat { return 46 }
static var viewBottomPaddingHeight: CGFloat { return 11 }
func setupOnboardingAppearance() {
overrideUserInterfaceStyle = .light
view.backgroundColor = Asset.Colors.Background.onboardingBackground.color
// set navigationBar transparent
setupNavigationBarAppearance()
let backItem = UIBarButtonItem()
backItem.title = L10n.Common.Controls.Actions.back
navigationItem.backBarButtonItem = backItem
}
func setupNavigationBarAppearance() {
// use TransparentBackground so view push / dismiss will be more visual nature
// please add opaque background for status bar manually if needs
let barAppearance = UINavigationBarAppearance()
barAppearance.configureWithTransparentBackground()
navigationController?.navigationBar.standardAppearance = barAppearance
navigationController?.navigationBar.compactAppearance = barAppearance
navigationController?.navigationBar.scrollEdgeAppearance = barAppearance
let backItem = UIBarButtonItem()
backItem.title = L10n.Common.Controls.Actions.back
navigationController?.navigationBar.topItem?.backBarButtonItem = backItem
}
func setupNavigationBarBackgroundView() {
let navigationBarBackgroundView: UIView = {
let view = UIView()
view.backgroundColor = Asset.Colors.Background.onboardingBackground.color
return view
}()
navigationBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(navigationBarBackgroundView)
NSLayoutConstraint.activate([
navigationBarBackgroundView.topAnchor.constraint(equalTo: view.topAnchor),
navigationBarBackgroundView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
navigationBarBackgroundView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
navigationBarBackgroundView.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor),
])
}
}

View File

@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.784",
"green" : "0.682",
"red" : "0.608"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -2,5 +2,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}

View File

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Logotype (Full) 1.pdf",
"filename" : "mastodon.logo.pdf",
"idiom" : "universal"
}
],

View File

@ -0,0 +1,339 @@
%PDF-1.7
1 0 obj
<< /BBox [ 0.000000 0.000000 480.000000 119.097778 ]
/Resources << >>
/Subtype /Form
/Length 2 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.001709 -0.290527 cm
0.188235 0.533333 0.831373 scn
107.682541 47.532677 m
106.063889 39.212074 93.195923 30.106506 78.416977 28.341690 c
70.709908 27.421394 63.121937 26.576881 55.030510 26.946808 c
41.798027 27.553123 31.357124 30.104706 31.357124 30.104706 c
31.357124 28.818085 31.436523 27.591019 31.595320 26.443352 c
33.315022 13.385902 44.544495 12.602745 55.180283 12.238235 c
65.917122 11.870117 75.475624 14.885460 75.475624 14.885460 c
75.917725 5.177185 l
75.917725 5.177185 68.407349 1.147720 55.030510 0.406067 c
47.655472 0.000053 38.495773 0.590118 27.827501 3.414185 c
4.693666 9.538696 0.712913 34.197334 0.106597 59.224106 c
-0.079267 66.653275 0.034417 73.660202 0.034417 79.517647 c
0.034417 105.105621 16.798328 112.606972 16.798328 112.606972 c
25.250660 116.488472 39.757122 118.121559 54.837425 118.244263 c
55.207348 118.244263 l
70.287651 118.121559 84.801338 116.488472 93.255470 112.606972 c
93.255470 112.606972 110.019386 105.105621 110.019386 79.517647 c
110.019386 79.517647 110.230507 60.638844 107.682541 47.532677 c
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 23.245789 45.780518 cm
0.121569 0.137255 0.168627 scn
0.000000 39.648720 m
0.000000 43.373230 3.018947 46.392181 6.743458 46.392181 c
10.467969 46.392181 13.486919 43.373230 13.486919 39.648720 c
13.486919 35.924210 10.467969 32.905262 6.743458 32.905262 c
3.018947 32.905262 0.000000 35.924210 0.000000 39.648720 c
h
96.718201 31.461655 m
96.718201 0.478188 l
84.443916 0.478188 l
84.443916 30.553986 l
84.443916 36.893234 81.776840 40.110676 76.440903 40.110676 c
70.541954 40.110676 67.586166 36.292332 67.586166 28.745865 c
67.586166 12.286915 l
55.384064 12.286915 l
55.384064 28.745865 l
55.384064 36.294136 52.426468 40.110676 46.529324 40.110676 c
41.193382 40.110676 38.524509 36.893234 38.524509 30.553986 c
38.524509 0.481804 l
26.252031 0.481804 l
26.252031 31.465263 l
26.252031 37.795486 27.865263 42.828270 31.104361 46.550980 c
34.442707 50.273685 38.816845 52.181053 44.246616 52.181053 c
50.526318 52.181053 55.284817 49.768425 58.430077 44.939552 c
61.486919 39.814735 l
64.543762 44.939552 l
67.689026 49.768425 72.445709 52.182858 78.727219 52.182858 c
84.156990 52.182858 88.529327 50.273685 91.869476 46.552784 c
95.108574 42.828270 96.720009 37.795490 96.720009 31.463459 c
96.718201 31.461655 l
h
139.005112 16.060150 m
141.536835 18.736240 142.758499 22.105263 142.758499 26.170826 c
142.758499 30.236389 141.536835 33.605415 139.005112 36.184063 c
136.565414 38.860153 133.468872 40.148571 129.715500 40.148571 c
125.962112 40.148571 122.867371 38.860153 120.427673 36.184063 c
117.987968 33.605415 116.768120 30.236389 116.768120 26.170826 c
116.768120 22.107067 117.987968 18.736240 120.427673 16.060150 c
122.867371 13.483311 125.962112 12.194881 129.715500 12.194881 c
133.468872 12.194881 136.565414 13.483311 139.005112 16.060150 c
139.005112 16.060150 l
h
142.758499 50.953987 m
154.859543 50.953987 l
154.859543 1.389473 l
142.754898 1.389473 l
142.754898 7.236088 l
139.097153 2.378342 134.030075 -0.000008 127.463463 -0.000008 c
121.176544 -0.000008 115.827965 2.477585 111.323906 7.533829 c
106.915489 12.590069 104.665268 18.835487 104.665268 26.169022 c
104.665268 33.405113 106.915489 39.650528 111.323906 44.706768 c
115.827965 49.763008 121.176544 52.339851 127.463463 52.339851 c
134.030075 52.339851 139.097153 49.959702 142.754898 45.103760 c
142.754898 50.950378 l
142.758499 50.953987 l
h
195.581955 27.062256 m
199.147659 24.387970 200.930527 20.620148 200.836685 15.863457 c
200.836685 10.807217 199.053848 6.840900 195.394302 4.065559 c
191.734756 1.389473 187.326309 0.001801 181.977737 0.001801 c
172.314575 0.001801 165.746170 3.966316 162.274292 11.797894 c
172.783768 18.041504 l
174.191299 13.781052 177.286011 11.599396 181.977737 11.599396 c
186.294128 11.599396 188.452347 12.988873 188.452347 15.863457 c
188.452347 17.944057 185.637283 19.827969 179.913376 21.313084 c
177.755188 21.908573 175.972336 22.504059 174.566620 23.000301 c
172.596085 23.792480 170.907074 24.685715 169.499557 25.775639 c
166.027664 28.451729 164.246628 32.019249 164.246628 36.579250 c
164.246628 41.436996 165.933823 45.302254 169.311874 48.079399 c
172.783752 50.953987 177.004501 52.341656 182.071579 52.341656 c
190.141342 52.341656 196.051117 48.871578 199.898331 41.833984 c
189.578354 35.886318 l
188.076996 39.255341 185.543457 40.940754 182.071579 40.940754 c
178.412018 40.940754 176.630966 39.553085 176.630966 36.876991 c
176.630966 34.796391 179.444214 32.912483 185.168121 31.425564 c
189.578339 30.433083 193.048416 28.947971 195.581955 27.064060 c
195.581955 27.062256 l
h
234.052322 38.661655 m
223.449036 38.661655 l
223.449036 18.043308 l
223.449036 15.563908 224.389175 14.078796 226.170227 13.384060 c
227.483917 12.887817 230.111267 12.788570 234.052322 12.987068 c
234.052322 1.389473 l
225.890518 0.396988 219.978958 1.190971 216.507080 3.868866 c
213.037003 6.445709 211.346176 11.202404 211.346176 18.043308 c
211.346176 38.661655 l
203.184372 38.661655 l
203.184372 50.953987 l
211.346176 50.953987 l
211.346176 60.965416 l
223.449036 64.830681 l
223.449036 50.953987 l
234.052322 50.953987 l
234.052322 38.661655 l
234.052322 38.661655 l
h
272.614716 16.357895 m
275.054413 18.936543 276.274261 22.208122 276.274261 26.172634 c
276.274261 30.137146 275.054413 33.408722 272.614716 35.985565 c
270.176819 38.562408 267.174133 39.850830 263.514587 39.850830 c
259.855011 39.850830 256.854126 38.562408 254.414429 35.985565 c
252.068558 33.309475 250.848709 30.037895 250.848709 26.172634 c
250.848709 22.305565 252.068558 19.033985 254.414429 16.357895 c
256.854126 13.781052 259.855011 12.492626 263.514587 12.492626 c
267.174133 12.492626 270.176819 13.781052 272.614716 16.357895 c
h
245.875488 7.535637 m
241.091721 12.590076 238.745850 18.736240 238.745850 26.172634 c
238.745850 33.507973 241.091721 39.652328 245.875488 44.708572 c
250.661057 49.763008 256.570801 52.341656 263.514587 52.341656 c
270.458344 52.341656 276.368134 49.763008 281.153687 44.708572 c
285.939240 39.652328 288.377136 33.408722 288.377136 26.172634 c
288.377136 18.835491 285.939240 12.590076 281.153687 7.535637 c
276.368134 2.479401 270.552155 0.001801 263.514587 0.001801 c
256.476990 0.001801 250.661057 2.479401 245.875488 7.535637 c
h
328.818054 16.060150 m
331.257751 18.736240 332.475769 22.105263 332.475769 26.170826 c
332.475769 30.236389 331.257751 33.605415 328.818054 36.184063 c
326.378357 38.860153 323.281799 40.148571 319.528412 40.148571 c
315.775024 40.148571 312.680298 38.860153 310.146759 36.184063 c
307.708893 33.605415 306.487213 30.236389 306.487213 26.170826 c
306.487213 22.107067 307.708893 18.736240 310.146759 16.060150 c
312.680298 13.483311 315.870667 12.194881 319.528412 12.194881 c
323.281799 12.194881 326.378357 13.483311 328.818054 16.060150 c
328.818054 16.060150 l
h
332.475769 70.780151 m
344.580475 70.780151 l
344.580475 1.389473 l
332.475769 1.389473 l
332.475769 7.236088 l
328.911865 2.378342 323.844818 -0.000008 317.278198 -0.000008 c
310.991272 -0.000008 305.550690 2.477585 301.046631 7.533829 c
296.636414 12.590069 294.384369 18.835487 294.384369 26.169022 c
294.384369 33.405113 296.636414 39.650528 301.046631 44.706768 c
305.550690 49.763008 310.991272 52.339851 317.278198 52.339851 c
323.844818 52.339851 328.911865 49.959702 332.475769 45.103760 c
332.475769 70.780151 l
332.475769 70.780151 l
h
387.083923 16.357895 m
389.523621 18.936543 390.743469 22.208122 390.743469 26.172634 c
390.743469 30.137146 389.523621 33.408722 387.083923 35.985565 c
384.644226 38.562408 381.643311 39.850830 377.983765 39.850830 c
374.324219 39.850830 371.321503 38.562408 368.881805 35.985565 c
366.535950 33.309475 365.316101 30.037895 365.316101 26.172634 c
365.316101 22.305565 366.535950 19.033985 368.881805 16.357895 c
371.321503 13.781052 374.324219 12.492626 377.983765 12.492626 c
381.643311 12.492626 384.644226 13.781052 387.083923 16.357895 c
387.083923 16.357895 l
h
360.344666 7.535637 m
355.559082 12.590076 353.215027 18.736240 353.215027 26.172634 c
353.215027 33.507973 355.559082 39.652328 360.344666 44.708572 c
365.130219 49.763008 371.040009 52.341656 377.983765 52.341656 c
384.925720 52.341656 390.837280 49.763008 395.622864 44.708572 c
400.408417 39.652328 402.846313 33.408722 402.846313 26.172634 c
402.846313 18.835491 400.408417 12.590076 395.622864 7.535637 c
390.837280 2.479401 385.019562 0.001801 377.983765 0.001801 c
370.946167 0.001801 365.130219 2.479401 360.344666 7.535637 c
360.344666 7.535637 l
h
455.202423 31.822556 m
455.202423 1.389473 l
443.097748 1.389473 l
443.097748 30.236389 l
443.097748 33.507969 442.255035 35.985565 440.566010 37.869476 c
438.970825 39.553085 436.718811 40.446320 433.809937 40.446320 c
426.960022 40.446320 423.489929 36.382557 423.489929 28.153984 c
423.489929 1.389473 l
411.387054 1.389473 l
411.387054 50.953987 l
423.489929 50.953987 l
423.489929 45.403309 l
426.398773 50.060753 430.994904 52.341656 437.469482 52.341656 c
442.630371 52.341656 446.851135 50.556992 450.135345 46.888420 c
453.513397 43.221657 455.202423 38.264664 455.202423 31.820751 c
455.202423 31.822556 l
h
f
n
Q
endstream
endobj
2 0 obj
9224
endobj
3 0 obj
<< /BBox [ 0.000000 0.000000 480.000000 119.097778 ]
/Resources << >>
/Subtype /Form
/Length 4 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 119.097778 m
480.000000 119.097778 l
480.000000 0.000031 l
0.000000 0.000031 l
0.000000 119.097778 l
h
f
n
Q
endstream
endobj
4 0 obj
237
endobj
5 0 obj
<< /XObject << /X1 1 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 3 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
6 0 obj
<< /Length 7 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
7 0 obj
46
endobj
8 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 480.000000 119.097778 ]
/Resources 5 0 R
/Contents 6 0 R
/Parent 9 0 R
>>
endobj
9 0 obj
<< /Kids [ 8 0 R ]
/Count 1
/Type /Pages
>>
endobj
10 0 obj
<< /Type /Catalog
/Pages 9 0 R
>>
endobj
xref
0 11
0000000000 65535 f
0000000010 00000 n
0000009484 00000 n
0000009507 00000 n
0000009994 00000 n
0000010016 00000 n
0000010314 00000 n
0000010416 00000 n
0000010437 00000 n
0000010612 00000 n
0000010686 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 10 0 R
/Size 11
>>
startxref
10746
%%EOF

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "mastodon.large.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,339 @@
%PDF-1.7
1 0 obj
<< /BBox [ 0.000000 0.000000 960.000000 238.195496 ]
/Resources << >>
/Subtype /Form
/Length 2 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.003357 -0.580933 cm
0.188235 0.533333 0.831373 scn
215.365082 95.065247 m
212.127777 78.424042 186.391846 60.212906 156.833954 56.683273 c
141.419815 54.842682 126.243874 53.153656 110.061020 53.893509 c
83.596054 55.106140 62.714249 60.209290 62.714249 60.209290 c
62.714249 57.636063 62.873047 55.181931 63.190639 52.886597 c
66.630043 26.771698 89.088989 25.205383 110.360565 24.476364 c
131.834244 23.740112 150.951248 29.770813 150.951248 29.770813 c
151.835449 10.354263 l
151.835449 10.354263 136.814697 2.295334 110.061020 0.812027 c
95.310944 0.000000 76.991547 1.180130 55.655003 6.828262 c
9.387332 19.077271 1.425826 68.394562 0.213194 118.448097 c
-0.158535 133.306442 0.068834 147.320282 0.068834 159.035172 c
0.068834 210.211121 33.596657 225.213821 33.596657 225.213821 c
50.501320 232.976822 79.514244 236.242996 109.674850 236.488403 c
110.414696 236.488403 l
140.575302 236.242996 169.602676 232.976822 186.510941 225.213821 c
186.510941 225.213821 220.038773 210.211121 220.038773 159.035172 c
220.038773 159.035172 220.461014 121.277573 215.365082 95.065247 c
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 46.491440 91.561096 cm
0.121569 0.137255 0.168627 scn
0.000000 79.297432 m
0.000000 86.746460 6.037893 92.784363 13.486916 92.784363 c
20.935938 92.784363 26.973839 86.746460 26.973839 79.297432 c
26.973839 71.848412 20.935938 65.810516 13.486916 65.810516 c
6.037893 65.810516 0.000000 71.848412 0.000000 79.297432 c
h
193.436401 62.923302 m
193.436401 0.956360 l
168.887833 0.956360 l
168.887833 61.107964 l
168.887833 73.786461 163.553680 80.221344 152.881805 80.221344 c
141.083908 80.221344 135.172333 72.584648 135.172333 57.491714 c
135.172333 24.573814 l
110.768127 24.573814 l
110.768127 57.491714 l
110.768127 72.588257 104.852936 80.221344 93.058647 80.221344 c
82.386765 80.221344 77.049019 73.786461 77.049019 61.107964 c
77.049019 0.963593 l
52.504063 0.963593 l
52.504063 62.930511 l
52.504063 75.590965 55.730526 85.656540 62.208721 93.101944 c
68.885414 100.547363 77.633690 104.362106 88.493233 104.362106 c
101.052635 104.362106 110.569633 99.536835 116.860153 89.879089 c
122.973839 79.629471 l
129.087524 89.879089 l
135.378052 99.536835 144.891418 104.365707 157.454437 104.365707 c
168.313980 104.365707 177.058655 100.547363 183.738953 93.105560 c
190.217148 85.656540 193.440018 75.590973 193.440018 62.926910 c
193.436401 62.923302 l
h
278.010223 32.120285 m
283.073669 37.472473 285.516998 44.210510 285.516998 52.341637 c
285.516998 60.472771 283.073669 67.210823 278.010223 72.368118 c
273.130829 77.720299 266.937744 80.297134 259.431000 80.297134 c
251.924225 80.297134 245.734741 77.720299 240.855347 72.368118 c
235.975937 67.210823 233.536240 60.472771 233.536240 52.341637 c
233.536240 44.214119 235.975937 37.472473 240.855347 32.120285 c
245.734741 26.966606 251.924225 24.389748 259.431000 24.389748 c
266.937744 24.389748 273.130829 26.966606 278.010223 32.120285 c
278.010223 32.120285 l
h
285.516998 101.907967 m
309.719086 101.907967 l
309.719086 2.778915 l
285.509796 2.778915 l
285.509796 14.472160 l
278.194305 4.756668 268.060150 -0.000031 254.926926 -0.000031 c
242.353088 -0.000031 231.655930 4.955154 222.647812 15.067642 c
213.830978 25.180122 209.330536 37.670959 209.330536 52.338036 c
209.330536 66.810219 213.830978 79.301048 222.647812 89.413528 c
231.655930 99.526016 242.353088 104.679695 254.926926 104.679695 c
268.060150 104.679695 278.194305 99.919395 285.509796 90.207512 c
285.509796 101.900742 l
285.516998 101.907967 l
h
391.163910 54.124504 m
398.295319 48.775932 401.861053 41.240288 401.673370 31.726898 c
401.673370 21.614418 398.107697 13.681786 390.788605 8.131104 c
383.469513 2.778931 374.652618 0.003571 363.955475 0.003571 c
344.629150 0.003571 331.492340 7.932617 324.548584 23.595772 c
345.567535 36.082993 l
348.382599 27.562088 354.572021 23.198776 363.955475 23.198776 c
372.588257 23.198776 376.904694 25.977730 376.904694 31.726898 c
376.904694 35.888107 371.274567 39.655930 359.826752 42.626152 c
355.510376 43.817131 351.944672 45.008102 349.133240 46.000587 c
345.192169 47.584946 341.814148 49.371414 338.999115 51.551262 c
332.055328 56.903450 328.493256 64.038490 328.493256 73.158493 c
328.493256 82.873978 331.867645 90.604507 338.623749 96.158791 c
345.567505 101.907967 354.009003 104.683304 364.143158 104.683304 c
380.282684 104.683304 392.102234 97.743149 399.796661 83.667961 c
379.156708 71.772621 l
376.153992 78.510666 371.086914 81.881500 364.143158 81.881500 c
356.824036 81.881500 353.261932 79.106155 353.261932 73.753975 c
353.261932 69.592773 358.888428 65.824951 370.336243 62.851120 c
379.156677 60.866158 386.096832 57.895927 391.163910 54.128113 c
391.163910 54.124504 l
h
468.104645 77.323303 m
446.898071 77.323303 l
446.898071 36.086601 l
446.898071 31.127808 448.778351 28.157578 452.340454 26.768105 c
454.967834 25.775620 460.222534 25.577126 468.104645 25.974121 c
468.104645 2.778915 l
451.781036 0.793961 439.957916 2.381927 433.014160 7.737717 c
426.074005 12.891403 422.692352 22.404793 422.692352 36.086601 c
422.692352 77.323303 l
406.368744 77.323303 l
406.368744 101.907967 l
422.692352 101.907967 l
422.692352 121.930832 l
446.898071 129.661346 l
446.898071 101.907967 l
468.104645 101.907967 l
468.104645 77.323303 l
468.104645 77.323303 l
h
545.229431 32.715775 m
550.108826 37.873070 552.548523 44.416229 552.548523 52.345253 c
552.548523 60.274277 550.108826 66.817436 545.229431 71.971123 c
540.353638 77.124809 534.348267 79.701645 527.029175 79.701645 c
519.710022 79.701645 513.708252 77.124809 508.828857 71.971123 c
504.137115 66.618942 501.697418 60.075783 501.697418 52.345253 c
501.697418 44.611115 504.137115 38.067955 508.828857 32.715775 c
513.708252 27.562088 519.710022 24.985237 527.029175 24.985237 c
534.348267 24.985237 540.353638 27.562088 545.229431 32.715775 c
h
491.750977 15.071259 m
482.183441 25.180138 477.491699 37.472473 477.491699 52.345253 c
477.491699 67.015930 482.183441 79.304657 491.750977 89.417137 c
501.322113 99.526016 513.141602 104.683304 527.029175 104.683304 c
540.916687 104.683304 552.736267 99.526016 562.307373 89.417137 c
571.878479 79.304657 576.754272 66.817436 576.754272 52.345253 c
576.754272 37.670967 571.878479 25.180138 562.307373 15.071259 c
552.736267 4.958771 541.104309 0.003571 527.029175 0.003571 c
512.953979 0.003571 501.322113 4.958771 491.750977 15.071259 c
h
657.636108 32.120285 m
662.515503 37.472473 664.951538 44.210510 664.951538 52.341637 c
664.951538 60.472771 662.515503 67.210823 657.636108 72.368118 c
652.756714 77.720299 646.563599 80.297134 639.056824 80.297134 c
631.550049 80.297134 625.360596 77.720299 620.293518 72.368118 c
615.417786 67.210823 612.974426 60.472771 612.974426 52.341637 c
612.974426 44.214119 615.417786 37.472473 620.293518 32.120285 c
625.360596 26.966606 631.741333 24.389748 639.056824 24.389748 c
646.563599 24.389748 652.756714 26.966606 657.636108 32.120285 c
657.636108 32.120285 l
h
664.951538 141.560303 m
689.160950 141.560303 l
689.160950 2.778915 l
664.951538 2.778915 l
664.951538 14.472160 l
657.823730 4.756668 647.689636 -0.000031 634.556396 -0.000031 c
621.982544 -0.000031 611.101379 4.955154 602.093262 15.067642 c
593.272827 25.180122 588.768738 37.670959 588.768738 52.338036 c
588.768738 66.810219 593.272827 79.301048 602.093262 89.413528 c
611.101379 99.526016 621.982544 104.679695 634.556396 104.679695 c
647.689636 104.679695 657.823730 99.919395 664.951538 90.207512 c
664.951538 141.560303 l
664.951538 141.560303 l
h
774.167847 32.715775 m
779.047241 37.873070 781.486938 44.416229 781.486938 52.345253 c
781.486938 60.274277 779.047241 66.817436 774.167847 71.971123 c
769.288452 77.124809 763.286621 79.701645 755.967529 79.701645 c
748.648438 79.701645 742.643005 77.124809 737.763611 71.971123 c
733.071899 66.618942 730.632202 60.075783 730.632202 52.345253 c
730.632202 44.611115 733.071899 38.067955 737.763611 32.715775 c
742.643005 27.562088 748.648438 24.985237 755.967529 24.985237 c
763.286621 24.985237 769.288452 27.562088 774.167847 32.715775 c
774.167847 32.715775 l
h
720.689331 15.071259 m
711.118164 25.180138 706.430054 37.472473 706.430054 52.345253 c
706.430054 67.015930 711.118164 79.304657 720.689331 89.417137 c
730.260437 99.526016 742.080017 104.683304 755.967529 104.683304 c
769.851440 104.683304 781.674561 99.526016 791.245728 89.417137 c
800.816833 79.304657 805.692627 66.817436 805.692627 52.345253 c
805.692627 37.670967 800.816833 25.180138 791.245728 15.071259 c
781.674561 4.958771 770.039124 0.003571 755.967529 0.003571 c
741.892334 0.003571 730.260437 4.958771 720.689331 15.071259 c
720.689331 15.071259 l
h
910.404846 63.645103 m
910.404846 2.778915 l
886.195496 2.778915 l
886.195496 60.472771 l
886.195496 67.015930 884.510071 71.971123 881.132019 75.738945 c
877.941650 79.106163 873.437622 80.892624 867.619873 80.892624 c
853.920044 80.892624 846.979858 72.765106 846.979858 56.307961 c
846.979858 2.778915 l
822.774109 2.778915 l
822.774109 101.907967 l
846.979858 101.907967 l
846.979858 90.806610 l
852.797546 100.121506 861.989807 104.683304 874.938965 104.683304 c
885.260742 104.683304 893.702271 101.113983 900.270691 93.776840 c
907.026794 86.443298 910.404846 76.529312 910.404846 63.641495 c
910.404846 63.645103 l
h
f
n
Q
endstream
endobj
2 0 obj
9343
endobj
3 0 obj
<< /BBox [ 0.000000 0.000000 960.000000 238.195496 ]
/Resources << >>
/Subtype /Form
/Length 4 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 238.195496 m
960.000000 238.195496 l
960.000000 0.000000 l
0.000000 0.000000 l
0.000000 238.195496 l
h
f
n
Q
endstream
endobj
4 0 obj
237
endobj
5 0 obj
<< /XObject << /X1 1 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 3 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
6 0 obj
<< /Length 7 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
7 0 obj
46
endobj
8 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 960.000000 238.195496 ]
/Resources 5 0 R
/Contents 6 0 R
/Parent 9 0 R
>>
endobj
9 0 obj
<< /Kids [ 8 0 R ]
/Count 1
/Type /Pages
>>
endobj
10 0 obj
<< /Type /Catalog
/Pages 9 0 R
>>
endobj
xref
0 11
0000000000 65535 f
0000000010 00000 n
0000009603 00000 n
0000009626 00000 n
0000010113 00000 n
0000010135 00000 n
0000010433 00000 n
0000010535 00000 n
0000010556 00000 n
0000010731 00000 n
0000010805 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 10 0 R
/Size 11
>>
startxref
10865
%%EOF

View File

@ -1,335 +0,0 @@
%PDF-1.7
1 0 obj
<< /BBox [ 0.000000 0.000000 265.139893 65.366211 ]
/Resources << >>
/Subtype /Form
/Length 2 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 -0.161102 cm
0.188235 0.533333 0.831373 scn
59.674690 26.340824 m
58.778019 21.729694 51.647373 16.683701 43.456982 15.705723 c
39.185936 15.195595 34.981327 14.727741 30.497496 14.933094 c
23.164286 15.269001 17.378185 16.683697 17.378185 16.683697 c
17.378185 15.969608 17.422323 15.289906 17.510132 14.654335 c
18.463486 7.417763 24.686306 6.983833 30.580656 6.781731 c
36.529831 6.578239 41.826706 8.248928 41.826706 8.248928 c
42.071552 2.869816 l
42.071552 2.869816 37.910149 0.635567 30.497496 0.224861 c
26.409500 0.000000 21.334234 0.327538 15.422230 1.891842 c
2.601194 5.285728 0.396213 18.952328 0.058915 32.819641 c
-0.044226 36.936905 0.019424 40.819546 0.019424 44.066154 c
0.019424 58.246605 9.309983 62.402893 9.309983 62.402893 c
13.994521 64.554443 22.032990 65.459015 30.389708 65.527313 c
30.595058 65.527313 l
38.951778 65.459015 46.995354 64.554443 51.679893 62.402893 c
51.679893 62.402893 60.970455 58.246605 60.970455 44.066154 c
60.970455 44.066154 61.086605 33.604343 59.674690 26.340824 c
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 12.881470 25.370911 cm
0.121569 0.137255 0.168627 scn
0.000000 21.971138 m
0.000000 24.035347 1.673481 25.708363 3.737223 25.708363 c
5.801430 25.708363 7.474446 24.035347 7.474446 21.971138 c
7.474446 19.907396 5.801430 18.233915 3.737223 18.233915 c
1.673481 18.233915 0.000000 19.907396 0.000000 21.971138 c
h
53.598671 17.434528 m
53.598671 0.264858 l
46.796501 0.264858 l
46.796501 16.929976 l
46.796501 20.443262 45.318153 22.225924 42.361454 22.225924 c
39.093010 22.225924 37.454372 20.110611 37.454372 15.928303 c
37.454372 6.806858 l
30.692154 6.806858 l
30.692154 15.928303 l
30.692154 20.110611 29.053518 22.225924 25.785074 22.225924 c
22.828375 22.225924 21.350027 20.443262 21.350027 16.929976 c
21.350027 0.264858 l
14.547852 0.264858 l
14.547852 17.434528 l
14.547852 20.943634 15.441275 23.732149 17.236015 25.795427 c
19.086971 27.858242 21.510775 28.915665 24.519045 28.915665 c
28.000275 28.915665 30.636404 27.578087 32.378643 24.902004 c
34.073498 22.061457 l
35.767883 24.902004 l
37.510586 27.578087 40.146252 28.915665 43.627945 28.915665 c
46.636215 28.915665 49.059559 27.858242 50.910519 25.795427 c
52.705257 23.732149 53.598671 20.943634 53.598671 17.434528 c
53.598671 17.434528 l
h
77.032234 8.899359 m
78.435783 10.382355 79.111771 12.250038 79.111771 14.502407 c
79.111771 16.754778 78.435783 18.622458 77.032234 20.050631 c
75.680717 21.534092 73.964493 22.247713 71.884956 22.247713 c
69.804955 22.247713 68.089188 21.534092 66.737679 20.050631 c
65.385696 18.622458 64.709709 16.754778 64.709709 14.502407 c
64.709709 12.250038 65.385696 10.382355 66.737679 8.899359 c
68.089188 7.471186 69.804955 6.757099 71.884956 6.757099 c
73.964493 6.757099 75.680717 7.471186 77.032234 8.899359 c
h
79.111771 28.235912 m
85.819176 28.235912 l
85.819176 0.768902 l
79.111771 0.768902 l
79.111771 4.010399 l
77.084267 1.318520 74.276245 -0.000008 70.637054 -0.000008 c
67.153496 -0.000008 64.189835 1.373341 61.694012 4.175331 c
59.250694 6.976852 58.002777 10.437643 58.002777 14.502407 c
58.002777 18.512350 59.250694 21.973600 61.694012 24.775124 c
64.189835 27.576649 67.153496 29.004822 70.637054 29.004822 c
74.276245 29.004822 77.084267 27.686295 79.111771 24.994881 c
79.111771 28.235912 l
79.111771 28.235912 l
h
108.385788 14.996740 m
110.361259 13.513744 111.349464 11.426306 111.297432 8.789715 c
111.297432 5.987724 110.309227 3.790642 108.281723 2.252361 c
106.253754 0.768898 103.810432 -0.000008 100.846764 -0.000008 c
95.491348 -0.000008 91.851685 2.197540 89.927788 6.537346 c
95.751526 9.997667 l
96.531120 7.636118 98.246872 6.427235 100.846764 6.427235 c
103.238045 6.427235 104.434395 7.196609 104.434395 8.789715 c
104.434395 9.943310 102.874275 10.986797 99.702927 11.810530 c
98.506592 12.140394 97.518852 12.469793 96.739258 12.744835 c
95.647453 13.183880 94.711761 13.678675 93.931702 14.282652 c
92.007797 15.765648 91.020058 17.743904 91.020058 20.270386 c
91.020058 22.962265 91.955765 25.104525 93.827629 26.642807 c
95.751526 28.235912 98.090775 29.004822 100.898804 29.004822 c
105.370094 29.004822 108.645966 27.082315 110.777069 23.182018 c
105.058350 19.886164 l
104.226250 21.753380 102.822701 22.687222 100.898804 22.687222 c
98.870834 22.687222 97.883102 21.918314 97.883102 20.435318 c
97.883102 19.281721 99.442749 18.238235 102.614563 17.414040 c
105.058342 16.864885 106.981773 16.040691 108.385788 14.996740 c
108.385788 14.996740 l
h
129.704178 21.423981 m
123.828873 21.423981 l
123.828873 9.997667 l
123.828873 8.624317 124.349236 7.800587 125.336967 7.416365 c
126.064987 7.141323 127.520576 7.086502 129.704178 7.196609 c
129.704178 0.768902 l
125.181328 0.219746 121.905449 0.659256 119.981552 2.142715 c
118.058113 3.570889 117.121948 6.207481 117.121948 9.997667 c
117.121948 21.423981 l
112.598618 21.423981 l
112.598618 28.235912 l
117.121948 28.235912 l
117.121948 33.784138 l
123.828873 35.926395 l
123.828873 28.235912 l
129.704178 28.235912 l
129.704178 21.423981 l
129.704178 21.423981 l
h
151.075012 9.064060 m
152.427002 10.492699 153.102524 12.305557 153.102524 14.502640 c
153.102524 16.699722 152.427002 18.512581 151.075012 19.940754 c
149.723038 21.369392 148.059311 22.083014 146.031342 22.083014 c
144.003845 22.083014 142.340118 21.369392 140.988144 19.940754 c
139.688202 18.457758 139.012207 16.644899 139.012207 14.502640 c
139.012207 12.359917 139.688202 10.547056 140.988144 9.064060 c
142.340118 7.635887 144.003845 6.921799 146.031342 6.921799 c
148.059311 6.921799 149.723038 7.635887 151.075012 9.064060 c
151.075012 9.064060 l
h
136.256683 4.175098 m
133.605225 6.976620 132.305267 10.382589 132.305267 14.502640 c
132.305267 18.567869 133.605225 21.973368 136.256683 24.774891 c
138.908142 27.576416 142.184006 29.004589 146.031342 29.004589 c
149.879135 29.004589 153.154556 27.576416 155.806488 24.774891 c
158.458405 21.973368 159.809921 18.512583 159.809921 14.502640 c
159.809921 10.437410 158.458405 6.976620 155.806488 4.175098 c
153.154556 1.373108 149.931168 0.000225 146.031342 0.000225 c
142.131973 0.000225 138.908142 1.373108 136.256683 4.175098 c
h
182.220291 8.899359 m
183.572281 10.382355 184.247803 12.250038 184.247803 14.502407 c
184.247803 16.754778 183.572281 18.622458 182.220291 20.050631 c
180.868774 21.534092 179.152557 22.247713 177.073013 22.247713 c
174.993011 22.247713 173.277252 21.534092 171.873703 20.050631 c
170.522202 18.622458 169.845734 16.754778 169.845734 14.502407 c
169.845734 12.250038 170.522202 10.382355 171.873703 8.899359 c
173.277252 7.471186 175.045044 6.757099 177.073013 6.757099 c
179.152557 6.757099 180.868774 7.471186 182.220291 8.899359 c
h
184.247803 39.222717 m
190.955170 39.222717 l
190.955170 0.768902 l
184.247803 0.768902 l
184.247803 4.010399 l
182.272339 1.318520 179.464294 -0.000008 175.825104 -0.000008 c
172.341553 -0.000008 169.326324 1.373341 166.830505 4.175331 c
164.386719 6.976852 163.138809 10.437643 163.138809 14.502407 c
163.138809 18.512350 164.386719 21.973600 166.830505 24.775124 c
169.326324 27.576649 172.341553 29.004822 175.825104 29.004822 c
179.464294 29.004822 182.272339 27.686295 184.247803 24.994881 c
184.247803 39.222717 l
184.247803 39.222717 l
h
214.509811 9.064060 m
215.861328 10.492699 216.537323 12.305557 216.537323 14.502640 c
216.537323 16.699722 215.861328 18.512581 214.509811 19.940754 c
213.157837 21.369392 211.494110 22.083014 209.466141 22.083014 c
207.438644 22.083014 205.774460 21.369392 204.422943 19.940754 c
203.122543 18.457758 202.447006 16.644899 202.447006 14.502640 c
202.447006 12.359917 203.122543 10.547056 204.422943 9.064060 c
205.774460 7.635887 207.438644 6.921799 209.466141 6.921799 c
211.494110 6.921799 213.157837 7.635887 214.509811 9.064060 c
214.509811 9.064060 l
h
199.691467 4.175098 m
197.039551 6.976620 195.740082 10.382589 195.740082 14.502640 c
195.740082 18.567869 197.039551 21.973368 199.691467 24.774891 c
202.343399 27.576416 205.618805 29.004589 209.466141 29.004589 c
213.313934 29.004589 216.589355 27.576416 219.241272 24.774891 c
221.893204 21.973368 223.244705 18.512583 223.244705 14.502640 c
223.244705 10.437410 221.893204 6.976620 219.241272 4.175098 c
216.589355 1.373108 213.365982 0.000225 209.466141 0.000225 c
205.566772 0.000225 202.343399 1.373108 199.691467 4.175098 c
h
252.258377 17.633701 m
252.258377 0.769272 l
245.550980 0.769272 l
245.550980 16.754683 l
245.550980 18.567543 245.083130 19.940893 244.147430 20.984379 c
243.263290 21.918221 242.015381 22.413017 240.403702 22.413017 c
236.607925 22.413017 234.684494 20.160648 234.684494 15.601088 c
234.684494 0.769272 l
227.977112 0.769272 l
227.977112 28.235821 l
234.684494 28.235821 l
234.684494 25.159718 l
236.296188 27.741486 238.843567 29.004728 242.431656 29.004728 c
245.291260 29.004728 247.630966 28.016064 249.450806 25.983450 c
251.322205 23.950836 252.258377 21.204134 252.258377 17.633701 c
f
n
Q
endstream
endobj
2 0 obj
8987
endobj
3 0 obj
<< /BBox [ 0.000000 0.000000 265.139893 65.366211 ]
/Resources << >>
/Subtype /Form
/Length 4 0 R
/Group << /Type /Group
/S /Transparency
>>
/Type /XObject
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 65.366211 m
265.139862 65.366211 l
265.139862 0.000000 l
0.000000 0.000000 l
0.000000 65.366211 l
h
f
n
Q
endstream
endobj
4 0 obj
234
endobj
5 0 obj
<< /XObject << /X1 1 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 3 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
6 0 obj
<< /Length 7 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
7 0 obj
46
endobj
8 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 265.139893 65.366211 ]
/Resources 5 0 R
/Contents 6 0 R
/Parent 9 0 R
>>
endobj
9 0 obj
<< /Kids [ 8 0 R ]
/Count 1
/Type /Pages
>>
endobj
10 0 obj
<< /Type /Catalog
/Pages 9 0 R
>>
endobj
xref
0 11
0000000000 65535 f
0000000010 00000 n
0000009246 00000 n
0000009269 00000 n
0000009752 00000 n
0000009774 00000 n
0000010072 00000 n
0000010174 00000 n
0000010195 00000 n
0000010369 00000 n
0000010443 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 10 0 R
/Size 11
>>
startxref
10503
%%EOF

View File

@ -60,10 +60,6 @@ final class MastodonConfirmEmailViewController: UIViewController, NeedsDependenc
}
extension MastodonConfirmEmailViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
}
override func viewDidLoad() {
@ -118,6 +114,12 @@ extension MastodonConfirmEmailViewController {
}
.store(in: &self.disposeBag)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
}
}
extension MastodonConfirmEmailViewController {

View File

@ -29,7 +29,7 @@ final class PickServerViewController: UIViewController, NeedsDependency {
case search
case serverList
}
let tableView: UITableView = {
let tableView = ControlContainableTableView()
tableView.register(PickServerTitleCell.self, forCellReuseIdentifier: String(describing: PickServerTitleCell.self))
@ -46,11 +46,16 @@ final class PickServerViewController: UIViewController, NeedsDependency {
}()
let nextStepButton: PrimaryActionButton = {
let button = PrimaryActionButton(type: .system)
let button = PrimaryActionButton()
button.setTitle(L10n.Common.Controls.Actions.signUp, for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
deinit {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
}
}
extension PickServerViewController {
@ -62,13 +67,15 @@ extension PickServerViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Asset.Colors.Background.onboardingBackground.color
setupOnboardingAppearance()
defer { setupNavigationBarBackgroundView() }
view.addSubview(nextStepButton)
NSLayoutConstraint.activate([
nextStepButton.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor, constant: 12),
view.readableContentGuide.trailingAnchor.constraint(equalTo: nextStepButton.trailingAnchor, constant: 12),
view.bottomAnchor.constraint(equalTo: nextStepButton.bottomAnchor, constant: 34),
nextStepButton.heightAnchor.constraint(equalToConstant: PickServerViewController.actionButtonHeight).priority(.defaultHigh),
view.layoutMarginsGuide.bottomAnchor.constraint(equalTo: nextStepButton.bottomAnchor, constant: WelcomeViewController.viewBottomPaddingHeight),
])
view.addSubview(tableView)
@ -87,7 +94,6 @@ extension PickServerViewController {
}
nextStepButton.addTarget(self, action: #selector(nextStepButtonDidClicked(_:)), for: .touchUpInside)
// viewModel.tableView = tableView
tableView.delegate = self
tableView.dataSource = self
@ -152,23 +158,15 @@ extension PickServerViewController {
isAuthenticating
.receive(on: DispatchQueue.main)
.sink { [weak self] loading in
if loading {
self?.nextStepButton.showLoading()
} else {
self?.nextStepButton.stopLoading()
}
.sink { [weak self] isAuthenticating in
guard let self = self else { return }
isAuthenticating ? self.nextStepButton.showLoading() : self.nextStepButton.stopLoading()
}
.store(in: &disposeBag)
viewModel.fetchAllServers()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
}
@objc
private func nextStepButtonDidClicked(_ sender: UIButton) {
switch viewModel.mode {
@ -273,7 +271,7 @@ extension PickServerViewController {
instance: response.instance.value,
applicationToken: response.applicationToken.value
)
self.coordinator.present(scene: .mastodonRegister(viewModel: mastodonRegisterViewModel), from: self, transition: .show)
self.coordinator.present(scene: .mastodonRegister(viewModel: mastodonRegisterViewModel), from: nil, transition: .show)
}
.store(in: &disposeBag)
}
@ -417,3 +415,6 @@ extension PickServerViewController: PickServerCategoriesDataSource, PickServerCa
return viewModel.selectCategoryIndex.send(index)
}
}
// MARK: - OnboardingViewControllerAppearance
extension PickServerViewController: OnboardingViewControllerAppearance { }

View File

@ -23,14 +23,17 @@ final class PickServerCategoriesCell: UITableViewCell {
weak var dataSource: PickServerCategoriesDataSource!
weak var delegate: PickServerCategoriesDelegate!
let metricView = UIView()
let collectionView: UICollectionView = {
let flowLayout = UICollectionViewFlowLayout()
flowLayout.scrollDirection = .horizontal
let view = ControlContainableCollectionView(frame: .zero, collectionViewLayout: flowLayout)
view.register(PickServerCategoryCollectionViewCell.self, forCellWithReuseIdentifier: String(describing: PickServerCategoryCollectionViewCell.self))
view.backgroundColor = .clear
view.showsHorizontalScrollIndicator = false
view.register(PickServerCategoryCollectionViewCell.self, forCellWithReuseIdentifier: String(describing: PickServerCategoryCollectionViewCell.self))
view.showsVerticalScrollIndicator = false
view.layer.masksToBounds = false
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
@ -51,20 +54,36 @@ extension PickServerCategoriesCell {
private func _init() {
self.selectionStyle = .none
backgroundColor = .clear
metricView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(metricView)
NSLayoutConstraint.activate([
metricView.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
metricView.trailingAnchor.constraint(equalTo: contentView.readableContentGuide.trailingAnchor),
metricView.topAnchor.constraint(equalTo: contentView.topAnchor),
metricView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
metricView.heightAnchor.constraint(equalToConstant: 80).priority(.defaultHigh),
])
contentView.addSubview(collectionView)
NSLayoutConstraint.activate([
collectionView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
collectionView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
collectionView.topAnchor.constraint(equalTo: contentView.topAnchor),
collectionView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
collectionView.heightAnchor.constraint(equalToConstant: 80),
collectionView.heightAnchor.constraint(equalToConstant: 80).priority(.defaultHigh),
])
collectionView.delegate = self
collectionView.dataSource = self
}
override func layoutSubviews() {
super.layoutSubviews()
collectionView.collectionViewLayout.invalidateLayout()
}
}
extension PickServerCategoriesCell: UICollectionViewDelegateFlowLayout {
@ -74,7 +93,8 @@ extension PickServerCategoriesCell: UICollectionViewDelegateFlowLayout {
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
layoutIfNeeded()
return UIEdgeInsets(top: 0, left: metricView.frame.minX - collectionView.frame.minX, bottom: 0, right: collectionView.frame.maxX - metricView.frame.maxX)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {

View File

@ -22,8 +22,9 @@ class PickServerCell: UITableViewCell {
case expand
}
private var bgView: UIView = {
private var containerView: UIView = {
let view = UIView()
view.layoutMargins = UIEdgeInsets(top: 16, left: 16, bottom: 10, right: 16)
view.backgroundColor = Asset.Colors.lightWhite.color
view.translatesAutoresizingMaskIntoConstraints = false
return view
@ -193,16 +194,16 @@ extension PickServerCell {
selectionStyle = .none
backgroundColor = .clear
contentView.addSubview(bgView)
contentView.addSubview(domainLabel)
contentView.addSubview(checkbox)
contentView.addSubview(descriptionLabel)
contentView.addSubview(seperator)
contentView.addSubview(containerView)
containerView.addSubview(domainLabel)
containerView.addSubview(checkbox)
containerView.addSubview(descriptionLabel)
containerView.addSubview(seperator)
contentView.addSubview(expandButton)
containerView.addSubview(expandButton)
// Always add the expandbox which contains elements only visible in expand mode
contentView.addSubview(expandBox)
containerView.addSubview(expandBox)
expandBox.addSubview(thumbImageView)
expandBox.addSubview(infoStackView)
expandBox.isHidden = true
@ -217,68 +218,63 @@ extension PickServerCell {
let expandButtonTopConstraintInCollapse = expandButton.topAnchor.constraint(equalTo: descriptionLabel.lastBaselineAnchor, constant: 12).priority(.required)
collapseConstraints.append(expandButtonTopConstraintInCollapse)
let expandButtonTopConstraintInExpand = expandButton.topAnchor.constraint(equalTo: expandBox.bottomAnchor, constant: 8).priority(.required)
let expandButtonTopConstraintInExpand = expandButton.topAnchor.constraint(equalTo: expandBox.bottomAnchor, constant: 8).priority(.defaultHigh)
expandConstraints.append(expandButtonTopConstraintInExpand)
// domainLabel.setContentHuggingPriority(.required - 1, for: .vertical)
// domainLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical)
// descriptionLabel.setContentHuggingPriority(.required - 2, for: .vertical)
// descriptionLabel.setContentCompressionResistancePriority(.required - 2, for: .vertical)
domainLabel.setContentHuggingPriority(.required, for: .vertical)
domainLabel.setContentCompressionResistancePriority(.required, for: .vertical)
descriptionLabel.setContentHuggingPriority(.defaultHigh, for: .vertical)
descriptionLabel.setContentCompressionResistancePriority(.defaultHigh, for: .vertical)
NSLayoutConstraint.activate([
// Set background view
bgView.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
bgView.topAnchor.constraint(equalTo: contentView.topAnchor),
contentView.readableContentGuide.trailingAnchor.constraint(equalTo: bgView.trailingAnchor),
contentView.bottomAnchor.constraint(equalTo: bgView.bottomAnchor, constant: 1),
containerView.topAnchor.constraint(equalTo: contentView.topAnchor),
containerView.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
contentView.readableContentGuide.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
contentView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: 1),
// Set bottom separator
seperator.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
contentView.readableContentGuide.trailingAnchor.constraint(equalTo: seperator.trailingAnchor),
contentView.bottomAnchor.constraint(equalTo: seperator.bottomAnchor),
seperator.heightAnchor.constraint(equalToConstant: 1),
seperator.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
containerView.trailingAnchor.constraint(equalTo: seperator.trailingAnchor),
containerView.bottomAnchor.constraint(equalTo: seperator.bottomAnchor),
seperator.heightAnchor.constraint(equalToConstant: 1).priority(.defaultHigh),
domainLabel.leadingAnchor.constraint(equalTo: bgView.leadingAnchor, constant: 16),
domainLabel.topAnchor.constraint(equalTo: bgView.topAnchor, constant: 16),
domainLabel.topAnchor.constraint(equalTo: containerView.layoutMarginsGuide.topAnchor),
domainLabel.leadingAnchor.constraint(equalTo: containerView.layoutMarginsGuide.leadingAnchor),
checkbox.widthAnchor.constraint(equalToConstant: 23),
checkbox.heightAnchor.constraint(equalToConstant: 22),
bgView.trailingAnchor.constraint(equalTo: checkbox.trailingAnchor, constant: 16),
containerView.layoutMarginsGuide.trailingAnchor.constraint(equalTo: checkbox.trailingAnchor),
checkbox.leadingAnchor.constraint(equalTo: domainLabel.trailingAnchor, constant: 16),
checkbox.centerYAnchor.constraint(equalTo: domainLabel.centerYAnchor),
descriptionLabel.leadingAnchor.constraint(equalTo: bgView.leadingAnchor, constant: 16),
descriptionLabel.topAnchor.constraint(equalTo: domainLabel.firstBaselineAnchor, constant: 8).priority(.required),
bgView.trailingAnchor.constraint(equalTo: descriptionLabel.trailingAnchor, constant: 16),
descriptionLabel.leadingAnchor.constraint(equalTo: containerView.layoutMarginsGuide.leadingAnchor),
descriptionLabel.topAnchor.constraint(equalTo: domainLabel.bottomAnchor, constant: 8),
containerView.layoutMarginsGuide.trailingAnchor.constraint(equalTo: descriptionLabel.trailingAnchor),
// Set expandBox constraints
expandBox.leadingAnchor.constraint(equalTo: bgView.leadingAnchor, constant: 16),
bgView.trailingAnchor.constraint(equalTo: expandBox.trailingAnchor, constant: 16),
expandBox.leadingAnchor.constraint(equalTo: containerView.layoutMarginsGuide.leadingAnchor),
containerView.layoutMarginsGuide.trailingAnchor.constraint(equalTo: expandBox.trailingAnchor),
expandBox.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 8),
expandBox.bottomAnchor.constraint(equalTo: infoStackView.bottomAnchor).priority(.defaultHigh),
thumbImageView.topAnchor.constraint(equalTo: expandBox.topAnchor),
thumbImageView.leadingAnchor.constraint(equalTo: expandBox.leadingAnchor),
expandBox.trailingAnchor.constraint(equalTo: thumbImageView.trailingAnchor),
thumbImageView.topAnchor.constraint(equalTo: expandBox.topAnchor).priority(.defaultHigh),
thumbImageView.heightAnchor.constraint(equalTo: thumbImageView.widthAnchor, multiplier: 151.0 / 303.0).priority(.defaultHigh),
infoStackView.leadingAnchor.constraint(equalTo: expandBox.leadingAnchor),
expandBox.trailingAnchor.constraint(equalTo: infoStackView.trailingAnchor),
infoStackView.topAnchor.constraint(equalTo: thumbImageView.bottomAnchor, constant: 16),
expandButton.leadingAnchor.constraint(equalTo: bgView.leadingAnchor, constant: 16),
bgView.trailingAnchor.constraint(equalTo: expandButton.trailingAnchor, constant: 16),
bgView.bottomAnchor.constraint(equalTo: expandButton.bottomAnchor, constant: 8),
expandButton.leadingAnchor.constraint(equalTo: containerView.layoutMarginsGuide.leadingAnchor),
containerView.layoutMarginsGuide.trailingAnchor.constraint(equalTo: expandButton.trailingAnchor),
containerView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: expandButton.bottomAnchor),
])
NSLayoutConstraint.activate(collapseConstraints)
expandButton.addTarget(self, action: #selector(expandButtonDidClicked(_:)), for: .touchUpInside)
domainLabel.setContentHuggingPriority(.required - 1, for: .vertical)
domainLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical)
descriptionLabel.setContentHuggingPriority(.required - 2, for: .vertical)
descriptionLabel.setContentCompressionResistancePriority(.required - 2, for: .vertical)
expandButton.addTarget(self, action: #selector(expandButtonDidClicked(_:)), for: .touchUpInside)
}
private func makeVerticalInfoStackView(arrangedView: UIView...) -> UIStackView {

View File

@ -11,7 +11,7 @@ final class PickServerTitleCell: UITableViewCell {
let titleLabel: UILabel = {
let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: UIFont.boldSystemFont(ofSize: 34))
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: .systemFont(ofSize: 34, weight: .bold))
label.textColor = Asset.Colors.Label.primary.color
label.text = L10n.Scene.ServerPicker.title
label.adjustsFontForContentSizeCategory = true

View File

@ -21,18 +21,13 @@ final class MastodonRegisterViewController: UIViewController, NeedsDependency, O
let tapGestureRecognizer = UITapGestureRecognizer.singleTapGestureRecognizer
let statusBarBackground: UIView = {
let view = UIView()
view.backgroundColor = Asset.Colors.Background.onboardingBackground.color
return view
}()
let scrollView: UIScrollView = {
let scrollview = UIScrollView()
scrollview.showsVerticalScrollIndicator = false
scrollview.translatesAutoresizingMaskIntoConstraints = false
scrollview.keyboardDismissMode = .interactive
scrollview.alwaysBounceVertical = true
scrollview.clipsToBounds = false // make content could display over bleeding
scrollview.translatesAutoresizingMaskIntoConstraints = false
return scrollview
}()
@ -171,16 +166,9 @@ final class MastodonRegisterViewController: UIViewController, NeedsDependency, O
}()
let signUpButton: UIButton = {
let button = UIButton(type: .system)
button.titleLabel?.font = .preferredFont(forTextStyle: .headline)
button.setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightBrandBlue.color), for: .normal)
button.setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightDisabled.color), for: .disabled)
let button = PrimaryActionButton()
button.isEnabled = false
button.setTitleColor(.white, for: .normal)
button.setTitle(L10n.Common.Controls.Actions.continue, for: .normal)
button.layer.masksToBounds = true
button.layer.cornerRadius = 8
button.layer.cornerCurve = .continuous
return button
}()
@ -196,7 +184,8 @@ extension MastodonRegisterViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.setupOnboardingAppearance()
setupOnboardingAppearance()
defer { setupNavigationBarBackgroundView() }
domainLabel.text = "@" + viewModel.domain + " "
domainLabel.sizeToFit()
@ -247,15 +236,6 @@ extension MastodonRegisterViewController {
stackView.widthAnchor.constraint(equalTo: scrollView.contentLayoutGuide.widthAnchor),
scrollView.contentLayoutGuide.bottomAnchor.constraint(equalTo: stackView.bottomAnchor),
])
statusBarBackground.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(statusBarBackground)
NSLayoutConstraint.activate([
statusBarBackground.topAnchor.constraint(equalTo: view.topAnchor),
statusBarBackground.leadingAnchor.constraint(equalTo: view.leadingAnchor),
statusBarBackground.trailingAnchor.constraint(equalTo: view.trailingAnchor),
statusBarBackground.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor),
])
// photoview
photoView.translatesAutoresizingMaskIntoConstraints = false
@ -299,7 +279,7 @@ extension MastodonRegisterViewController {
signUpButton.translatesAutoresizingMaskIntoConstraints = false
stackView.addArrangedSubview(signUpButton)
NSLayoutConstraint.activate([
signUpButton.heightAnchor.constraint(equalToConstant: 46).priority(.defaultHigh),
signUpButton.heightAnchor.constraint(equalToConstant: MastodonRegisterViewController.actionButtonHeight).priority(.defaultHigh),
])
signUpActivityIndicatorView.translatesAutoresizingMaskIntoConstraints = false
@ -532,13 +512,19 @@ extension MastodonRegisterViewController {
let password = viewModel.password.value
if let rules = viewModel.instance.rules, !rules.isEmpty {
// show server rules before register
let mastodonServerRulesViewModel = MastodonServerRulesViewModel(
context: context,
domain: viewModel.domain,
rules: rules
)
viewModel.isRegistering.value = false
view.endEditing(true)
coordinator.present(scene: .mastodonServerRules(viewModel: mastodonServerRulesViewModel), from: self, transition: .show)
return
} else {
// register without show server rules
}
let query = Mastodon.API.Account.RegisterQuery(
@ -550,34 +536,40 @@ extension MastodonRegisterViewController {
locale: "en" // TODO:
)
context.apiService.accountRegister(
domain: viewModel.domain,
query: query,
authorization: viewModel.applicationAuthorization
)
.receive(on: DispatchQueue.main)
.sink { [weak self] completion in
guard let self = self else { return }
self.viewModel.isRegistering.value = false
switch completion {
case .failure(let error):
self.viewModel.error.send(error)
case .finished:
break
}
} receiveValue: { [weak self] response in
guard let self = self else { return }
let userToken = response.value
let alertController = UIAlertController(title: L10n.Scene.Register.success, message: L10n.Scene.Register.checkEmail, preferredStyle: .alert)
let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default) { [weak self] _ in
guard let self = self else { return }
let viewModel = MastodonConfirmEmailViewModel(context: self.context, email: email, authenticateInfo: self.viewModel.authenticateInfo, userToken: userToken)
self.coordinator.present(scene: .mastodonConfirmEmail(viewModel: viewModel), from: self, transition: .show)
}
alertController.addAction(okAction)
self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
}
.store(in: &disposeBag)
}
}
extension MastodonRegisterViewController {
// func register(query: Mastodon.API.Account.RegisterQuery) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.Token>, Error> {
// context.apiService.accountRegister(
// domain: viewModel.domain,
// query: query,
// authorization: viewModel.applicationAuthorization
// )
// .receive(on: DispatchQueue.main)
// .sink { [weak self] completion in
// guard let self = self else { return }
// self.viewModel.isRegistering.value = false
// switch completion {
// case .failure(let error):
// self.viewModel.error.send(error)
// case .finished:
// break
// }
// } receiveValue: { [weak self] response in
// guard let self = self else { return }
// let userToken = response.value
//
// let alertController = UIAlertController(title: L10n.Scene.Register.success, message: L10n.Scene.Register.checkEmail, preferredStyle: .alert)
// let okAction = UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default) { [weak self] _ in
// guard let self = self else { return }
// let viewModel = MastodonConfirmEmailViewModel(context: self.context, email: email, authenticateInfo: self.viewModel.authenticateInfo, userToken: userToken)
// self.coordinator.present(scene: .mastodonConfirmEmail(viewModel: viewModel), from: self, transition: .show)
// }
// alertController.addAction(okAction)
// self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
// }
// .store(in: &disposeBag)
// }
}

View File

@ -8,7 +8,7 @@
import os.log
import UIKit
final class MastodonServerRulesViewController: UIViewController, NeedsDependency ,OnboardingViewControllerAppearance{
final class MastodonServerRulesViewController: UIViewController, NeedsDependency {
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
weak var coordinator: SceneCoordinator! { willSet { precondition(!isViewLoaded) } }
@ -17,7 +17,7 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
let largeTitleLabel: UILabel = {
let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: UIFont.boldSystemFont(ofSize: 34))
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: .systemFont(ofSize: 34, weight: .bold))
label.textColor = .label
label.text = L10n.Scene.ServerRules.title
return label
@ -57,19 +57,18 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
}()
let confirmButton: UIButton = {
let button = UIButton(type: .system)
let button = PrimaryActionButton()
button.titleLabel?.font = .preferredFont(forTextStyle: .headline)
button.setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightBrandBlue.color), for: .normal)
button.setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightDisabled.color), for: .disabled)
button.setTitleColor(Asset.Colors.Label.primary.color, for: .normal)
button.setTitleColor(.white, for: .normal)
button.setTitle(L10n.Scene.ServerRules.Button.confirm, for: .normal)
button.layer.masksToBounds = true
button.layer.cornerRadius = 8
button.layer.cornerCurve = .continuous
return button
}()
let scrollView = UIScrollView()
let scrollView: UIScrollView = {
let scrollView = UIScrollView()
scrollView.alwaysBounceVertical = true
return scrollView
}()
}
@ -92,8 +91,7 @@ extension MastodonServerRulesViewController {
confirmButton.translatesAutoresizingMaskIntoConstraints = false
bottonContainerView.addSubview(confirmButton)
NSLayoutConstraint.activate([
bottonContainerView.bottomAnchor.constraint(greaterThanOrEqualTo: confirmButton.bottomAnchor, constant: 16),
bottonContainerView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: confirmButton.bottomAnchor).priority(.defaultHigh),
bottonContainerView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: confirmButton.bottomAnchor, constant: MastodonServerRulesViewController.viewBottomPaddingHeight),
confirmButton.leadingAnchor.constraint(equalTo: bottonContainerView.readableContentGuide.leadingAnchor),
confirmButton.trailingAnchor.constraint(equalTo: bottonContainerView.readableContentGuide.trailingAnchor),
confirmButton.heightAnchor.constraint(equalToConstant: 46).priority(.defaultHigh),
@ -111,7 +109,7 @@ extension MastodonServerRulesViewController {
scrollView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(scrollView)
NSLayoutConstraint.activate([
scrollView.frameLayoutGuide.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor),
scrollView.frameLayoutGuide.topAnchor.constraint(equalTo: view.topAnchor),
scrollView.frameLayoutGuide.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor),
view.readableContentGuide.trailingAnchor.constraint(equalTo: scrollView.frameLayoutGuide.trailingAnchor),
scrollView.frameLayoutGuide.widthAnchor.constraint(equalTo: scrollView.contentLayoutGuide.widthAnchor),
@ -122,7 +120,7 @@ extension MastodonServerRulesViewController {
stackView.axis = .vertical
stackView.distribution = .fill
stackView.spacing = 10
stackView.layoutMargins = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
stackView.layoutMargins = UIEdgeInsets(top: 20, left: 0, bottom: 20, right: 0)
stackView.addArrangedSubview(largeTitleLabel)
stackView.addArrangedSubview(subtitleLabel)
stackView.addArrangedSubview(rulesLabel)
@ -140,12 +138,6 @@ extension MastodonServerRulesViewController {
confirmButton.addTarget(self, action: #selector(MastodonServerRulesViewController.confirmButtonPressed(_:)), for: .touchUpInside)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
}
}
extension MastodonServerRulesViewController {
@ -155,6 +147,9 @@ extension MastodonServerRulesViewController {
}
}
// MARK: - OnboardingViewControllerAppearance
extension MastodonServerRulesViewController: OnboardingViewControllerAppearance { }
#if canImport(SwiftUI) && DEBUG
import SwiftUI

View File

@ -13,15 +13,16 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
weak var coordinator: SceneCoordinator! { willSet { precondition(!isViewLoaded) } }
let logoImageView: UIImageView = {
let imageView = UIImageView(image: Asset.welcomeLogo.image)
private(set) lazy var logoImageView: UIImageView = {
let image = view.traitCollection.userInterfaceIdiom == .phone ? Asset.Welcome.mastodonLogo.image : Asset.Welcome.mastodonLogoLarge.image
let imageView = UIImageView(image: image)
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
let sloganLabel: UILabel = {
let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: UIFont.boldSystemFont(ofSize: 34))
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: .systemFont(ofSize: 34, weight: .bold))
label.textColor = Asset.Colors.Label.primary.color
label.text = L10n.Scene.Welcome.slogan
label.adjustsFontForContentSizeCategory = true
@ -31,8 +32,7 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
}()
let signUpButton: PrimaryActionButton = {
let button = PrimaryActionButton(type: .system)
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold))
let button = PrimaryActionButton()
button.setTitle(L10n.Common.Controls.Actions.signUp, for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
return button
@ -54,18 +54,13 @@ extension WelcomeViewController {
override func viewDidLoad() {
super.viewDidLoad()
overrideUserInterfaceStyle = .light
view.backgroundColor = Asset.Colors.Background.onboardingBackground.color
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.isTranslucent = true
navigationController?.view.backgroundColor = .clear
setupOnboardingAppearance()
view.addSubview(logoImageView)
NSLayoutConstraint.activate([
logoImageView.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor),
logoImageView.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor, constant: 35),
view.readableContentGuide.trailingAnchor.constraint(equalTo: logoImageView.trailingAnchor, constant: 35),
logoImageView.topAnchor.constraint(equalTo: view.readableContentGuide.topAnchor, constant: 46),
logoImageView.heightAnchor.constraint(equalTo: logoImageView.widthAnchor, multiplier: 65.4/265.1),
])
@ -81,22 +76,19 @@ extension WelcomeViewController {
NSLayoutConstraint.activate([
signInButton.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor, constant: 12),
view.readableContentGuide.trailingAnchor.constraint(equalTo: signInButton.trailingAnchor, constant: 12),
view.readableContentGuide.bottomAnchor.constraint(equalTo: signInButton.bottomAnchor, constant: 11),
view.layoutMarginsGuide.bottomAnchor.constraint(equalTo: signInButton.bottomAnchor, constant: WelcomeViewController.viewBottomPaddingHeight),
signInButton.heightAnchor.constraint(equalToConstant: 46).priority(.defaultHigh),
signInButton.topAnchor.constraint(equalTo: signUpButton.bottomAnchor, constant: 9),
signUpButton.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor, constant: 12),
view.readableContentGuide.trailingAnchor.constraint(equalTo: signUpButton.trailingAnchor, constant: 12),
signInButton.topAnchor.constraint(equalTo: signUpButton.bottomAnchor, constant: 5)
signUpButton.heightAnchor.constraint(equalToConstant: WelcomeViewController.actionButtonHeight).priority(.defaultHigh),
])
signUpButton.addTarget(self, action: #selector(signUpButtonDidClicked(_:)), for: .touchUpInside)
signInButton.addTarget(self, action: #selector(signInButtonDidClicked(_:)), for: .touchUpInside)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: false)
}
}
extension WelcomeViewController {
@ -110,3 +102,6 @@ extension WelcomeViewController {
coordinator.present(scene: .pickServer(viewMode: PickServerViewModel(context: context, mode: .signIn)), from: self, transition: .show)
}
}
// MARK: - OnboardingViewControllerAppearance
extension WelcomeViewController: OnboardingViewControllerAppearance { }

View File

@ -13,6 +13,7 @@ class PrimaryActionButton: UIButton {
lazy var activityIndicator: UIActivityIndicatorView = {
let indicator = UIActivityIndicatorView(style: .medium)
indicator.color = .white
indicator.hidesWhenStopped = true
indicator.translatesAutoresizingMaskIntoConstraints = false
return indicator
@ -29,6 +30,19 @@ class PrimaryActionButton: UIButton {
super.init(coder: coder)
_init()
}
}
extension PrimaryActionButton {
private func _init() {
titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold))
setTitleColor(.white, for: .normal)
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.Button.highlight.color), for: .normal)
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.Button.highlight.color.withAlphaComponent(0.5)), for: .highlighted)
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.Button.disabled.color), for: .disabled)
applyCornerRadius(radius: 10)
}
func showLoading() {
guard !isLoading else { return }
@ -55,14 +69,3 @@ class PrimaryActionButton: UIButton {
self.setTitle(originalButtonTitle, for: .disabled)
}
}
extension PrimaryActionButton {
private func _init() {
titleLabel?.font = .preferredFont(forTextStyle: .headline)
setTitleColor(Asset.Colors.lightWhite.color, for: .normal)
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightBrandBlue.color), for: .normal)
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.lightDisabled.color), for: .disabled)
applyCornerRadius(radius: 10)
setInsets(forContentPadding: UIEdgeInsets(top: 12, left: 0, bottom: 12, right: 0), imageTitlePadding: 0)
}
}