Skip to content

Commit

Permalink
Add the Use Case selection screen to the onboarding flow.
Browse files Browse the repository at this point in the history
Store the selection in the UserSession for later so it can be used for any default settings and to be included as a user property in analytics when opted in.
  • Loading branch information
pixlwave committed Jan 31, 2022
1 parent a3a1678 commit 715ab3a
Show file tree
Hide file tree
Showing 39 changed files with 978 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_community.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_community_dark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_icon.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_personal.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_personal_dark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_work.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "onboarding_use_case_work_dark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@
"onboarding_splash_page_4_title_no_pun" = "Messaging for your team.";
"onboarding_splash_page_4_message" = "Element is also great for the workplace. It’s trusted by the world’s most secure organisations.";

"onboarding_use_case_title" = "Who will you chat to the most?";
"onboarding_use_case_message" = "We’ll help you get connected.";
"onboarding_use_case_personal_messaging" = "Friends and family";
"onboarding_use_case_work_messaging" = "Coworkers and teams";
"onboarding_use_case_community_messaging" = "Online community members";
/* The placeholder string contains onboarding_use_case_skip_button as a tappable action */
"onboarding_use_case_not_sure_yet" = "Not sure yet? You can %@";
"onboarding_use_case_skip_button" = "skip this question";
"onboarding_use_case_existing_server_message" = "Looking to join an existing server?";
"onboarding_use_case_existing_server_button" = "Connect to server";

// Authentication
"auth_login" = "Log in";
"auth_register" = "Register";
Expand Down
7 changes: 7 additions & 0 deletions Riot/Generated/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ internal enum Asset {
internal static let onboardingSplashScreenPage3Dark = ImageAsset(name: "OnboardingSplashScreenPage3Dark")
internal static let onboardingSplashScreenPage4 = ImageAsset(name: "OnboardingSplashScreenPage4")
internal static let onboardingSplashScreenPage4Dark = ImageAsset(name: "OnboardingSplashScreenPage4Dark")
internal static let onboardingUseCaseCommunity = ImageAsset(name: "onboarding_use_case_community")
internal static let onboardingUseCaseCommunityDark = ImageAsset(name: "onboarding_use_case_community_dark")
internal static let onboardingUseCaseIcon = ImageAsset(name: "onboarding_use_case_icon")
internal static let onboardingUseCasePersonal = ImageAsset(name: "onboarding_use_case_personal")
internal static let onboardingUseCasePersonalDark = ImageAsset(name: "onboarding_use_case_personal_dark")
internal static let onboardingUseCaseWork = ImageAsset(name: "onboarding_use_case_work")
internal static let onboardingUseCaseWorkDark = ImageAsset(name: "onboarding_use_case_work_dark")
internal static let peopleEmptyScreenArtwork = ImageAsset(name: "people_empty_screen_artwork")
internal static let peopleEmptyScreenArtworkDark = ImageAsset(name: "people_empty_screen_artwork_dark")
internal static let peopleFloatingAction = ImageAsset(name: "people_floating_action")
Expand Down
36 changes: 36 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,42 @@ public class VectorL10n: NSObject {
public static var onboardingSplashRegisterButtonTitle: String {
return VectorL10n.tr("Vector", "onboarding_splash_register_button_title")
}
/// Online community members
public static var onboardingUseCaseCommunityMessaging: String {
return VectorL10n.tr("Vector", "onboarding_use_case_community_messaging")
}
/// Connect to server
public static var onboardingUseCaseExistingServerButton: String {
return VectorL10n.tr("Vector", "onboarding_use_case_existing_server_button")
}
/// Looking to join an existing server?
public static var onboardingUseCaseExistingServerMessage: String {
return VectorL10n.tr("Vector", "onboarding_use_case_existing_server_message")
}
/// We’ll help you get connected.
public static var onboardingUseCaseMessage: String {
return VectorL10n.tr("Vector", "onboarding_use_case_message")
}
/// Not sure yet? You can %@
public static func onboardingUseCaseNotSureYet(_ p1: String) -> String {
return VectorL10n.tr("Vector", "onboarding_use_case_not_sure_yet", p1)
}
/// Friends and family
public static var onboardingUseCasePersonalMessaging: String {
return VectorL10n.tr("Vector", "onboarding_use_case_personal_messaging")
}
/// skip this question
public static var onboardingUseCaseSkipButton: String {
return VectorL10n.tr("Vector", "onboarding_use_case_skip_button")
}
/// Who will you chat to the most?
public static var onboardingUseCaseTitle: String {
return VectorL10n.tr("Vector", "onboarding_use_case_title")
}
/// Coworkers and teams
public static var onboardingUseCaseWorkMessaging: String {
return VectorL10n.tr("Vector", "onboarding_use_case_work_messaging")
}
/// Open
public static var `open`: String {
return VectorL10n.tr("Vector", "open")
Expand Down
2 changes: 2 additions & 0 deletions Riot/Managers/UserSessions/UserSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class UserSession: NSObject, UserSessionProtocol {
let account: MXKAccount
// Keep strong reference to the MXSession because account.mxSession can become nil on logout or failure
let matrixSession: MXSession
/// An object that contains user specific properties.
private(set) lazy var properties = UserSessionProperties(userId: userId)

var userId: String {
guard let userId = self.account.mxCredentials.userId else {
Expand Down
Loading

0 comments on commit 715ab3a

Please sign in to comment.