Sketch out the profile view.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent b62ab3f666
commit 72ea096970

@ -65,7 +65,7 @@
34B3F88D1E8DF1700035BE1A /* OWSQRCodeScanningViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8631E8DF1700035BE1A /* OWSQRCodeScanningViewController.m */; };
34B3F88E1E8DF1700035BE1A /* PrivacySettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */; };
34B3F88F1E8DF1710035BE1A /* RegistrationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8671E8DF1700035BE1A /* RegistrationViewController.m */; };
34B3F8901E8DF1710035BE1A /* SettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8691E8DF1700035BE1A /* SettingsTableViewController.m */; };
34B3F8901E8DF1710035BE1A /* AppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8691E8DF1700035BE1A /* AppSettingsViewController.m */; };
34B3F8911E8DF1710035BE1A /* ShowGroupMembersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86B1E8DF1700035BE1A /* ShowGroupMembersViewController.m */; };
34B3F8921E8DF1710035BE1A /* SignalAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */; };
34B3F8931E8DF1710035BE1A /* SignalsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F86E1E8DF1700035BE1A /* SignalsNavigationController.m */; };
@ -76,6 +76,7 @@
34B3F8A21E8EA6040035BE1A /* ViewControllerUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8A11E8EA6040035BE1A /* ViewControllerUtils.m */; };
34CCAF381F0C0599004084F4 /* AppUpdateNag.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CCAF371F0C0599004084F4 /* AppUpdateNag.m */; };
34CCAF3B1F0C2748004084F4 /* OWSAddToContactViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CCAF3A1F0C2748004084F4 /* OWSAddToContactViewController.m */; };
34CE88E71F2FB9A10098030F /* ProfileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CE88E61F2FB9A10098030F /* ProfileViewController.m */; };
34D5CC961EA6AFAD005515DB /* OWSContactsSyncing.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D5CC951EA6AFAD005515DB /* OWSContactsSyncing.m */; };
34D5CCA91EAE3D30005515DB /* GroupViewHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D5CCA81EAE3D30005515DB /* GroupViewHelper.m */; };
34D5CCB11EAE7E7F005515DB /* SelectRecipientViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D5CCB01EAE7E7F005515DB /* SelectRecipientViewController.m */; };
@ -483,8 +484,8 @@
34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrivacySettingsTableViewController.m; sourceTree = "<group>"; };
34B3F8661E8DF1700035BE1A /* RegistrationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegistrationViewController.h; sourceTree = "<group>"; };
34B3F8671E8DF1700035BE1A /* RegistrationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegistrationViewController.m; sourceTree = "<group>"; };
34B3F8681E8DF1700035BE1A /* SettingsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsTableViewController.h; sourceTree = "<group>"; };
34B3F8691E8DF1700035BE1A /* SettingsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsTableViewController.m; sourceTree = "<group>"; };
34B3F8681E8DF1700035BE1A /* AppSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppSettingsViewController.h; sourceTree = "<group>"; };
34B3F8691E8DF1700035BE1A /* AppSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppSettingsViewController.m; sourceTree = "<group>"; };
34B3F86A1E8DF1700035BE1A /* ShowGroupMembersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShowGroupMembersViewController.h; sourceTree = "<group>"; };
34B3F86B1E8DF1700035BE1A /* ShowGroupMembersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowGroupMembersViewController.m; sourceTree = "<group>"; };
34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalAttachment.swift; sourceTree = "<group>"; };
@ -503,6 +504,8 @@
34CCAF371F0C0599004084F4 /* AppUpdateNag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppUpdateNag.m; sourceTree = "<group>"; };
34CCAF391F0C2748004084F4 /* OWSAddToContactViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSAddToContactViewController.h; sourceTree = "<group>"; };
34CCAF3A1F0C2748004084F4 /* OWSAddToContactViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSAddToContactViewController.m; sourceTree = "<group>"; };
34CE88E51F2FB9A10098030F /* ProfileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileViewController.h; sourceTree = "<group>"; };
34CE88E61F2FB9A10098030F /* ProfileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProfileViewController.m; sourceTree = "<group>"; };
34D5CC941EA6AFAD005515DB /* OWSContactsSyncing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSContactsSyncing.h; sourceTree = "<group>"; };
34D5CC951EA6AFAD005515DB /* OWSContactsSyncing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsSyncing.m; sourceTree = "<group>"; };
34D5CC981EA6EB79005515DB /* OWSMessageCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMessageCollectionViewCell.h; sourceTree = "<group>"; };
@ -950,6 +953,8 @@
3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */,
34B3F8361E8DF1700035BE1A /* AdvancedSettingsTableViewController.h */,
34B3F8371E8DF1700035BE1A /* AdvancedSettingsTableViewController.m */,
34B3F8681E8DF1700035BE1A /* AppSettingsViewController.h */,
34B3F8691E8DF1700035BE1A /* AppSettingsViewController.m */,
34B3F8381E8DF1700035BE1A /* AttachmentApprovalViewController.swift */,
34B3F8391E8DF1700035BE1A /* AttachmentSharing.h */,
34B3F83A1E8DF1700035BE1A /* AttachmentSharing.m */,
@ -1017,6 +1022,8 @@
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */,
34B3F8641E8DF1700035BE1A /* PrivacySettingsTableViewController.h */,
34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */,
34CE88E51F2FB9A10098030F /* ProfileViewController.h */,
34CE88E61F2FB9A10098030F /* ProfileViewController.m */,
34B3F8661E8DF1700035BE1A /* RegistrationViewController.h */,
34B3F8671E8DF1700035BE1A /* RegistrationViewController.m */,
4585C4671ED8F8D200896AEA /* SafetyNumberConfirmationAlert.swift */,
@ -1026,8 +1033,6 @@
3400C7951EAF99F4008A8584 /* SelectThreadViewController.m */,
3400C7901EAF89CD008A8584 /* SendExternalFileViewController.h */,
3400C7911EAF89CD008A8584 /* SendExternalFileViewController.m */,
34B3F8681E8DF1700035BE1A /* SettingsTableViewController.h */,
34B3F8691E8DF1700035BE1A /* SettingsTableViewController.m */,
34B3F86A1E8DF1700035BE1A /* ShowGroupMembersViewController.h */,
34B3F86B1E8DF1700035BE1A /* ShowGroupMembersViewController.m */,
34B3F86C1E8DF1700035BE1A /* SignalAttachment.swift */,
@ -2161,12 +2166,13 @@
34D5CCB11EAE7E7F005515DB /* SelectRecipientViewController.m in Sources */,
34B3F88F1E8DF1710035BE1A /* RegistrationViewController.m in Sources */,
3448BFCD1EDF0EA7005B2D69 /* OWSMessagesInputToolbar.m in Sources */,
34B3F8901E8DF1710035BE1A /* SettingsTableViewController.m in Sources */,
34B3F8901E8DF1710035BE1A /* AppSettingsViewController.m in Sources */,
34FD93701E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m in Sources */,
343D3D9B1E9283F100165CA4 /* BlockListUIUtils.m in Sources */,
34B3F8931E8DF1710035BE1A /* SignalsNavigationController.m in Sources */,
76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */,
34F308A21ECB469700BB7697 /* OWSBezierPathView.m in Sources */,
34CE88E71F2FB9A10098030F /* ProfileViewController.m in Sources */,
348F2EAE1F0D21BC00D4ECE0 /* DeviceSleepManager.swift in Sources */,
34E3EF101EFC2684007F6822 /* DebugUIPage.m in Sources */,
76EB058A18170B33006006FC /* Release.m in Sources */,

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "profile_avatar_default@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "profile_avatar_default@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "profile_avatar_default@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

@ -4,6 +4,7 @@
#import <Foundation/Foundation.h>
#import "AppSettingsViewController.h"
#import "AttachmentSharing.h"
#import "Environment.h"
#import "FLAnimatedImage.h"
@ -23,7 +24,6 @@
#import "PrivacySettingsTableViewController.h"
#import "PropertyListPreferences.h"
#import "PushManager.h"
#import "SettingsTableViewController.h"
#import "SignalsViewController.h"
#import "TSMessageAdapter.h"
#import "UIColor+OWS.h"

@ -4,6 +4,6 @@
#import "OWSTableViewController.h"
@interface SettingsTableViewController : OWSTableViewController
@interface AppSettingsViewController : OWSTableViewController
@end

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "SettingsTableViewController.h"
#import "AppSettingsViewController.h"
#import "AboutTableViewController.h"
#import "AdvancedSettingsTableViewController.h"
#import "DebugUITableViewController.h"
@ -11,6 +11,7 @@
#import "OWSContactsManager.h"
#import "OWSLinkedDevicesTableViewController.h"
#import "PrivacySettingsTableViewController.h"
#import "ProfileViewController.h"
#import "PropertyListPreferences.h"
#import "PushManager.h"
#import "Signal-Swift.h"
@ -18,7 +19,7 @@
#import <SignalServiceKit/TSAccountManager.h>
#import <SignalServiceKit/TSSocketManager.h>
@interface SettingsTableViewController ()
@interface AppSettingsViewController ()
@property (nonatomic, readonly) OWSContactsManager *contactsManager;
@ -26,7 +27,7 @@
#pragma mark -
@implementation SettingsTableViewController
@implementation AppSettingsViewController
- (instancetype)init
{
@ -72,7 +73,7 @@
[self observeNotifications];
self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity");
[self updateTableContents];
}
@ -83,7 +84,8 @@
[self updateTableContents];
}
- (void)dealloc {
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@ -94,7 +96,7 @@
OWSTableContents *contents = [OWSTableContents new];
OWSTableSection *section = [OWSTableSection new];
__weak SettingsTableViewController *weakSelf = self;
__weak AppSettingsViewController *weakSelf = self;
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
cell.preservesSuperviewLayoutMargins = YES;
@ -168,6 +170,13 @@
}
actionBlock:nil]];
}
[section addItem:[OWSTableItem
disclosureItemWithText:NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view.")
actionBlock:^{
[weakSelf showProfile];
}]];
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE",
@"Settings table view cell label")
actionBlock:^{
@ -225,7 +234,7 @@
actionBlock:nil]];
[contents addSection:section];
self.contents = contents;
}
@ -255,6 +264,12 @@
[self.navigationController pushViewController:vc animated:YES];
}
- (void)showProfile
{
ProfileViewController *vc = [[ProfileViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
- (void)showAdvanced
{
AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init];
@ -288,7 +303,7 @@
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"PROCEED_BUTTON", @"")
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *action) {
[self proceedToUnregistration];
[self proceedToUnregistration];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"")
style:UIAlertActionStyleCancel
@ -297,7 +312,8 @@
[self presentViewController:alertController animated:YES completion:nil];
}
- (void)proceedToUnregistration {
- (void)proceedToUnregistration
{
[TSAccountManager unregisterTextSecureWithSuccess:^{
[Environment resetAppData];
}
@ -316,9 +332,10 @@
object:nil];
}
- (void)socketStateDidChange {
- (void)socketStateDidChange
{
OWSAssert([NSThread isMainThread]);
[self updateTableContents];
}

@ -900,7 +900,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
assert(fromViewController != nil)
// Construct the "settings" view & push the "privacy settings" view.
let navigationController = UINavigationController(rootViewController:SettingsTableViewController())
let navigationController = UINavigationController(rootViewController:AppSettingsViewController())
navigationController.pushViewController(PrivacySettingsTableViewController(), animated:false)
fromViewController?.present(navigationController, animated: true, completion: nil)

@ -38,7 +38,7 @@ private class CallKitExperienceUpgradeViewController: ExperienceUpgradeViewContr
assert(fromViewController != nil)
// Construct the "settings" view & push the "privacy settings" view.
let navigationController = UINavigationController(rootViewController:SettingsTableViewController())
let navigationController = UINavigationController(rootViewController:AppSettingsViewController())
navigationController.pushViewController(PrivacySettingsTableViewController(), animated:false)
fromViewController?.present(navigationController, animated: true, completion: nil)

@ -5,7 +5,6 @@
#import "OWSLinkDeviceViewController.h"
#import "OWSDeviceProvisioningURLParser.h"
#import "OWSLinkedDevicesTableViewController.h"
#import "SettingsTableViewController.h"
#import <SignalServiceKit/ECKeyPair+OWSPrivateKey.h>
#import <SignalServiceKit/OWSDeviceProvisioner.h>
#import <SignalServiceKit/OWSIdentityManager.h>

@ -0,0 +1,28 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSTableViewController.h"
NS_ASSUME_NONNULL_BEGIN
//@class ProfileViewController;
//
//@protocol ProfileViewControllerDelegate <NSObject>
//
//- (void)ProfileViewController:(ProfileViewController *)vc
// didSelectCountryCode:(NSString *)countryCode
// countryName:(NSString *)countryName
// callingCode:(NSString *)callingCode;
//
//@end
//
//#pragma mark -
@interface ProfileViewController : OWSTableViewController
//@property (nonatomic, weak) id<ProfileViewControllerDelegate> countryCodeDelegate;
@end
NS_ASSUME_NONNULL_END

@ -0,0 +1,248 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "ProfileViewController.h"
#import "Signal-Swift.h"
#import "UIColor+OWS.h"
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
NS_ASSUME_NONNULL_BEGIN
@interface ProfileViewController () <UITextFieldDelegate>
//<
// OWSTableViewControllerDelegate
//// , UISearchBarDelegate
//>
//@property (nonatomic, readonly) UISearchBar *searchBar;
//
//@property (nonatomic) NSArray<NSString *> *countryCodes;
@property (nonatomic) UITextField *nameTextField;
@property (nonatomic) AvatarImageView *avatarView;
@property (nonatomic) UILabel *avatarLabel;
@end
#pragma mark -
@implementation ProfileViewController
- (void)loadView
{
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
self.title = NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view.");
// self.countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil];
// self.navigationItem.leftBarButtonItem =
// [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
// target:self
// action:@selector(dismissWasPressed:)];
[self createViews];
}
- (void)createViews
{
_nameTextField = [UITextField new];
_nameTextField.font = [UIFont ows_mediumFontWithSize:18.f];
// _nameTextField.textAlignment = _nameTextField.textAlignmentUnnatural;
_nameTextField.textColor = [UIColor ows_materialBlueColor];
// TODO: Copy.
_nameTextField.placeholder = NSLocalizedString(
@"PROFILE_VIEW_NAME_DEFAULT_TEXT", @"Default text for the profile name field of the profile view.");
_nameTextField.delegate = self;
[_nameTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
_avatarView = [AvatarImageView new];
_avatarLabel = [UILabel new];
_avatarLabel.font = [UIFont ows_regularFontWithSize:14.f];
_avatarLabel.textColor = [UIColor ows_materialBlueColor];
// TODO: Copy.
_avatarLabel.text
= NSLocalizedString(@"PROFILE_VIEW_AVATAR_INSTRUCTIONS", @"Instructions for how to change the profile avatar.");
[_avatarLabel sizeToFit];
[self updateTableContents];
}
#pragma mark - Table Contents
- (void)updateTableContents
{
OWSTableContents *contents = [OWSTableContents new];
__weak ProfileViewController *weakSelf = self;
// Avatar
OWSTableSection *avatarSection = [OWSTableSection new];
avatarSection.headerTitle = NSLocalizedString(
@"PROFILE_VIEW_AVATAR_SECTION_HEADER", @"Header title for the profile avatar field of the profile view.");
const CGFloat kAvatarHeightPoints = 100.f;
const CGFloat kAvatarTopMargin = 10.f;
const CGFloat kAvatarBottomMargin = 10.f;
const CGFloat kAvatarVSpacing = 10.f;
CGFloat avatarCellHeight = round(
kAvatarHeightPoints + kAvatarTopMargin + kAvatarBottomMargin + kAvatarVSpacing + self.avatarLabel.height);
// const CGFloat kCountryRowHeight = 50;
// const CGFloat kPhoneNumberRowHeight = 50;
// const CGFloat examplePhoneNumberRowHeight = self.examplePhoneNumberFont.lineHeight + 3.f;
// const CGFloat kButtonRowHeight = 60;
[avatarSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
// SelectRecipientViewController *strongSelf = weakSelf;
// OWSCAssert(strongSelf);
UITableViewCell *cell = [UITableViewCell new];
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;
// TODO: Use the current avatar.
UIImage *defaultAvatarImage = [UIImage imageNamed:@"profile_avatar_default"];
OWSAssert(defaultAvatarImage.size.width == kAvatarHeightPoints);
OWSAssert(defaultAvatarImage.size.height == kAvatarHeightPoints);
AvatarImageView *avatarView = weakSelf.avatarView;
avatarView.image = defaultAvatarImage;
[cell.contentView addSubview:avatarView];
[avatarView autoHCenterInSuperview];
[avatarView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:kAvatarTopMargin];
UILabel *avatarLabel = weakSelf.avatarLabel;
[cell.contentView addSubview:avatarLabel];
[avatarLabel autoHCenterInSuperview];
[avatarLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:kAvatarBottomMargin];
cell.userInteractionEnabled = YES;
[cell
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarTapped:)]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
customRowHeight:avatarCellHeight
actionBlock:nil]];
[contents addSection:avatarSection];
// Profile
OWSTableSection *nameSection = [OWSTableSection new];
nameSection.headerTitle = NSLocalizedString(
@"PROFILE_VIEW_NAME_SECTION_HEADER", @"Label for the profile name field of the profile view.");
// const CGFloat kCountryRowHeight = 50;
// const CGFloat kPhoneNumberRowHeight = 50;
// const CGFloat examplePhoneNumberRowHeight = self.examplePhoneNumberFont.lineHeight + 3.f;
// const CGFloat kButtonRowHeight = 60;
[nameSection
addItem:
[OWSTableItem
itemWithCustomCellBlock:^{
// SelectRecipientViewController *strongSelf = weakSelf;
// OWSCAssert(strongSelf);
UITableViewCell *cell = [UITableViewCell new];
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;
UITextField *nameTextField = weakSelf.nameTextField;
[cell.contentView addSubview:nameTextField];
[nameTextField autoPinLeadingToSuperView];
[nameTextField autoPinTrailingToSuperView];
[nameTextField autoVCenterInSuperview];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
// customRowHeight:kCountryRowHeight +
// kPhoneNumberRowHeight
// + examplePhoneNumberRowHeight
// + kButtonRowHeight
actionBlock:nil]];
[contents addSection:nameSection];
self.contents = contents;
}
//- (void)countryCodeWasSelected:(NSString *)countryCode
//{
// OWSAssert(countryCode.length > 0);
//
// NSString *callingCodeSelected = [PhoneNumberUtil callingCodeFromCountryCode:countryCode];
// NSString *countryNameSelected = [PhoneNumberUtil countryNameFromCountryCode:countryCode];
// NSString *countryCodeSelected = countryCode;
// [self.countryCodeDelegate ProfileViewController:self
// didSelectCountryCode:countryCodeSelected
// countryName:countryNameSelected
// callingCode:callingCodeSelected];
// [self.searchBar resignFirstResponder];
// [self dismissViewControllerAnimated:YES completion:nil];
//}
//
//- (void)dismissWasPressed:(id)sender {
// [self dismissViewControllerAnimated:YES completion:nil];
//}
- (void)avatarTapped:(UIGestureRecognizer *)sender
{
if (sender.state == UIGestureRecognizerStateRecognized) {
}
}
#pragma mark - UITextFieldDelegate
// TODO: This logic resides in both RegistrationViewController and here.
// We should refactor it out into a utility function.
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)insertionText
{
return YES;
// [ViewControllerUtils phoneNumberTextField:textField
// shouldChangeCharactersInRange:range
// replacementString:insertionText
// countryCode:_callingCode];
//
// [self updatePhoneNumberButtonEnabling];
//
// return NO; // inform our caller that we took care of performing the change
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
return YES;
// [textField resignFirstResponder];
// if ([self hasValidPhoneNumber]) {
// [self tryToSelectPhoneNumber];
// }
// return NO;
}
- (void)textFieldDidChange:(id)sender
{
// [self updatePhoneNumberButtonEnabling];
}
#pragma mark - Logging
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end
NS_ASSUME_NONNULL_END

@ -4,6 +4,7 @@
#import "SignalsViewController.h"
#import "AppDelegate.h"
#import "AppSettingsViewController.h"
#import "InboxTableViewCell.h"
#import "MessageComposeTableViewController.h"
#import "MessagesViewController.h"
@ -11,7 +12,6 @@
#import "OWSContactsManager.h"
#import "PropertyListPreferences.h"
#import "PushManager.h"
#import "SettingsTableViewController.h"
#import "Signal-Swift.h"
#import "TSAccountManager.h"
#import "TSDatabaseView.h"
@ -305,7 +305,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
}
- (void)settingsButtonPressed:(id)sender {
SettingsTableViewController *vc = [SettingsTableViewController new];
AppSettingsViewController *vc = [AppSettingsViewController new];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:navigationController animated:YES completion:nil];
}

@ -1036,6 +1036,21 @@
/* No comment provided by engineer. */
"PROCEED_BUTTON" = "Proceed";
/* Instructions for how to change the profile avatar. */
"PROFILE_VIEW_AVATAR_INSTRUCTIONS" = "Tap to Select Avatar";
/* Header title for the profile avatar field of the profile view. */
"PROFILE_VIEW_AVATAR_SECTION_HEADER" = "Avatar";
/* Default text for the profile name field of the profile view. */
"PROFILE_VIEW_NAME_DEFAULT_TEXT" = "Enter your name.";
/* Label for the profile name field of the profile view. */
"PROFILE_VIEW_NAME_SECTION_HEADER" = "Profile Name";
/* Title for the profile view. */
"PROFILE_VIEW_TITLE" = "Profile";
/* No comment provided by engineer. */
"PUSH_MANAGER_MARKREAD" = "Mark as Read";

@ -314,7 +314,7 @@ NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName
DDLogInfo(@"%@ Successfully unregistered", self.tag);
success();
// This is called from `[SettingsTableViewController proceedToUnregistration]` whose
// This is called from `[AppSettingsViewController proceedToUnregistration]` whose
// success handler calls `[Environment resetAppData]`.
// This method, after calling that success handler, fires
// `kNSNotificationName_RegistrationStateDidChange` which is only safe to fire after

Loading…
Cancel
Save