Merge remote-tracking branch 'origin/hotfix/2.15.1'

pull/1/head
Matthew Chen 8 years ago
commit b62ab3f666

@ -38,7 +38,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.15.0</string> <string>2.15.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@ -55,7 +55,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2.15.0.4</string> <string>2.15.1.0</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LOGS_EMAIL</key> <key>LOGS_EMAIL</key>

@ -217,8 +217,13 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (BOOL)isRTL - (BOOL)isRTL
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute]
== UIUserInterfaceLayoutDirectionRightToLeft); == UIUserInterfaceLayoutDirectionRightToLeft);
} else {
return
[UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
}
} }
- (NSLayoutConstraint *)autoPinLeadingToSuperView - (NSLayoutConstraint *)autoPinLeadingToSuperView
@ -228,10 +233,16 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (NSLayoutConstraint *)autoPinLeadingToSuperViewWithMargin:(CGFloat)margin - (NSLayoutConstraint *)autoPinLeadingToSuperViewWithMargin:(CGFloat)margin
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor constant:margin]; [self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor
constant:margin];
constraint.active = YES; constraint.active = YES;
return constraint; return constraint;
} else {
margin += (self.isRTL ? self.superview.layoutMargins.right : self.superview.layoutMargins.left);
return [self autoPinEdgeToSuperviewEdge:ALEdgeLeading withInset:margin];
}
} }
- (NSLayoutConstraint *)autoPinTrailingToSuperView - (NSLayoutConstraint *)autoPinTrailingToSuperView
@ -241,10 +252,17 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (NSLayoutConstraint *)autoPinTrailingToSuperViewWithMargin:(CGFloat)margin - (NSLayoutConstraint *)autoPinTrailingToSuperViewWithMargin:(CGFloat)margin
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor constant:-margin]; [self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor
constant:-margin];
constraint.active = YES; constraint.active = YES;
return constraint; return constraint;
} else {
CGFloat oldMargin = margin;
margin += (self.isRTL ? self.superview.layoutMargins.left : self.superview.layoutMargins.right);
return [self autoPinEdgeToSuperviewEdge:ALEdgeTrailing withInset:margin];
}
} }
- (NSLayoutConstraint *)autoPinLeadingToTrailingOfView:(UIView *)view - (NSLayoutConstraint *)autoPinLeadingToTrailingOfView:(UIView *)view
@ -258,9 +276,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
NSLayoutConstraint *constraint = [self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;
return constraint; return constraint;
} else {
return [self autoPinEdge:ALEdgeLeading toEdge:ALEdgeTrailing ofView:view withOffset:margin];
}
} }
- (NSLayoutConstraint *)autoPinLeadingToView:(UIView *)view - (NSLayoutConstraint *)autoPinLeadingToView:(UIView *)view
@ -274,9 +297,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
NSLayoutConstraint *constraint = [self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin]; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;
return constraint; return constraint;
} else {
return [self autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:view withOffset:margin];
}
} }
- (NSLayoutConstraint *)autoPinTrailingToView:(UIView *)view - (NSLayoutConstraint *)autoPinTrailingToView:(UIView *)view
@ -290,9 +318,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
NSLayoutConstraint *constraint = [self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
NSLayoutConstraint *constraint =
[self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;
return constraint; return constraint;
} else {
return [self autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:view withOffset:margin];
}
} }
- (NSTextAlignment)textAlignmentUnnatural - (NSTextAlignment)textAlignmentUnnatural

@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
[callKitSection [callKitSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE",
@"Label for 'CallKit privacy' preference") @"Label for 'CallKit privacy' preference")
isOn:[Environment.preferences isCallKitPrivacyEnabled] isOn:![Environment.preferences isCallKitPrivacyEnabled]
target:weakSelf target:weakSelf
selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; selector:@selector(didToggleEnableCallKitPrivacySwitch:)]];
} }

@ -115,7 +115,6 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
// Country // Country
UIView *countryRow = [UIView containerView]; UIView *countryRow = [UIView containerView];
countryRow.preservesSuperviewLayoutMargins = YES;
[contentView addSubview:countryRow]; [contentView addSubview:countryRow];
[countryRow autoPinLeadingAndTrailingToSuperview]; [countryRow autoPinLeadingAndTrailingToSuperview];
[countryRow autoPinEdgeToSuperviewEdge:ALEdgeTop]; [countryRow autoPinEdgeToSuperviewEdge:ALEdgeTop];
@ -150,7 +149,6 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
// Phone Number // Phone Number
UIView *phoneNumberRow = [UIView containerView]; UIView *phoneNumberRow = [UIView containerView];
phoneNumberRow.preservesSuperviewLayoutMargins = YES;
[contentView addSubview:phoneNumberRow]; [contentView addSubview:phoneNumberRow];
[phoneNumberRow autoPinLeadingAndTrailingToSuperview]; [phoneNumberRow autoPinLeadingAndTrailingToSuperview];
[phoneNumberRow autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:separatorView1]; [phoneNumberRow autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:separatorView1];

Loading…
Cancel
Save