Skip to content

Commit 2a10e00

Browse files
author
Giorgio Ruscigno
committed
Add JetpackPromptsView, a view that contain all the animated prompts in the new Jetpack prologue screen
1 parent 7567ad5 commit 2a10e00

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
import SwiftUI
3+
import UIKit
4+
5+
struct JetpackPromptsView: View {
6+
@ObservedObject private var viewModel: JetpackPromptsViewModel
7+
8+
init(viewModel: JetpackPromptsViewModel) {
9+
self.viewModel = viewModel
10+
}
11+
12+
var body: some View {
13+
ZStack(alignment: .topLeading) {
14+
ForEach(viewModel.prompts) { prompt in
15+
JetpackPromptView(data: prompt, fontSize: viewModel.fontSize)
16+
.frame(height: prompt.frameHeight)
17+
.offset(y: viewModel.offset(for: prompt))
18+
.opacity(viewModel.opacity(for: prompt))
19+
}
20+
}
21+
}
22+
}

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,12 @@
585585
3F44DD58289C379C006334CD /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 3F44DD57289C379C006334CD /* Lottie */; };
586586
3F46AAFE25BF5D6300CE2E98 /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F46AB0225BF5D6300CE2E98 /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; };
587587
3F46AB0025BF5D6300CE2E98 /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F46AB0225BF5D6300CE2E98 /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; };
588+
3F46EEC728BC4935004F02B2 /* JetpackPrompt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EEC628BC4935004F02B2 /* JetpackPrompt.swift */; };
589+
3F46EEC928BC493E004F02B2 /* JetpackPromptsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EEC828BC493E004F02B2 /* JetpackPromptsViewModel.swift */; };
590+
3F46EECD28BC4962004F02B2 /* JetpackPromptsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EECA28BC4962004F02B2 /* JetpackPromptsView.swift */; };
591+
3F46EECE28BC4962004F02B2 /* JetpackLandingScreenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EECB28BC4962004F02B2 /* JetpackLandingScreenView.swift */; };
592+
3F46EECF28BC4962004F02B2 /* JetpackPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EECC28BC4962004F02B2 /* JetpackPromptView.swift */; };
593+
3F46EED128BFF339004F02B2 /* JetpackPromptsConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F46EED028BFF339004F02B2 /* JetpackPromptsConfiguration.swift */; };
588594
3F4D035028A56F9B00F0A4FD /* CircularImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F4D034F28A56F9B00F0A4FD /* CircularImageButton.swift */; };
589595
3F4D035128A56F9B00F0A4FD /* CircularImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F4D034F28A56F9B00F0A4FD /* CircularImageButton.swift */; };
590596
3F4D035328A5BFCE00F0A4FD /* JetpackWordPressLogoAnimation_ltr.json in Resources */ = {isa = PBXBuildFile; fileRef = 3F4D035228A5BFCE00F0A4FD /* JetpackWordPressLogoAnimation_ltr.json */; };
@@ -5614,6 +5620,12 @@
56145620
3F4370402893207C00475B6E /* JetpackOverlayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackOverlayView.swift; sourceTree = "<group>"; };
56155621
3F43704328932F0100475B6E /* JetpackBrandingCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackBrandingCoordinator.swift; sourceTree = "<group>"; };
56165622
3F46AB0125BF5D6300CE2E98 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; name = Base; path = Base.lproj/Sites.intentdefinition; sourceTree = "<group>"; };
5623+
3F46EEC628BC4935004F02B2 /* JetpackPrompt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackPrompt.swift; sourceTree = "<group>"; };
5624+
3F46EEC828BC493E004F02B2 /* JetpackPromptsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackPromptsViewModel.swift; sourceTree = "<group>"; };
5625+
3F46EECA28BC4962004F02B2 /* JetpackPromptsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackPromptsView.swift; sourceTree = "<group>"; };
5626+
3F46EECB28BC4962004F02B2 /* JetpackLandingScreenView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackLandingScreenView.swift; sourceTree = "<group>"; };
5627+
3F46EECC28BC4962004F02B2 /* JetpackPromptView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackPromptView.swift; sourceTree = "<group>"; };
5628+
3F46EED028BFF339004F02B2 /* JetpackPromptsConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackPromptsConfiguration.swift; sourceTree = "<group>"; };
56175629
3F4D034F28A56F9B00F0A4FD /* CircularImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircularImageButton.swift; sourceTree = "<group>"; };
56185630
3F4D035228A5BFCE00F0A4FD /* JetpackWordPressLogoAnimation_ltr.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = JetpackWordPressLogoAnimation_ltr.json; sourceTree = "<group>"; };
56195631
3F4EB39128AC561600B8DD86 /* JetpackWordPressLogoAnimation_rtl.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = JetpackWordPressLogoAnimation_rtl.json; sourceTree = "<group>"; };
@@ -9914,6 +9926,43 @@
99149926
path = Coordinator;
99159927
sourceTree = "<group>";
99169928
};
9929+
3F46EEC028BC48D1004F02B2 /* New Landing Screen */ = {
9930+
isa = PBXGroup;
9931+
children = (
9932+
3F46EEC328BC4913004F02B2 /* Model */,
9933+
3F46EEC528BC4922004F02B2 /* ViewModel */,
9934+
3F46EEC428BC491B004F02B2 /* Views */,
9935+
);
9936+
path = "New Landing Screen";
9937+
sourceTree = "<group>";
9938+
};
9939+
3F46EEC328BC4913004F02B2 /* Model */ = {
9940+
isa = PBXGroup;
9941+
children = (
9942+
3F46EEC628BC4935004F02B2 /* JetpackPrompt.swift */,
9943+
);
9944+
path = Model;
9945+
sourceTree = "<group>";
9946+
};
9947+
3F46EEC428BC491B004F02B2 /* Views */ = {
9948+
isa = PBXGroup;
9949+
children = (
9950+
3F46EECB28BC4962004F02B2 /* JetpackLandingScreenView.swift */,
9951+
3F46EECC28BC4962004F02B2 /* JetpackPromptView.swift */,
9952+
3F46EECA28BC4962004F02B2 /* JetpackPromptsView.swift */,
9953+
);
9954+
path = Views;
9955+
sourceTree = "<group>";
9956+
};
9957+
3F46EEC528BC4922004F02B2 /* ViewModel */ = {
9958+
isa = PBXGroup;
9959+
children = (
9960+
3F46EED028BFF339004F02B2 /* JetpackPromptsConfiguration.swift */,
9961+
3F46EEC828BC493E004F02B2 /* JetpackPromptsViewModel.swift */,
9962+
);
9963+
path = ViewModel;
9964+
sourceTree = "<group>";
9965+
};
99179966
3F5094592454EC7A00C4470B /* Tabbed Reader */ = {
99189967
isa = PBXGroup;
99199968
children = (
@@ -14184,6 +14233,7 @@
1418414233
C7124E4B2638527D00929318 /* NUX */ = {
1418514234
isa = PBXGroup;
1418614235
children = (
14236+
3F46EEC028BC48D1004F02B2 /* New Landing Screen */,
1418714237
C7124E912638905B00929318 /* StarFieldView.swift */,
1418814238
C7124E4D2638528F00929318 /* JetpackPrologueViewController.swift */,
1418914239
C7124E4C2638528F00929318 /* JetpackPrologueViewController.xib */,
@@ -21039,6 +21089,7 @@
2103921089
FABB21C42602FC2C00C8785C /* PostService+Revisions.swift in Sources */,
2104021090
FABB21C52602FC2C00C8785C /* SourcePostAttribution.m in Sources */,
2104121091
FABB21C62602FC2C00C8785C /* MySitesCoordinator.swift in Sources */,
21092+
3F46EED128BFF339004F02B2 /* JetpackPromptsConfiguration.swift in Sources */,
2104221093
FABB21C72602FC2C00C8785C /* MenuItem+ViewDesign.m in Sources */,
2104321094
FABB21C92602FC2C00C8785C /* ReaderInterestsStyleGuide.swift in Sources */,
2104421095
FABB21CA2602FC2C00C8785C /* SiteStatsInsightsTableViewController.swift in Sources */,
@@ -21204,6 +21255,7 @@
2120421255
FABB224A2602FC2C00C8785C /* ReaderFollowedSitesViewController.swift in Sources */,
2120521256
FABB224B2602FC2C00C8785C /* AnnouncementsCache.swift in Sources */,
2120621257
8B74A9A9268E3C68003511CE /* RewindStatus+multiSite.swift in Sources */,
21258+
3F46EECF28BC4962004F02B2 /* JetpackPromptView.swift in Sources */,
2120721259
FABB224C2602FC2C00C8785C /* GravatarUploader.swift in Sources */,
2120821260
FABB224D2602FC2C00C8785C /* NotificationSettingDetailsViewController.swift in Sources */,
2120921261
FABB224E2602FC2C00C8785C /* AztecMediaPickingCoordinator.swift in Sources */,
@@ -21316,6 +21368,7 @@
2131621368
C7AFF875283C0ADC000E01DF /* UIApplication+Helpers.swift in Sources */,
2131721369
FABB22A52602FC2C00C8785C /* SignupEpilogueViewController.swift in Sources */,
2131821370
FABB22A62602FC2C00C8785C /* TenorPicker.swift in Sources */,
21371+
3F46EECD28BC4962004F02B2 /* JetpackPromptsView.swift in Sources */,
2131921372
FAB985C22697550C00B172A3 /* NoResultsViewController+StatsModule.swift in Sources */,
2132021373
FABB22A72602FC2C00C8785C /* BlogListViewController+Activity.swift in Sources */,
2132121374
3F810A5B2616870C00ADDCC2 /* UnifiedPrologueIntroContentView.swift in Sources */,
@@ -21417,6 +21470,7 @@
2141721470
FABB22F12602FC2C00C8785C /* WPAccount+AccountSettings.swift in Sources */,
2141821471
FABB22F22602FC2C00C8785C /* Route.swift in Sources */,
2141921472
FABB22F32602FC2C00C8785C /* RegisterDomainDetailsViewController+Cells.swift in Sources */,
21473+
3F46EEC728BC4935004F02B2 /* JetpackPrompt.swift in Sources */,
2142021474
175CC1712720548700622FB4 /* DomainExpiryDateFormatter.swift in Sources */,
2142121475
FABB22F42602FC2C00C8785C /* ReaderStreamViewController+Sharing.swift in Sources */,
2142221476
FABB22F52602FC2C00C8785C /* FilterTabBar.swift in Sources */,
@@ -21653,6 +21707,7 @@
2165321707
FABB23B92602FC2C00C8785C /* BlogListViewController+SiteCreation.swift in Sources */,
2165421708
FABB23BA2602FC2C00C8785C /* CommentAnalytics.swift in Sources */,
2165521709
FABB23BB2602FC2C00C8785C /* TableViewHeaderDetailView.swift in Sources */,
21710+
3F46EECE28BC4962004F02B2 /* JetpackLandingScreenView.swift in Sources */,
2165621711
FABB23BC2602FC2C00C8785C /* MenuItemAbstractView.m in Sources */,
2165721712
FABB23BD2602FC2C00C8785C /* LocationService.m in Sources */,
2165821713
808C579027C7FB1A0099A92C /* ButtonScrollView.swift in Sources */,
@@ -21983,6 +22038,7 @@
2198322038
FABB24D02602FC2C00C8785C /* RewindStatusRow.swift in Sources */,
2198422039
8BD34F0C27D14B3C005E931C /* Blog+DashboardState.swift in Sources */,
2198522040
FABB24D12602FC2C00C8785C /* LinkBehavior.swift in Sources */,
22041+
3F46EEC928BC493E004F02B2 /* JetpackPromptsViewModel.swift in Sources */,
2198622042
FABB24D22602FC2C00C8785C /* ReaderHelpers.swift in Sources */,
2198722043
FABB24D32602FC2C00C8785C /* SubjectContentStyles.swift in Sources */,
2198822044
FABB24D42602FC2C00C8785C /* AbstractPost.m in Sources */,

0 commit comments

Comments
 (0)