Add an "appearance get started" card.
This commit is contained in:
parent
e93ee4469f
commit
e1324adf2e
12
Signal/Images.xcassets/appearance-card.imageset/Contents.json
vendored
Normal file
12
Signal/Images.xcassets/appearance-card.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "signal-appearance.svg",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
29
Signal/Images.xcassets/appearance-card.imageset/signal-appearance.svg
vendored
Normal file
29
Signal/Images.xcassets/appearance-card.imageset/signal-appearance.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 98 KiB |
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user