Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.2 (165) #4

Merged
merged 4 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ChatSecure.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 165;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = NO;
Expand Down Expand Up @@ -3150,7 +3150,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 165;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -3296,7 +3296,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 165;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = NO;
Expand Down Expand Up @@ -3486,7 +3486,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 165;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ open class OTRComposeGroupViewController: UIViewController, UICollectionViewDele
if existingItems.contains(threadOwner.uniqueId) {
isExistingOccupant = true
}
cell.nameLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black
cell.accountLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black
cell.identifierLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black
cell.nameLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor
cell.accountLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor
cell.identifierLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor
return cell
}
return UITableViewCell()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ - (void)viewDidLoad

self.title = ADD_BUDDY_STRING();

//self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)];


UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(doneButtonPressed:)];
self.navigationItem.rightBarButtonItems = @[doneButton, qrButton];
NSMutableArray<UIBarButtonItem*> *rightBarButtonItems = @[doneButton].mutableCopy;
if ([QRCodeReader isAvailable]) {
UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)];
[rightBarButtonItems insertObject:qrButton atIndex:0];
}
self.navigationItem.rightBarButtonItems = rightBarButtonItems;

self.accountNameTextField = [[UITextField alloc] initWithFrame:CGRectZero];
self.accountNameTextField.placeholder = XMPP_USERNAME_EXAMPLE_STRING();
Expand Down
21 changes: 9 additions & 12 deletions ChatSecureCore/Classes/Views/Cells/OTRBuddyInfoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,19 @@ @interface OTRBuddyInfoCell ()
@property (nonatomic, strong) UILabel *identifierLabel;
@property (nonatomic, strong) UILabel *accountLabel;

@property (nonatomic, strong, readonly) UIColor *primaryTextColor;
@property (nonatomic, strong, readonly) UIColor *subtitleTextColor;

@end

@implementation OTRBuddyInfoCell

- (UIColor *) primaryTextColor {
+ (UIColor *) primaryTextColor {
if (@available(iOS 13.0, *)) {
return [UIColor labelColor];
} else {
return [UIColor darkTextColor];
}
}

- (UIColor *) subtitleTextColor {
+ (UIColor *) subtitleTextColor {
if (@available(iOS 13.0, *)) {
return [UIColor systemGray3Color];
} else {
Expand All @@ -53,11 +50,11 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
self.nameLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];

self.identifierLabel = [[UILabel alloc] initForAutoLayout];
self.identifierLabel.textColor = self.primaryTextColor;
self.identifierLabel.textColor = self.class.primaryTextColor;
self.identifierLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];

self.accountLabel = [[UILabel alloc] initForAutoLayout];
self.accountLabel.textColor = self.subtitleTextColor;
self.accountLabel.textColor = self.class.subtitleTextColor;
self.accountLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2];

NSArray<UILabel*> *labels = @[self.nameLabel, self.identifierLabel, self.accountLabel];
Expand Down Expand Up @@ -93,9 +90,9 @@ - (void)setThread:(id<OTRThreadOwner>)thread account:(nullable OTRAccount*)accou
}
self.identifierLabel.text = identifier;

UIColor *textColor = self.primaryTextColor;
UIColor *textColor = self.class.primaryTextColor;
if ([thread isArchived]) {
textColor = self.subtitleTextColor;
textColor = self.class.subtitleTextColor;
}
[@[self.nameLabel, self.identifierLabel] enumerateObjectsUsingBlock:^(UILabel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
obj.textColor = textColor;
Expand Down Expand Up @@ -126,9 +123,9 @@ - (void)updateConstraints

- (void)prepareForReuse {
[super prepareForReuse];
self.nameLabel.textColor = self.primaryTextColor;
self.identifierLabel.textColor = self.primaryTextColor;
self.accountLabel.textColor = self.subtitleTextColor;
self.nameLabel.textColor = self.class.primaryTextColor;
self.identifierLabel.textColor = self.class.primaryTextColor;
self.accountLabel.textColor = self.class.subtitleTextColor;
}

- (void) infoButtonPressed:(UIButton*)sender {
Expand Down
2 changes: 2 additions & 0 deletions ChatSecureCore/Public/OTRBuddyInfoCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern const CGFloat OTRBuddyInfoCellHeight;
/** Action callback for infoButton */
@property (nonatomic, copy, nullable) void (^infoAction)(OTRBuddyInfoCell *cell, UIButton *sender);

@property (class, nonatomic, strong, readonly) UIColor *primaryTextColor;
@property (class, nonatomic, strong, readonly) UIColor *subtitleTextColor;

@end
NS_ASSUME_NONNULL_END
16 changes: 7 additions & 9 deletions OTRResources/Interface/OTRComposeGroup.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="o67-Zh-raq">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="o67-Zh-raq">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -22,15 +20,15 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="cr5-7D-PoW">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="czz-0S-JIP">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="IqC-6K-6tj">
<rect key="frame" x="0.0" y="0.0" width="375" height="10"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="Rw6-Dg-zTk"/>
</constraints>
Expand All @@ -54,7 +52,7 @@
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="zka-zO-LBL" firstAttribute="leading" secondItem="czz-0S-JIP" secondAttribute="leading" constant="4" id="29d-IK-QMi"/>
<constraint firstAttribute="trailing" secondItem="IqC-6K-6tj" secondAttribute="trailing" id="5WY-wZ-gCN"/>
Expand All @@ -71,7 +69,7 @@
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="c8h-vc-VRi" firstAttribute="top" secondItem="cr5-7D-PoW" secondAttribute="bottom" id="00e-w3-kfN"/>
<constraint firstAttribute="trailing" secondItem="cr5-7D-PoW" secondAttribute="trailing" id="2x0-An-DMB"/>
Expand Down
16 changes: 7 additions & 9 deletions OTRResources/Interface/OTRComposeGroupBuddyCell.xib
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -26,13 +24,12 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tU6-2C-mKC">
<rect key="frame" x="29" y="5" width="90" height="16"/>
<rect key="frame" x="29" y="4.5" width="90" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2IT-n8-QOZ">
<rect key="frame" x="129" y="7" width="12" height="12"/>
<rect key="frame" x="129" y="6.5" width="12" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="VwD-Aa-TVr"/>
<constraint firstAttribute="width" constant="12" id="cXM-0J-zRi"/>
Expand All @@ -45,7 +42,7 @@
</button>
</subviews>
</view>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="tU6-2C-mKC" firstAttribute="leading" secondItem="yH9-g6-OKm" secondAttribute="trailing" constant="4" id="4sN-ML-XrD"/>
<constraint firstAttribute="bottom" secondItem="yH9-g6-OKm" secondAttribute="bottom" id="5kf-pz-AHe"/>
Expand All @@ -61,6 +58,7 @@
<outlet property="image" destination="yH9-g6-OKm" id="3fC-TB-ph5"/>
<outlet property="label" destination="tU6-2C-mKC" id="eyi-Ac-MsG"/>
</connections>
<point key="canvasLocation" x="138" y="153"/>
</collectionViewCell>
</objects>
<resources>
Expand Down