Add an "appearance get started" card.

This commit is contained in:
Matthew Chen 2021-06-02 13:31:20 -04:00
parent e93ee4469f
commit e1324adf2e
7 changed files with 74 additions and 8 deletions

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "signal-appearance.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -8,6 +8,7 @@ import Foundation
protocol GetStartedBannerViewControllerDelegate: class {
func getStartedBannerDidTapInviteFriends(_ banner: GetStartedBannerViewController)
func getStartedBannerDidTapCreateGroup(_ banner: GetStartedBannerViewController)
func getStartedBannerDidTapAppearance(_ banner: GetStartedBannerViewController)
func getStartedBannerDidDismissAllCards(_ banner: GetStartedBannerViewController, animated: Bool)
}
@ -245,10 +246,12 @@ extension GetStartedBannerViewController: GetStartedBannerCellDelegate {
guard let model = cell.model else { return }
switch model {
case .InviteFriends:
case .inviteFriends:
delegate?.getStartedBannerDidTapInviteFriends(self)
case .NewGroup:
case .newGroup:
delegate?.getStartedBannerDidTapCreateGroup(self)
case .appearance:
delegate?.getStartedBannerDidTapAppearance(self)
}
}
}

View File

@ -2412,6 +2412,11 @@ NSString *const kArchiveButtonPseudoGroup = @"kArchiveButtonPseudoGroup";
[self showNewGroupView];
}
- (void)getStartedBannerDidTapAppearance:(OWSGetStartedBannerViewController *)banner
{
[self showAppSettingsInAppearanceMode];
}
- (void)getStartedBannerDidTapInviteFriends:(OWSGetStartedBannerViewController *)banner
{
self.inviteFlow = [[OWSInviteFlow alloc] initWithPresentingViewController:self];

View File

@ -180,6 +180,7 @@ public enum ShowAppSettingsMode {
case payments
case payment(paymentsHistoryItem: PaymentsHistoryItem)
case paymentsTransferIn
case appearance
}
// MARK: -
@ -191,6 +192,11 @@ public extension ConversationListViewController {
showAppSettings(mode: .none)
}
@objc
func showAppSettingsInAppearanceMode() {
showAppSettings(mode: .appearance)
}
func showAppSettings(mode: ShowAppSettingsMode) {
AssertIsOnMainThread()
@ -216,6 +222,9 @@ public extension ConversationListViewController {
let paymentsSettings = PaymentsSettingsViewController(mode: .inAppSettings)
let paymentsTransferIn = PaymentsTransferInViewController()
viewControllers += [ paymentsSettings, paymentsTransferIn ]
case .appearance:
let appearance = AppearanceSettingsTableViewController()
viewControllers += [ appearance ]
}
navigationController.setViewControllers(viewControllers, animated: false)
presentFormSheet(navigationController, animated: true)

View File

@ -5,8 +5,9 @@
import Foundation
enum GetStartedBannerEntry: String, CaseIterable {
case NewGroup
case InviteFriends
case newGroup
case inviteFriends
case appearance
var identifier: String { rawValue }
}
@ -130,19 +131,23 @@ class GetStartedBannerCell: UICollectionViewCell {
private extension GetStartedBannerEntry {
var image: UIImage {
switch self {
case .NewGroup:
case .newGroup:
return UIImage(named: "new-group-card")!
case .InviteFriends:
case .inviteFriends:
return UIImage(named: "invite-friends-card")!
case .appearance:
return UIImage(named: "appearance-card")!
}
}
var buttonText: String {
switch self {
case .NewGroup:
case .newGroup:
return NSLocalizedString("GET_STARTED_CARD_NEW_GROUP", comment: "'Get Started' button directing users to create a group")
case .InviteFriends:
case .inviteFriends:
return NSLocalizedString("GET_STARTED_CARD_INVITE_FRIENDS", comment: "'Get Started' button directing users to invite friends")
case .appearance:
return NSLocalizedString("GET_STARTED_CARD_APPEARANCE", comment: "'Get Started' button directing users to appearance")
}
}
}

View File

@ -1639,6 +1639,9 @@
/* Title for the 'Get Started' banner */
"GET_STARTED_BANNER_TITLE" = "Get started";
/* 'Get Started' button directing users to appearance */
"GET_STARTED_CARD_APPEARANCE" = "Appearance";
/* 'Get Started' button directing users to invite friends */
"GET_STARTED_CARD_INVITE_FRIENDS" = "Invite friends";