From 2d4a7551f729fb1f49f9bfa2a02281f1e6835394 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 25 Jul 2019 13:41:13 +1000 Subject: [PATCH] Show empty state message on home screen when needed --- .../src/ViewControllers/HomeView/HomeViewController.m | 10 ++++------ Signal/translations/en.lproj/Localizable.strings | 1 + SignalServiceKit/src/Loki/Crypto/ECKeyPair+Loki.swift | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index bfcd77672..44affb8da 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -376,8 +376,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { - (UIView *)createEmptyInboxView { - return [UIView new]; - /** + /* NSArray *emptyInboxImageNames = @[ @"home_empty_splash_1", @"home_empty_splash_2", @@ -394,10 +393,10 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { CGSize screenSize = UIScreen.mainScreen.bounds.size; CGFloat emptyInboxImageSize = MIN(screenSize.width, screenSize.height) * 0.65f; [emptyInboxImageView autoSetDimension:ALDimensionWidth toSize:emptyInboxImageSize]; + */ UILabel *emptyInboxLabel = [UILabel new]; - emptyInboxLabel.text = NSLocalizedString(@"INBOX_VIEW_EMPTY_INBOX", - @"Message shown in the home view when the inbox is empty."); + emptyInboxLabel.text = NSLocalizedString(@"Looks like you don\'t have any conversations yet. Get started by messaging a friend.", @""); emptyInboxLabel.font = UIFont.ows_dynamicTypeBodyClampedFont; emptyInboxLabel.textColor = Theme.secondaryColor; emptyInboxLabel.textAlignment = NSTextAlignmentCenter; @@ -405,7 +404,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { emptyInboxLabel.lineBreakMode = NSLineBreakByWordWrapping; UIStackView *emptyInboxStack = [[UIStackView alloc] initWithArrangedSubviews:@[ - emptyInboxImageView, + /*emptyInboxImageView,*/ emptyInboxLabel, ]]; emptyInboxStack.axis = UILayoutConstraintAxisVertical; @@ -414,7 +413,6 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { emptyInboxStack.layoutMargins = UIEdgeInsetsMake(50, 50, 50, 50); emptyInboxStack.layoutMarginsRelativeArrangement = YES; return emptyInboxStack; - */ } - (void)createFirstConversationCueView diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 89ee4f5eb..db927985d 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2597,3 +2597,4 @@ "For example: 059abcf223aa8c10e3dc2d623688b75dd25896794717e4a9c486772664fc95e41e." = "For example: 059abcf223aa8c10e3dc2d623688b75dd25896794717e4a9c486772664fc95e41e."; "Invalid Public Key" = "Invalid Public Key"; "Please check the public key you entered and try again." = "Please check the public key you entered and try again."; +"Looks like you don\'t have any conversations yet. Get started by messaging a friend." = "Looks like you don\'t have any conversations yet. Get started by messaging a friend."; diff --git a/SignalServiceKit/src/Loki/Crypto/ECKeyPair+Loki.swift b/SignalServiceKit/src/Loki/Crypto/ECKeyPair+Loki.swift index 57fa63440..894fd19ca 100644 --- a/SignalServiceKit/src/Loki/Crypto/ECKeyPair+Loki.swift +++ b/SignalServiceKit/src/Loki/Crypto/ECKeyPair+Loki.swift @@ -7,7 +7,6 @@ public extension ECKeyPair { @objc public var hexEncodedPublicKey: String { // Prefixing with "05" is necessary for what seems to be a sort of Signal public key versioning system - // Ref: [NSData prependKeyType] in AxolotKit return "05" + publicKey.map { String(format: "%02hhx", $0) }.joined() }