Finish implementing light mode
This commit is contained in:
parent
e766a2cbf3
commit
3b2be079ff
BIN
Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/ArrowUpLightMode.pdf
vendored
Normal file
BIN
Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/ArrowUpLightMode.pdf
vendored
Normal file
Binary file not shown.
|
@ -2,7 +2,7 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "FilledCircleCheck.pdf"
|
||||
"filename" : "ArrowUpLightMode.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
12
Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json
vendored
Normal file
12
Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "FilledCircleCheckDarkMode.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
12
Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json
vendored
Normal file
12
Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "FilledCircleCheckLightMode.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/FilledCircleCheckLightMode.pdf
vendored
Normal file
BIN
Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/FilledCircleCheckLightMode.pdf
vendored
Normal file
Binary file not shown.
|
@ -37,7 +37,7 @@ final class Button : UIButton {
|
|||
}
|
||||
let borderColor: UIColor
|
||||
switch style {
|
||||
case .unimportant: borderColor = Colors.unimportantButtonBackground
|
||||
case .unimportant: borderColor = isLightMode ? Colors.text : Colors.unimportantButtonBackground
|
||||
case .regular: borderColor = Colors.text
|
||||
case .prominentOutline: borderColor = Colors.accent
|
||||
case .prominentFilled: borderColor = Colors.accent
|
||||
|
|
|
@ -141,7 +141,8 @@ final class ConversationCell : UITableViewCell {
|
|||
profilePictureView.hexEncodedPublicKey = ""
|
||||
profilePictureView.isRSSFeed = true
|
||||
} else {
|
||||
let users = LokiAPI.userHexEncodedPublicKeyCache[threadViewModel.threadRecord.uniqueId!] ?? []
|
||||
var users = LokiAPI.userHexEncodedPublicKeyCache[threadViewModel.threadRecord.uniqueId!] ?? []
|
||||
users.remove(getUserHexEncodedPublicKey())
|
||||
let randomUsers = users.sorted().prefix(2) // Sort to provide a level of stability
|
||||
if !randomUsers.isEmpty {
|
||||
profilePictureView.hexEncodedPublicKey = randomUsers[0]
|
||||
|
@ -175,11 +176,11 @@ final class ConversationCell : UITableViewCell {
|
|||
let image: UIImage
|
||||
let status = MessageRecipientStatusUtils.recipientStatus(outgoingMessage: lastMessage)
|
||||
switch status {
|
||||
case .calculatingPoW, .uploading, .sending: image = #imageLiteral(resourceName: "CircleDotDotDot")
|
||||
case .sent, .skipped, .delivered: image = #imageLiteral(resourceName: "CircleCheck")
|
||||
case .calculatingPoW, .uploading, .sending: image = #imageLiteral(resourceName: "CircleDotDotDot").asTintedImage(color: Colors.text)!
|
||||
case .sent, .skipped, .delivered: image = #imageLiteral(resourceName: "CircleCheck").asTintedImage(color: Colors.text)!
|
||||
case .read:
|
||||
statusIndicatorView.backgroundColor = .white
|
||||
image = #imageLiteral(resourceName: "FilledCircleCheck")
|
||||
statusIndicatorView.backgroundColor = isLightMode ? .black : .white
|
||||
image = isLightMode ? #imageLiteral(resourceName: "FilledCircleCheckLightMode") : #imageLiteral(resourceName: "FilledCircleCheckDarkMode")
|
||||
case .failed: image = #imageLiteral(resourceName: "message_status_failed").asTintedImage(color: Colors.text)!
|
||||
}
|
||||
statusIndicatorView.image = image
|
||||
|
|
|
@ -182,7 +182,8 @@ final class NewConversationButtonSet : UIView {
|
|||
self.layoutIfNeeded()
|
||||
button.frame = frame
|
||||
button.layer.cornerRadius = size / 2
|
||||
button.setGlow(to: size, with: UIColor.black)
|
||||
let glowColor = isLightMode ? UIColor.black.withAlphaComponent(0.4) : UIColor.black
|
||||
button.setGlow(to: size, with: glowColor)
|
||||
button.backgroundColor = Colors.newConversationButtonCollapsedBackground
|
||||
}
|
||||
}
|
||||
|
@ -228,9 +229,11 @@ private final class NewConversationButton : UIImageView {
|
|||
backgroundColor = isMainButton ? Colors.accent : Colors.newConversationButtonCollapsedBackground
|
||||
let size = Values.newConversationButtonCollapsedSize
|
||||
layer.cornerRadius = size / 2
|
||||
if isMainButton { setGlow(to: size, with: Colors.newConversationButtonShadow) }
|
||||
let glowColor = isMainButton ? Colors.newConversationButtonShadow : (isLightMode ? UIColor.black.withAlphaComponent(0.4) : UIColor.black)
|
||||
setGlow(to: size, with: glowColor)
|
||||
layer.masksToBounds = false
|
||||
image = icon
|
||||
let iconColor = (isMainButton && isLightMode) ? UIColor.white : Colors.text
|
||||
image = icon.asTintedImage(color: iconColor)!
|
||||
contentMode = .center
|
||||
widthConstraint = set(.width, to: size)
|
||||
heightConstraint = set(.height, to: size)
|
||||
|
@ -241,7 +244,7 @@ private final class NewConversationButton : UIImageView {
|
|||
layer.shadowPath = UIBezierPath(ovalIn: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: size, height: size))).cgPath
|
||||
layer.shadowColor = color.cgColor
|
||||
layer.shadowOffset = CGSize(width: 0, height: 0.8)
|
||||
layer.shadowOpacity = isLightMode ? 0.6 : 1
|
||||
layer.shadowOpacity = isLightMode ? 0.4 : 1
|
||||
layer.shadowRadius = isLightMode ? 4 : 6
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,7 +289,8 @@ private extension NewClosedGroupVC {
|
|||
profilePictureView.hexEncodedPublicKey = hexEncodedPublicKey
|
||||
profilePictureView.update()
|
||||
displayNameLabel.text = UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? "Unknown Contact"
|
||||
tickImageView.image = hasTick ? #imageLiteral(resourceName: "CircleCheck") : #imageLiteral(resourceName: "Circle")
|
||||
let icon = hasTick ? #imageLiteral(resourceName: "CircleCheck") : #imageLiteral(resourceName: "Circle")
|
||||
tickImageView.image = icon.asTintedImage(color: Colors.text)!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ final class RegisterVC : BaseVC {
|
|||
private lazy var publicKeyLabel: UILabel = {
|
||||
let result = UILabel()
|
||||
result.textColor = Colors.text
|
||||
result.font = Fonts.spaceMono(ofSize: isSmallScreen ? Values.mediumFontSize : Values.largeFontSize)
|
||||
result.font = Fonts.spaceMono(ofSize: isSmallScreen ? Values.mediumFontSize : 20)
|
||||
result.numberOfLines = 0
|
||||
result.lineBreakMode = .byCharWrapping
|
||||
return result
|
||||
|
|
|
@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
action:@selector(cancelWasPressed:)
|
||||
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"cancel")];
|
||||
|
||||
cancelItem.tintColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
cancelItem.tintColor = LKColors.text;
|
||||
|
||||
self.navigationItem.leftBarButtonItem = cancelItem;
|
||||
|
||||
|
|
|
@ -366,9 +366,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
CGFloat maxGradientHeight = 40.f;
|
||||
CAGradientLayer *gradientLayer = [CAGradientLayer new];
|
||||
CGFloat whiteLevel = LKAppModeUtilities.isLightMode ? 1.f : 0.f;
|
||||
gradientLayer.colors = @[
|
||||
(id)[UIColor colorWithWhite:0.f alpha:0.f].CGColor,
|
||||
(id)[UIColor colorWithWhite:0.f alpha:0.4f].CGColor,
|
||||
(id)[UIColor colorWithWhite:whiteLevel alpha:0.f].CGColor,
|
||||
(id)[UIColor colorWithWhite:whiteLevel alpha:0.4f].CGColor,
|
||||
];
|
||||
OWSLayerView *gradientView =
|
||||
[[OWSLayerView alloc] initWithFrame:CGRectZero
|
||||
|
@ -717,7 +718,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
for (NSTextCheckingResult *match in
|
||||
[regex matchesInString:text options:NSMatchingWithoutAnchoringBounds range:NSMakeRange(0, text.length)]) {
|
||||
OWSAssertDebug(match.range.length >= ConversationSearchController.kMinimumSearchTextLength);
|
||||
[attributedText addAttribute:NSBackgroundColorAttributeName value:UIColor.whiteColor range:match.range];
|
||||
UIColor *highlightColor;
|
||||
if (LKAppModeUtilities.isLightMode) {
|
||||
highlightColor = isOutgoingMessage ? UIColor.whiteColor : [LKColors.accent colorWithAlphaComponent:LKValues.unimportantElementOpacity];
|
||||
} else {
|
||||
highlightColor = UIColor.whiteColor;
|
||||
}
|
||||
[attributedText addAttribute:NSBackgroundColorAttributeName value:highlightColor range:match.range];
|
||||
[attributedText addAttribute:NSForegroundColorAttributeName value:UIColor.blackColor range:match.range];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -322,7 +322,8 @@ const CGFloat kRemotelySourcedContentRowSpacing = 4;
|
|||
|
||||
if (self.isForPreview) {
|
||||
UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[cancelButton setImage:[UIImage imageNamed:@"X"] forState:UIControlStateNormal];
|
||||
UIImage *cancelIcon = [[UIImage imageNamed:@"X"] asTintedImageWithColor:LKColors.text];
|
||||
[cancelButton setImage:cancelIcon forState:UIControlStateNormal];
|
||||
cancelButton.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[cancelButton addTarget:self action:@selector(didTapCancel) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cancelButton autoSetDimension:ALDimensionWidth toSize:14.f];
|
||||
|
@ -380,7 +381,7 @@ const CGFloat kRemotelySourcedContentRowSpacing = 4;
|
|||
kRemotelySourcedContentRowMargin,
|
||||
kRemotelySourcedContentRowMargin);
|
||||
|
||||
UIColor *backgroundColor = [LKColors.text colorWithAlphaComponent:LKValues.unimportantElementOpacity];
|
||||
UIColor *backgroundColor = LKAppModeUtilities.isLightMode ? [UIColor.whiteColor colorWithAlphaComponent:LKValues.unimportantElementOpacity] : [LKColors.text colorWithAlphaComponent:LKValues.unimportantElementOpacity];
|
||||
[sourceRow addBackgroundViewWithBackgroundColor:backgroundColor];
|
||||
|
||||
return sourceRow;
|
||||
|
|
|
@ -138,20 +138,21 @@ const CGFloat kMaxTextViewHeight = 120;
|
|||
self.attachmentButton.accessibilityLabel = NSLocalizedString(@"ATTACHMENT_LABEL", @"Accessibility label for attaching photos");
|
||||
self.attachmentButton.accessibilityHint = NSLocalizedString(@"ATTACHMENT_HINT", @"Accessibility hint describing what you can do with the attachment button");
|
||||
[self.attachmentButton addTarget:self action:@selector(attachmentButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
||||
UIImage *attachmentImage = [UIImage imageNamed:@"CirclePlus"];
|
||||
UIImage *attachmentImage = [[UIImage imageNamed:@"CirclePlus"] asTintedImageWithColor:LKColors.text];
|
||||
[self.attachmentButton setImage:attachmentImage forState:UIControlStateNormal];
|
||||
[self.attachmentButton autoSetDimensionsToSize:CGSizeMake(40, kMinTextViewHeight)];
|
||||
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _attachmentButton);
|
||||
|
||||
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
UIImage *sendImage = [UIImage imageNamed:@"ArrowUp"];
|
||||
NSString *iconName = LKAppModeUtilities.isLightMode ? @"ArrowUpLightMode" : @"ArrowUpDarkMode";
|
||||
UIImage *sendImage = [UIImage imageNamed:iconName];
|
||||
[self.sendButton setImage:sendImage forState:UIControlStateNormal];
|
||||
[self.sendButton autoSetDimensionsToSize:CGSizeMake(40, kMinTextViewHeight)];
|
||||
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _sendButton);
|
||||
[self.sendButton addTarget:self action:@selector(sendButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
_voiceMemoButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
UIImage *voiceMemoIcon = [UIImage imageNamed:@"Microphone"];
|
||||
UIImage *voiceMemoIcon = [[UIImage imageNamed:@"Microphone"] asTintedImageWithColor:LKColors.text];
|
||||
[self.voiceMemoButton setImage:voiceMemoIcon forState:UIControlStateNormal];
|
||||
[self.voiceMemoButton autoSetDimensionsToSize:CGSizeMake(40, kMinTextViewHeight)];
|
||||
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _voiceMemoButton);
|
||||
|
@ -697,7 +698,7 @@ const CGFloat kMaxTextViewHeight = 120;
|
|||
[imageView autoVCenterInSuperview];
|
||||
[imageView autoPinLeadingToSuperviewMarginWithInset:LKValues.smallSpacing];
|
||||
[self.recordingLabel autoVCenterInSuperview];
|
||||
[self.recordingLabel autoPinLeadingToTrailingEdgeOfView:imageView offset:4.f];
|
||||
[self.recordingLabel autoPinLeadingToTrailingEdgeOfView:imageView offset:12.f];
|
||||
[cancelLabel autoVCenterInSuperview];
|
||||
[cancelLabel autoHCenterInSuperview];
|
||||
[self.voiceMemoUI layoutIfNeeded];
|
||||
|
|
|
@ -4357,7 +4357,7 @@ typedef enum : NSUInteger {
|
|||
searchTextField.backgroundColor = LKColors.searchBarBackground;
|
||||
searchTextField.textColor = LKColors.text;
|
||||
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", @"") attributes:@{ NSForegroundColorAttributeName : LKColors.searchBarPlaceholder }];
|
||||
searchBar.keyboardAppearance = UIKeyboardAppearanceDark;
|
||||
searchBar.keyboardAppearance = LKAppModeUtilities.isLightMode ? UIKeyboardAppearanceDefault : UIKeyboardAppearanceDark;
|
||||
[searchBar setPositionAdjustment:UIOffsetMake(4, 0) forSearchBarIcon:UISearchBarIconSearch];
|
||||
[searchBar setSearchTextPositionAdjustment:UIOffsetMake(2, 0)];
|
||||
[searchBar setPositionAdjustment:UIOffsetMake(-4, 0) forSearchBarIcon:UISearchBarIconClear];
|
||||
|
|
|
@ -180,7 +180,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
|
|||
|
||||
// for iPhoneX devices, extends the black background to the bottom edge of the view.
|
||||
let bottomBannerContainer = UIView()
|
||||
bottomBannerContainer.backgroundColor = Colors.navigationBarBackground
|
||||
bottomBannerContainer.backgroundColor = isLightMode ? UIColor.black : Colors.navigationBarBackground
|
||||
self.view.addSubview(bottomBannerContainer)
|
||||
bottomBannerContainer.autoPinWidthToSuperview()
|
||||
bottomBannerContainer.autoPinEdge(.top, to: .bottom, of: self.collectionView)
|
||||
|
|
|
@ -65,8 +65,8 @@ public class MediaTileViewController: UICollectionViewController, MediaGalleryDa
|
|||
]
|
||||
footerBar.setItems(footerItems, animated: false)
|
||||
|
||||
footerBar.barTintColor = Theme.darkThemeNavbarBackgroundColor
|
||||
footerBar.tintColor = Theme.darkThemeNavbarIconColor
|
||||
footerBar.barTintColor = Colors.navigationBarBackground
|
||||
footerBar.tintColor = Colors.text
|
||||
|
||||
return footerBar
|
||||
}()
|
||||
|
@ -847,12 +847,13 @@ private class MediaGallerySectionHeader: UICollectionReusableView {
|
|||
|
||||
super.init(frame: frame)
|
||||
|
||||
self.backgroundColor = Theme.darkThemeNavbarBackgroundColor.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor)
|
||||
self.backgroundColor = isLightMode ? Colors.cellBackground : Theme.darkThemeNavbarBackgroundColor.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor)
|
||||
|
||||
self.addSubview(blurEffectView)
|
||||
self.addSubview(label)
|
||||
|
||||
blurEffectView.autoPinEdgesToSuperviewEdges()
|
||||
blurEffectView.isHidden = isLightMode
|
||||
label.autoPinEdge(toSuperviewMargin: .trailing)
|
||||
label.autoPinEdge(toSuperviewMargin: .leading)
|
||||
label.autoVCenterInSuperview()
|
||||
|
|
|
@ -49,7 +49,7 @@ class PhotoCaptureViewController: OWSViewController {
|
|||
|
||||
override func loadView() {
|
||||
self.view = UIView()
|
||||
self.view.backgroundColor = Colors.navigationBarBackground
|
||||
self.view.backgroundColor = .black
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
|
|
@ -256,14 +256,23 @@ class SendMediaNavigationController: OWSNavigationController {
|
|||
}
|
||||
|
||||
extension SendMediaNavigationController: UINavigationControllerDelegate {
|
||||
|
||||
private func setNavBarBackgroundColor(to color: UIColor) {
|
||||
guard let navBar = navigationBar as? OWSNavigationBar else { return }
|
||||
navBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
|
||||
navBar.shadowImage = UIImage()
|
||||
navBar.isTranslucent = false
|
||||
navBar.barTintColor = color
|
||||
}
|
||||
|
||||
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
|
||||
// if let navbarTheme = preferredNavbarTheme(viewController: viewController) {
|
||||
// if let owsNavBar = navigationBar as? OWSNavigationBar {
|
||||
// owsNavBar.overrideTheme(type: navbarTheme)
|
||||
// } else {
|
||||
// owsFailDebug("unexpected navigationBar: \(navigationBar)")
|
||||
// }
|
||||
// }
|
||||
if viewController == captureViewController {
|
||||
setNavBarBackgroundColor(to: .black)
|
||||
} else if viewController == mediaLibraryViewController {
|
||||
setNavBarBackgroundColor(to: .white)
|
||||
} else {
|
||||
setNavBarBackgroundColor(to: Colors.navigationBarBackground)
|
||||
}
|
||||
|
||||
switch viewController {
|
||||
case is PhotoCaptureViewController:
|
||||
|
@ -286,13 +295,14 @@ extension SendMediaNavigationController: UINavigationControllerDelegate {
|
|||
|
||||
// In case back navigation was canceled, we re-apply whatever is showing.
|
||||
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
|
||||
// if let navbarTheme = preferredNavbarTheme(viewController: viewController) {
|
||||
// if let owsNavBar = navigationBar as? OWSNavigationBar {
|
||||
// owsNavBar.overrideTheme(type: navbarTheme)
|
||||
// } else {
|
||||
// owsFailDebug("unexpected navigationBar: \(navigationBar)")
|
||||
// }
|
||||
// }
|
||||
if viewController == captureViewController {
|
||||
setNavBarBackgroundColor(to: .black)
|
||||
} else if viewController == mediaLibraryViewController {
|
||||
setNavBarBackgroundColor(to: .white)
|
||||
} else {
|
||||
setNavBarBackgroundColor(to: Colors.navigationBarBackground)
|
||||
}
|
||||
|
||||
self.updateButtons(topViewController: viewController)
|
||||
}
|
||||
|
||||
|
|
|
@ -994,7 +994,7 @@ const CGFloat kIconViewLength = 24;
|
|||
OWSAssertDebug(icon);
|
||||
UIImageView *iconView = [UIImageView new];
|
||||
iconView.image = [icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
iconView.tintColor = [LKColors.text colorWithAlphaComponent:LKValues.unimportantElementOpacity];
|
||||
iconView.tintColor = LKColors.text;
|
||||
iconView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
iconView.layer.minificationFilter = kCAFilterTrilinear;
|
||||
iconView.layer.magnificationFilter = kCAFilterTrilinear;
|
||||
|
@ -1245,7 +1245,7 @@ const CGFloat kIconViewLength = 24;
|
|||
- (void)updateDisappearingMessagesDurationLabel
|
||||
{
|
||||
if (self.disappearingMessagesConfiguration.isEnabled) {
|
||||
NSString *keepForFormat = NSLocalizedString(@"Disappear after %@", @"");
|
||||
NSString *keepForFormat = @"Disappear after %@";
|
||||
self.disappearingMessagesDurationLabel.text =
|
||||
[NSString stringWithFormat:keepForFormat, self.disappearingMessagesConfiguration.durationString];
|
||||
} else {
|
||||
|
|
|
@ -98,7 +98,7 @@ private class CaptionView: UIView {
|
|||
let textView = CaptionTextView()
|
||||
|
||||
textView.font = UIFont.ows_dynamicTypeBody
|
||||
textView.textColor = .white
|
||||
textView.textColor = Colors.text
|
||||
textView.backgroundColor = .clear
|
||||
textView.isEditable = false
|
||||
textView.isSelectable = false
|
||||
|
|
|
@ -28,14 +28,14 @@ public final class ProfilePictureView : UIView {
|
|||
addSubview(imageView)
|
||||
imageView.pin(.leading, to: .leading, of: self)
|
||||
imageView.pin(.top, to: .top, of: self)
|
||||
let imageViewSize = CGFloat(45) // Values.mediumProfilePictureSize
|
||||
let imageViewSize = CGFloat(Values.mediumProfilePictureSize)
|
||||
imageViewWidthConstraint = imageView.set(.width, to: imageViewSize)
|
||||
imageViewHeightConstraint = imageView.set(.height, to: imageViewSize)
|
||||
// Set up additional image view
|
||||
addSubview(additionalImageView)
|
||||
additionalImageView.pin(.trailing, to: .trailing, of: self)
|
||||
additionalImageView.pin(.bottom, to: .bottom, of: self)
|
||||
let additionalImageViewSize = CGFloat(35) // Values.smallProfilePictureSize
|
||||
let additionalImageViewSize = CGFloat(Values.smallProfilePictureSize)
|
||||
additionalImageView.set(.width, to: additionalImageViewSize)
|
||||
additionalImageView.set(.height, to: additionalImageViewSize)
|
||||
additionalImageView.layer.cornerRadius = additionalImageViewSize / 2
|
||||
|
@ -49,7 +49,7 @@ public final class ProfilePictureView : UIView {
|
|||
}
|
||||
let size: CGFloat
|
||||
if let additionalHexEncodedPublicKey = additionalHexEncodedPublicKey, !isRSSFeed {
|
||||
size = 35 // Values.smallProfilePictureSize
|
||||
size = Values.smallProfilePictureSize
|
||||
imageViewWidthConstraint.constant = size
|
||||
imageViewHeightConstraint.constant = size
|
||||
additionalImageView.isHidden = false
|
||||
|
@ -75,9 +75,9 @@ public final class ProfilePictureView : UIView {
|
|||
private func getImageView() -> UIImageView {
|
||||
let result = UIImageView()
|
||||
result.layer.masksToBounds = true
|
||||
result.backgroundColor = UIColor(rgbHex: 0xD8D8D8) // Colors.unimportant
|
||||
result.layer.borderColor = UIColor(rgbHex: 0x979797).cgColor // Colors.border
|
||||
result.layer.borderWidth = 1 // Values.borderThickness
|
||||
result.backgroundColor = Colors.unimportant
|
||||
result.layer.borderColor = Colors.border.cgColor
|
||||
result.layer.borderWidth = Values.borderThickness
|
||||
result.contentMode = .scaleAspectFit
|
||||
return result
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
public enum AppMode {
|
||||
case light, dark
|
||||
|
||||
public static var current: AppMode = .light
|
||||
public static var current: AppMode = .dark
|
||||
}
|
||||
|
||||
public var isLightMode: Bool {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
@objc public extension UIColor {
|
||||
|
||||
@objc public convenience init(hex value: UInt) {
|
||||
@objc convenience init(hex value: UInt) {
|
||||
let red = CGFloat((value >> 16) & 0xff) / 255
|
||||
let green = CGFloat((value >> 8) & 0xff) / 255
|
||||
let blue = CGFloat((value >> 0) & 0xff) / 255
|
||||
|
@ -24,16 +24,16 @@ public final class Colors : NSObject {
|
|||
@objc public static var searchBarBackground = UIColor(red: 142 / 255, green: 142 / 255, blue: 147 / 255, alpha: 0.12)
|
||||
@objc public static var newConversationButtonShadow = UIColor(hex: 0x077C44)
|
||||
@objc public static var separator = UIColor(hex: 0x36383C)
|
||||
@objc public static var unimportantButtonBackground = UIColor(hex: 0x323232)
|
||||
@objc public static var unimportantButtonBackground = isLightMode ? UIColor.clear : UIColor(hex: 0x323232)
|
||||
@objc public static var buttonBackground = isLightMode ? UIColor(hex: 0xFCFCFC) : UIColor(hex: 0x1B1B1B)
|
||||
@objc public static var settingButtonSelected = isLightMode ? UIColor(hex: 0xDFDFDF) : UIColor(hex: 0x0C0C0C)
|
||||
@objc public static var modalBackground = isLightMode ? UIColor(hex: 0xFCFCFC) : UIColor(hex: 0x101011)
|
||||
@objc public static var modalBorder = UIColor(hex: 0x212121)
|
||||
@objc public static var fakeChatBubbleBackground = isLightMode ? UIColor(hex: 0xFAFAFA) : UIColor(hex: 0x3F4146)
|
||||
@objc public static var fakeChatBubbleBackground = isLightMode ? UIColor(hex: 0xF5F5F5) : UIColor(hex: 0x3F4146)
|
||||
@objc public static var fakeChatBubbleText = UIColor(hex: 0x000000)
|
||||
@objc public static var composeViewBackground = UIColor(hex: 0x1B1B1B)
|
||||
@objc public static var composeViewTextFieldBackground = UIColor(hex: 0x141414)
|
||||
@objc public static var receivedMessageBackground = UIColor(hex: 0x222325)
|
||||
@objc public static var sentMessageBackground = UIColor(hex: 0x3F4146)
|
||||
@objc public static var newConversationButtonCollapsedBackground = UIColor(hex: 0x1F1F1F)
|
||||
@objc public static var composeViewBackground = isLightMode ? UIColor(hex: 0xFCFCFC) : UIColor(hex: 0x1B1B1B)
|
||||
@objc public static var composeViewTextFieldBackground = isLightMode ? UIColor(hex: 0xEDEDED) : UIColor(hex: 0x141414)
|
||||
@objc public static var receivedMessageBackground = isLightMode ? UIColor(hex: 0xF5F5F5) : UIColor(hex: 0x222325)
|
||||
@objc public static var sentMessageBackground = isLightMode ? UIColor(hex: 0x00E97B) : UIColor(hex: 0x3F4146)
|
||||
@objc public static var newConversationButtonCollapsedBackground = isLightMode ? UIColor(hex: 0xF5F5F5) : UIColor(hex: 0x1F1F1F)
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@ public final class Values : NSObject {
|
|||
@objc public static let composeViewTextFieldPlaceholderOpacity = CGFloat(0.4)
|
||||
|
||||
// MARK: - Font Sizes
|
||||
@objc public static let verySmallFontSize = CGFloat(10)
|
||||
@objc public static let smallFontSize = CGFloat(13)
|
||||
@objc public static let mediumFontSize = CGFloat(15)
|
||||
@objc public static let largeFontSize = CGFloat(20)
|
||||
@objc public static let veryLargeFontSize = CGFloat(25)
|
||||
@objc public static let verySmallFontSize = isSmallScreen ? CGFloat(10) : CGFloat(12)
|
||||
@objc public static let smallFontSize = isSmallScreen ? CGFloat(13) : CGFloat(15)
|
||||
@objc public static let mediumFontSize = isSmallScreen ? CGFloat(15) : CGFloat(17)
|
||||
@objc public static let largeFontSize = isSmallScreen ? CGFloat(20) : CGFloat(22)
|
||||
@objc public static let veryLargeFontSize = isSmallScreen ? CGFloat(25) : CGFloat(27)
|
||||
@objc public static let massiveFontSize = CGFloat(50)
|
||||
|
||||
// MARK: - Element Sizes
|
||||
|
|
|
@ -64,8 +64,8 @@ class AttachmentApprovalInputAccessoryView: UIView {
|
|||
addSubview(backgroundView)
|
||||
backgroundView.autoPinEdgesToSuperviewEdges()
|
||||
|
||||
currentCaptionLabel.textColor = UIColor(white: 1, alpha: 0.8)
|
||||
currentCaptionLabel.font = .systemFont(ofSize: 15) // Values.mediumFontSize
|
||||
currentCaptionLabel.textColor = .white
|
||||
currentCaptionLabel.font = .systemFont(ofSize: Values.mediumFontSize)
|
||||
currentCaptionLabel.numberOfLines = 5
|
||||
currentCaptionLabel.lineBreakMode = .byWordWrapping
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|||
override public func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.view.backgroundColor = .red
|
||||
self.view.backgroundColor = Colors.navigationBarBackground
|
||||
|
||||
// avoid an unpleasant "bounce" which doesn't make sense in the context of a single item.
|
||||
pagerScrollView?.isScrollEnabled = attachmentItems.count > 1
|
||||
|
@ -174,10 +174,10 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|||
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
|
||||
navigationBar.shadowImage = UIImage()
|
||||
navigationBar.isTranslucent = false
|
||||
navigationBar.barTintColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
navigationBar.barTintColor = Colors.navigationBarBackground
|
||||
navigationBar.respectsTheme = true
|
||||
navigationBar.backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
let backgroundImage = UIImage(color: UIColor(rgbHex: 0x161616)) // Colors.navigationBarBackground
|
||||
navigationBar.backgroundColor = Colors.navigationBarBackground
|
||||
let backgroundImage = UIImage(color: Colors.navigationBarBackground)
|
||||
navigationBar.setBackgroundImage(backgroundImage, for: .default)
|
||||
|
||||
updateContents()
|
||||
|
@ -290,13 +290,9 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|||
let cancelButton = OWSButton(title: CommonStrings.cancelButton) { [weak self] in
|
||||
self?.cancelPressed()
|
||||
}
|
||||
cancelButton.setTitleColor(.white, for: .normal)
|
||||
cancelButton.setTitleColor(Colors.text, for: .normal)
|
||||
if let titleLabel = cancelButton.titleLabel {
|
||||
titleLabel.font = UIFont.systemFont(ofSize: 18.0)
|
||||
titleLabel.layer.shadowColor = UIColor.black.cgColor
|
||||
titleLabel.layer.shadowRadius = 2.0
|
||||
titleLabel.layer.shadowOpacity = 0.66
|
||||
titleLabel.layer.shadowOffset = .zero
|
||||
titleLabel.font = UIFont.systemFont(ofSize: 17.0)
|
||||
} else {
|
||||
owsFailDebug("Missing titleLabel.")
|
||||
}
|
||||
|
@ -306,7 +302,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|||
// Mimic a conventional back button, but with a shadow.
|
||||
let isRTL = CurrentAppContext().isRTL
|
||||
let imageName = isRTL ? "NavBarBackRTL" : "NavBarBack"
|
||||
let backButton = OWSButton(imageName: imageName, tintColor: .white) { [weak self] in
|
||||
let backButton = OWSButton(imageName: imageName, tintColor: Colors.text) { [weak self] in
|
||||
self?.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
|
@ -341,10 +337,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|||
backButton.frame = CGRect(origin: .zero, size: CGSize(width: backImageSize.width + kExtraRightPadding,
|
||||
height: backImageSize.height + kExtraHeightPadding))
|
||||
|
||||
backButton.layer.shadowColor = UIColor.black.cgColor
|
||||
backButton.layer.shadowRadius = 2.0
|
||||
backButton.layer.shadowOpacity = 0.66
|
||||
backButton.layer.shadowOffset = .zero
|
||||
// Note: using a custom leftBarButtonItem breaks the interactive pop gesture.
|
||||
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: backButton)
|
||||
}
|
||||
|
|
|
@ -125,12 +125,12 @@ class AttachmentCaptionToolbar: UIView, UITextViewDelegate {
|
|||
private func buildTextView() -> UITextView {
|
||||
let textView = AttachmentTextView()
|
||||
|
||||
textView.keyboardAppearance = Theme.darkThemeKeyboardAppearance
|
||||
textView.keyboardAppearance = isLightMode ? .default : .dark
|
||||
textView.backgroundColor = .clear
|
||||
textView.tintColor = Theme.darkThemePrimaryColor
|
||||
textView.tintColor = .white
|
||||
|
||||
textView.font = UIFont.ows_dynamicTypeBody
|
||||
textView.textColor = Theme.darkThemePrimaryColor
|
||||
textView.textColor = .white
|
||||
textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7)
|
||||
|
||||
return textView
|
||||
|
|
|
@ -86,7 +86,7 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD
|
|||
|
||||
scrollView.autoPinEdgesToSuperviewEdges()
|
||||
|
||||
let backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
let backgroundColor = Colors.navigationBarBackground
|
||||
self.view.backgroundColor = backgroundColor
|
||||
|
||||
// Create full screen container view so the scrollView
|
||||
|
|
|
@ -32,7 +32,7 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate {
|
|||
|
||||
// Layout Constants
|
||||
|
||||
let kMinTextViewHeight: CGFloat = 38
|
||||
let kMinTextViewHeight: CGFloat = 40
|
||||
var maxTextViewHeight: CGFloat {
|
||||
// About ~4 lines in portrait and ~3 lines in landscape.
|
||||
// Otherwise we risk obscuring too much of the content.
|
||||
|
@ -61,9 +61,9 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate {
|
|||
sendButton.setTitle(sendTitle, for: .normal)
|
||||
sendButton.addTarget(self, action: #selector(didTapSend), for: .touchUpInside)
|
||||
|
||||
sendButton.titleLabel?.font = .boldSystemFont(ofSize: 15) // Values.mediumFontSize
|
||||
sendButton.titleLabel?.font = .boldSystemFont(ofSize: Values.mediumFontSize)
|
||||
sendButton.titleLabel?.textAlignment = .center
|
||||
sendButton.tintColor = UIColor(rgbHex: 0x00F782) // Colors.accent
|
||||
sendButton.tintColor = Colors.accent
|
||||
|
||||
// Increase hit area of send button
|
||||
sendButton.contentEdgeInsets = UIEdgeInsets(top: 6, left: 8, bottom: 6, right: 8)
|
||||
|
@ -167,8 +167,8 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate {
|
|||
private lazy var textContainer: UIView = {
|
||||
let textContainer = UIView()
|
||||
|
||||
textContainer.layer.borderColor = Theme.darkThemePrimaryColor.cgColor
|
||||
textContainer.layer.borderWidth = 0.5
|
||||
textContainer.layer.borderColor = UIColor.white.cgColor
|
||||
textContainer.layer.borderWidth = Values.separatorThickness
|
||||
textContainer.layer.cornerRadius = kMinTextViewHeight / 2
|
||||
textContainer.clipsToBounds = true
|
||||
|
||||
|
@ -184,12 +184,12 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate {
|
|||
private func buildTextView() -> UITextView {
|
||||
let textView = AttachmentTextView()
|
||||
|
||||
textView.keyboardAppearance = Theme.darkThemeKeyboardAppearance
|
||||
textView.keyboardAppearance = isLightMode ? .default : .dark
|
||||
textView.backgroundColor = .clear
|
||||
textView.tintColor = Theme.darkThemePrimaryColor
|
||||
textView.tintColor = .white
|
||||
|
||||
textView.font = .systemFont(ofSize: 15) // Values.mediumFontSize
|
||||
textView.textColor = Theme.darkThemePrimaryColor
|
||||
textView.font = .systemFont(ofSize: Values.mediumFontSize)
|
||||
textView.textColor = .white
|
||||
textView.showsVerticalScrollIndicator = false
|
||||
textView.textContainerInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
|
|||
private var controlTintColor: UIColor {
|
||||
switch mode {
|
||||
case .small, .large:
|
||||
return UIColor(rgbHex: 0x00F782) // Colors.accent
|
||||
return Colors.accent
|
||||
case .attachmentApproval:
|
||||
return UIColor.white
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#import "UIColor+OWS.h"
|
||||
#import "UIFont+OWS.h"
|
||||
#import "UIView+OWS.h"
|
||||
#import <SignalMessaging/SignalMessaging-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -108,20 +109,20 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
|
||||
+ (void)configureCell:(UITableViewCell *)cell
|
||||
{
|
||||
cell.backgroundColor = [UIColor colorWithRGBHex:0x1B1B1B]; // Colors.cellBackground
|
||||
cell.backgroundColor = LKColors.cellBackground;
|
||||
if (@available(iOS 13, *)) {
|
||||
cell.contentView.backgroundColor = UIColor.clearColor;
|
||||
} else {
|
||||
cell.contentView.backgroundColor = [UIColor colorWithRGBHex:0x1B1B1B]; // Colors.cellBackground
|
||||
cell.contentView.backgroundColor = LKColors.cellBackground;
|
||||
}
|
||||
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:15]; // Values.mediumFontSize
|
||||
cell.textLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
cell.detailTextLabel.font = [UIFont systemFontOfSize:15]; // Values.mediumFontSize
|
||||
cell.detailTextLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:LKValues.mediumFontSize];
|
||||
cell.textLabel.textColor = LKColors.text;
|
||||
cell.detailTextLabel.font = [UIFont systemFontOfSize:LKValues.mediumFontSize];
|
||||
cell.detailTextLabel.textColor = LKColors.text;
|
||||
|
||||
UIView *selectedBackgroundView = [UIView new];
|
||||
selectedBackgroundView.backgroundColor = [UIColor colorWithRGBHex:0x0C0C0C]; // Colors.cellSelected
|
||||
selectedBackgroundView.backgroundColor = LKColors.cellSelected;
|
||||
cell.selectedBackgroundView = selectedBackgroundView;
|
||||
}
|
||||
|
||||
|
@ -223,7 +224,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
cell.textLabel.text = text;
|
||||
cell.accessoryType = accessoryType;
|
||||
cell.accessibilityIdentifier = accessibilityIdentifier;
|
||||
cell.tintColor = [UIColor colorWithRGBHex:0x00F782]; // Colors.accent
|
||||
cell.tintColor = LKColors.accent;
|
||||
return cell;
|
||||
};
|
||||
return item;
|
||||
|
@ -350,10 +351,10 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
// These cells look quite different.
|
||||
//
|
||||
// Smaller font.
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:15]; // Values.mediumFontSize
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:LKValues.mediumFontSize];
|
||||
// Soft color.
|
||||
// TODO: Theme, review with design.
|
||||
cell.textLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
cell.textLabel.textColor = LKColors.text;
|
||||
// Centered.
|
||||
cell.textLabel.textAlignment = NSTextAlignmentCenter;
|
||||
cell.userInteractionEnabled = NO;
|
||||
|
@ -397,8 +398,8 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
|
||||
UILabel *accessoryLabel = [UILabel new];
|
||||
accessoryLabel.text = accessoryText;
|
||||
accessoryLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
accessoryLabel.font = [UIFont systemFontOfSize:15]; // Values.mediumFontSize
|
||||
accessoryLabel.textColor = LKColors.text;
|
||||
accessoryLabel.font = [UIFont systemFontOfSize:LKValues.mediumFontSize];
|
||||
accessoryLabel.textAlignment = NSTextAlignmentRight;
|
||||
[accessoryLabel sizeToFit];
|
||||
cell.accessoryView = accessoryLabel;
|
||||
|
@ -475,7 +476,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
|
||||
UISwitch *cellSwitch = [UISwitch new];
|
||||
cell.accessoryView = cellSwitch;
|
||||
cellSwitch.onTintColor = [UIColor colorWithRGBHex:0x00F782]; // Colors.accent
|
||||
cellSwitch.onTintColor = LKColors.accent;
|
||||
[cellSwitch setOn:isOnBlock()];
|
||||
[cellSwitch addTarget:weakTarget action:selector forControlEvents:UIControlEventValueChanged];
|
||||
cellSwitch.enabled = isEnabledBlock();
|
||||
|
|
|
@ -63,7 +63,7 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value)
|
|||
const CGFloat kButtonHeight = 40.f;
|
||||
OWSFlatButton *button =
|
||||
[OWSFlatButton buttonWithTitle:NSLocalizedString(@"Unlock Session", @"")
|
||||
font:[UIFont boldSystemFontOfSize:15] // Values.mediumFontSize
|
||||
font:[UIFont boldSystemFontOfSize:LKValues.mediumFontSize]
|
||||
titleColor:UIColor.whiteColor
|
||||
backgroundColor:UIColor.clearColor
|
||||
target:self
|
||||
|
|
|
@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[super loadView];
|
||||
|
||||
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"X"] style:UIBarButtonItemStylePlain target:self action:@selector(dismissPressed:)];
|
||||
closeButton.tintColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
closeButton.tintColor = LKColors.text;
|
||||
self.navigationItem.leftBarButtonItem = closeButton;
|
||||
|
||||
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
|
||||
|
@ -89,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
||||
navigationBar.shadowImage = [UIImage new];
|
||||
[navigationBar setTranslucent:NO];
|
||||
navigationBar.barTintColor = [UIColor colorWithRGBHex:0x161616]; // Colors.navigationBarBackground
|
||||
navigationBar.barTintColor = LKColors.navigationBarBackground;
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[[DisappearingTimerConfigurationView alloc]
|
||||
initWithDurationSeconds:disappearingMessagesConfiguration.durationSeconds];
|
||||
|
||||
disappearingTimerConfigurationView.tintColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
disappearingTimerConfigurationView.tintColor = LKColors.text;
|
||||
[disappearingTimerConfigurationView autoSetDimensionsToSize:CGSizeMake(44, 44)];
|
||||
|
||||
[cell ows_setAccessoryView:disappearingTimerConfigurationView];
|
||||
|
|
|
@ -88,7 +88,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
|||
// Loki: Customize title
|
||||
UILabel *titleLabel = [UILabel new];
|
||||
titleLabel.text = NSLocalizedString(@"Share", @"");
|
||||
titleLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
titleLabel.textColor = LKColors.text;
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:25];
|
||||
self.navigationItem.titleView = titleLabel;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
|||
const CGFloat contentVMargin = 0;
|
||||
|
||||
UIView *header = [UIView new];
|
||||
header.backgroundColor = [UIColor colorWithRGBHex:0x161616]; // Colors.navigationBarBackground
|
||||
header.backgroundColor = LKColors.navigationBarBackground;
|
||||
|
||||
UIButton *cancelShareButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[header addSubview:cancelShareButton];
|
||||
|
|
|
@ -77,7 +77,7 @@ const CGFloat kContactCellAvatarTextMargin = 12;
|
|||
self.layoutMargins = UIEdgeInsetsZero;
|
||||
|
||||
_profilePictureView = [LKProfilePictureView new];
|
||||
CGFloat profilePictureSize = 45; // Values.mediumProfilePictureSize
|
||||
CGFloat profilePictureSize = LKValues.mediumProfilePictureSize;
|
||||
[self.profilePictureView autoSetDimension:ALDimensionWidth toSize:profilePictureSize];
|
||||
[self.profilePictureView autoSetDimension:ALDimensionHeight toSize:profilePictureSize];
|
||||
self.profilePictureView.size = profilePictureSize;
|
||||
|
@ -106,7 +106,7 @@ const CGFloat kContactCellAvatarTextMargin = 12;
|
|||
[self.accessoryViewContainer setContentHuggingHorizontalHigh];
|
||||
|
||||
self.axis = UILayoutConstraintAxisHorizontal;
|
||||
self.spacing = 16; // Values.mediumSpacing
|
||||
self.spacing = LKValues.mediumSpacing;
|
||||
self.alignment = UIStackViewAlignmentCenter;
|
||||
[self addArrangedSubview:self.profilePictureView];
|
||||
[self addArrangedSubview:self.nameContainerView];
|
||||
|
|
|
@ -74,7 +74,7 @@ public class GalleryRailCellView: UIView {
|
|||
layoutMargins = UIEdgeInsets(top: 0, left: cellBorderWidth, bottom: 0, right: cellBorderWidth)
|
||||
|
||||
if isSelected {
|
||||
contentContainer.layer.borderColor = UIColor(rgbHex: 0x00F782).cgColor // Colors.accent
|
||||
contentContainer.layer.borderColor = Colors.accent.cgColor
|
||||
contentContainer.layer.borderWidth = cellBorderWidth
|
||||
} else {
|
||||
contentContainer.layer.borderWidth = 0
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ImageEditorBrushViewController: OWSViewController {
|
|||
|
||||
public override func loadView() {
|
||||
self.view = UIView()
|
||||
self.view.backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
self.view.backgroundColor = Colors.navigationBarBackground
|
||||
self.view.isOpaque = true
|
||||
|
||||
canvasView.configureSubviews()
|
||||
|
|
|
@ -86,21 +86,21 @@ class ImageEditorCropViewController: OWSViewController {
|
|||
override func loadView() {
|
||||
self.view = UIView()
|
||||
|
||||
self.view.backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
self.view.backgroundColor = Colors.navigationBarBackground
|
||||
self.view.layoutMargins = .zero
|
||||
|
||||
// MARK: - Buttons
|
||||
|
||||
let rotate90Button = OWSButton(imageName: "image_editor_rotate",
|
||||
tintColor: UIColor.white) { [weak self] in
|
||||
tintColor: Colors.text) { [weak self] in
|
||||
self?.rotate90ButtonPressed()
|
||||
}
|
||||
let flipButton = OWSButton(imageName: "image_editor_flip",
|
||||
tintColor: UIColor.white) { [weak self] in
|
||||
tintColor: Colors.text) { [weak self] in
|
||||
self?.flipButtonPressed()
|
||||
}
|
||||
let cropLockButton = OWSButton(imageName: "image_editor_crop_unlock",
|
||||
tintColor: UIColor.white) { [weak self] in
|
||||
tintColor: Colors.text) { [weak self] in
|
||||
self?.cropLockButtonPressed()
|
||||
}
|
||||
self.cropLockButton = cropLockButton
|
||||
|
|
|
@ -161,7 +161,7 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel
|
|||
|
||||
public override func loadView() {
|
||||
self.view = UIView()
|
||||
self.view.backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
self.view.backgroundColor = Colors.navigationBarBackground
|
||||
self.view.isOpaque = true
|
||||
|
||||
canvasView.configureSubviews()
|
||||
|
|
|
@ -6,16 +6,12 @@ import UIKit
|
|||
|
||||
public extension NSObject {
|
||||
|
||||
public func navigationBarButton(imageName: String,
|
||||
func navigationBarButton(imageName: String,
|
||||
selector: Selector) -> UIView {
|
||||
let button = OWSButton()
|
||||
button.setImage(imageName: imageName)
|
||||
button.tintColor = .white
|
||||
button.tintColor = Colors.text
|
||||
button.addTarget(self, action: selector, for: .touchUpInside)
|
||||
button.layer.shadowColor = UIColor.black.cgColor
|
||||
button.layer.shadowRadius = 2
|
||||
button.layer.shadowOpacity = 0.66
|
||||
button.layer.shadowOffset = .zero
|
||||
return button
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +20,7 @@ public extension NSObject {
|
|||
|
||||
public extension UIViewController {
|
||||
|
||||
public func updateNavigationBar(navigationBarItems: [UIView]) {
|
||||
func updateNavigationBar(navigationBarItems: [UIView]) {
|
||||
guard navigationBarItems.count > 0 else {
|
||||
self.navigationItem.rightBarButtonItems = []
|
||||
return
|
||||
|
@ -55,9 +51,9 @@ public extension UIViewController {
|
|||
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
|
||||
navigationBar.shadowImage = UIImage()
|
||||
navigationBar.isTranslucent = false
|
||||
navigationBar.barTintColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
navigationBar.backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
|
||||
let backgroundImage = UIImage(color: UIColor(rgbHex: 0x161616)) // Colors.navigationBarBackground
|
||||
navigationBar.barTintColor = Colors.navigationBarBackground
|
||||
navigationBar.backgroundColor = Colors.navigationBarBackground
|
||||
let backgroundImage = UIImage(color: Colors.navigationBarBackground)
|
||||
navigationBar.setBackgroundImage(backgroundImage, for: .default)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[attributedPlaceholder addAttribute:NSForegroundColorAttributeName value:foregroundColor range:NSMakeRange(0, placeholder.length)];
|
||||
textField.attributedPlaceholder = attributedPlaceholder;
|
||||
}
|
||||
textField.keyboardAppearance = Theme.keyboardAppearance;
|
||||
textField.keyboardAppearance = LKAppModeUtilities.isLightMode ? UIKeyboardAppearanceDefault : UIKeyboardAppearanceDark;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#import "OWSTextField.h"
|
||||
#import "Theme.h"
|
||||
#import <SignalMessaging/SignalMessaging-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -29,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- (void)ows_applyTheme
|
||||
{
|
||||
self.keyboardAppearance = Theme.keyboardAppearance;
|
||||
self.keyboardAppearance = LKAppModeUtilities.isLightMode ? UIKeyboardAppearanceDefault : UIKeyboardAppearanceDark;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#import "OWSTextView.h"
|
||||
#import "Theme.h"
|
||||
#import <SignalMessaging/SignalMessaging-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -40,7 +41,7 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypesExceptLinks
|
|||
|
||||
- (void)ows_applyTheme
|
||||
{
|
||||
self.keyboardAppearance = Theme.keyboardAppearance;
|
||||
self.keyboardAppearance = LKAppModeUtilities.isLightMode ? UIKeyboardAppearanceDefault : UIKeyboardAppearanceDark;
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#import <SignalServiceKit/NSNotificationCenter+OWS.h>
|
||||
#import <SignalServiceKit/OWSPrimaryStorage.h>
|
||||
#import <SignalServiceKit/YapDatabaseConnection+OWS.h>
|
||||
#import <SignalMessaging/SignalMessaging-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -38,7 +39,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (BOOL)isDarkThemeEnabled
|
||||
{
|
||||
return YES;
|
||||
return LKAppModeUtilities.isDarkMode;
|
||||
}
|
||||
|
||||
- (BOOL)isDarkThemeEnabled
|
||||
|
@ -46,18 +47,10 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
OWSAssertIsOnMainThread();
|
||||
|
||||
if (!CurrentAppContext().isMainApp) {
|
||||
// Ignore theme in app extensions.
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (self.isDarkThemeEnabledNumber == nil) {
|
||||
BOOL isDarkThemeEnabled = [OWSPrimaryStorage.sharedManager.dbReadConnection boolForKey:ThemeKeyThemeEnabled
|
||||
inCollection:ThemeCollection
|
||||
defaultValue:NO];
|
||||
self.isDarkThemeEnabledNumber = @(isDarkThemeEnabled);
|
||||
}
|
||||
|
||||
return self.isDarkThemeEnabledNumber.boolValue;
|
||||
return LKAppModeUtilities.isDarkMode;
|
||||
}
|
||||
|
||||
+ (void)setIsDarkThemeEnabled:(BOOL)value
|
||||
|
@ -83,22 +76,22 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (UIColor *)backgroundColor
|
||||
{
|
||||
return UIColor.lokiDarkestGray;
|
||||
return LKColors.navigationBarBackground;
|
||||
}
|
||||
|
||||
+ (UIColor *)offBackgroundColor
|
||||
{
|
||||
return UIColor.lokiDarkGray;
|
||||
return LKColors.unimportant;
|
||||
}
|
||||
|
||||
+ (UIColor *)primaryColor
|
||||
{
|
||||
return UIColor.whiteColor;
|
||||
return LKColors.text;
|
||||
}
|
||||
|
||||
+ (UIColor *)secondaryColor
|
||||
{
|
||||
return (Theme.isDarkThemeEnabled ? UIColor.ows_gray25Color : UIColor.ows_gray60Color);
|
||||
return LKColors.separator;
|
||||
}
|
||||
|
||||
+ (UIColor *)boldColor
|
||||
|
@ -113,12 +106,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (UIColor *)placeholderColor
|
||||
{
|
||||
return UIColor.lokiGray;
|
||||
return LKColors.navigationBarBackground;
|
||||
}
|
||||
|
||||
+ (UIColor *)hairlineColor
|
||||
{
|
||||
return UIColor.lokiDarkGray;
|
||||
return LKColors.separator;
|
||||
}
|
||||
|
||||
#pragma mark - Global App Colors
|
||||
|
@ -140,7 +133,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (UIColor *)darkThemeNavbarIconColor;
|
||||
{
|
||||
return UIColor.ows_gray25Color;
|
||||
return LKColors.text;
|
||||
}
|
||||
|
||||
+ (UIColor *)navbarTitleColor
|
||||
|
@ -165,12 +158,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (UIColor *)darkThemeBackgroundColor
|
||||
{
|
||||
return UIColor.ows_gray95Color;
|
||||
return LKColors.navigationBarBackground;
|
||||
}
|
||||
|
||||
+ (UIColor *)darkThemePrimaryColor
|
||||
{
|
||||
return UIColor.ows_gray05Color;
|
||||
return LKColors.text;
|
||||
}
|
||||
|
||||
+ (UIColor *)galleryHighlightColor
|
||||
|
@ -196,7 +189,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
|||
|
||||
+ (UIKeyboardAppearance)keyboardAppearance
|
||||
{
|
||||
return Theme.isDarkThemeEnabled ? self.darkThemeKeyboardAppearance : UIKeyboardAppearanceDefault;
|
||||
return LKAppModeUtilities.isLightMode ? UIKeyboardAppearanceDefault : UIKeyboardAppearanceDark;
|
||||
}
|
||||
|
||||
+ (UIKeyboardAppearance)darkThemeKeyboardAppearance;
|
||||
|
|
|
@ -18,14 +18,14 @@ public class ConversationStyle: NSObject {
|
|||
}
|
||||
}
|
||||
|
||||
@objc public let contentMarginTop: CGFloat = 24 // Values.largeSpacing
|
||||
@objc public let contentMarginBottom: CGFloat = 24 // Values.largeSpacing
|
||||
@objc public let contentMarginTop: CGFloat = Values.largeSpacing
|
||||
@objc public let contentMarginBottom: CGFloat = Values.largeSpacing
|
||||
|
||||
@objc public var gutterLeading: CGFloat = 0
|
||||
@objc public var gutterTrailing: CGFloat = 0
|
||||
|
||||
@objc public var headerGutterLeading: CGFloat = 35 // Values.veryLargeSpacing
|
||||
@objc public var headerGutterTrailing: CGFloat = 35 // Values.veryLargeSpacing
|
||||
@objc public var headerGutterLeading: CGFloat = Values.veryLargeSpacing
|
||||
@objc public var headerGutterTrailing: CGFloat = Values.veryLargeSpacing
|
||||
|
||||
// These are the gutters used by "full width" views
|
||||
// like "contact offer" and "info message".
|
||||
|
@ -114,7 +114,7 @@ public class ConversationStyle: NSObject {
|
|||
maxMessageWidth = floor(contentWidth - 32)
|
||||
}
|
||||
|
||||
let messageTextFont = UIFont.systemFont(ofSize: 13) // Values.smallFontSize
|
||||
let messageTextFont = UIFont.systemFont(ofSize: Values.smallFontSize)
|
||||
|
||||
let baseFontOffset: CGFloat = 16
|
||||
|
||||
|
@ -146,17 +146,17 @@ public class ConversationStyle: NSObject {
|
|||
|
||||
@objc
|
||||
private static var defaultBubbleColorIncoming: UIColor {
|
||||
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground
|
||||
return Colors.receivedMessageBackground
|
||||
}
|
||||
|
||||
@objc
|
||||
public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||
public let bubbleColorOutgoingFailed = Colors.sentMessageBackground
|
||||
|
||||
@objc
|
||||
public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||
public let bubbleColorOutgoingSending = Colors.sentMessageBackground
|
||||
|
||||
@objc
|
||||
public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||
public let bubbleColorOutgoingSent = Colors.sentMessageBackground
|
||||
|
||||
@objc
|
||||
public let dateBreakTextColor = UIColor.ows_gray60
|
||||
|
@ -191,12 +191,12 @@ public class ConversationStyle: NSObject {
|
|||
|
||||
@objc
|
||||
public static var bubbleTextColorIncoming: UIColor {
|
||||
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
||||
return Colors.text
|
||||
}
|
||||
|
||||
@objc
|
||||
public static var bubbleTextColorOutgoing: UIColor {
|
||||
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
||||
return Colors.text
|
||||
}
|
||||
|
||||
@objc
|
||||
|
@ -222,21 +222,21 @@ public class ConversationStyle: NSObject {
|
|||
|
||||
@objc
|
||||
public func bubbleSecondaryTextColor(isIncoming: Bool) -> UIColor {
|
||||
return bubbleTextColor(isIncoming: isIncoming).withAlphaComponent(0.6) // Values.unimportantElementOpacity
|
||||
return bubbleTextColor(isIncoming: isIncoming).withAlphaComponent(Values.unimportantElementOpacity)
|
||||
}
|
||||
|
||||
@objc
|
||||
public func quotedReplyBubbleColor(isIncoming: Bool) -> UIColor {
|
||||
if isIncoming {
|
||||
return UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||
return Colors.sentMessageBackground
|
||||
} else {
|
||||
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground
|
||||
return Colors.receivedMessageBackground
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public func quotedReplyStripeColor(isIncoming: Bool) -> UIColor {
|
||||
return UIColor(rgbHex: 0x00F782) // Colors.accent
|
||||
return isLightMode ? UIColor(hex: 0x272726) : Colors.accent
|
||||
}
|
||||
|
||||
@objc
|
||||
|
@ -246,16 +246,16 @@ public class ConversationStyle: NSObject {
|
|||
|
||||
@objc
|
||||
public func quotedReplyAuthorColor() -> UIColor {
|
||||
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
||||
return Colors.text
|
||||
}
|
||||
|
||||
@objc
|
||||
public func quotedReplyTextColor() -> UIColor {
|
||||
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
||||
return Colors.text
|
||||
}
|
||||
|
||||
@objc
|
||||
public func quotedReplyAttachmentColor() -> UIColor {
|
||||
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
||||
return Colors.text
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#import "Theme.h"
|
||||
#import "UIColor+OWS.h"
|
||||
#import <SignalServiceKit/AppContext.h>
|
||||
#import <SignalMessaging/SignalMessaging-Swift.h>
|
||||
|
||||
#define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f
|
||||
|
||||
|
@ -35,8 +36,8 @@
|
|||
UIToolbar.appearance.tintColor = UIColor.whiteColor;
|
||||
|
||||
UIBarButtonItem.appearance.tintColor = UIColor.blackColor;
|
||||
[UISwitch.appearance setOnTintColor:[UIColor colorWithRGBHex:0x00F782]]; // Colors.accent
|
||||
[UIToolbar.appearance setTintColor:[UIColor colorWithRGBHex:0x00F782]]; // Colors.accent
|
||||
[UISwitch.appearance setOnTintColor:LKColors.accent];
|
||||
[UIToolbar.appearance setTintColor:LKColors.accent];
|
||||
|
||||
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
|
||||
UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : UIColor.blackColor };
|
||||
|
|
|
@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
{
|
||||
[super loadView];
|
||||
|
||||
UIView.appearance.tintColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
UIView.appearance.tintColor = LKColors.text;
|
||||
|
||||
// Loki: Set gradient background
|
||||
self.view.backgroundColor = UIColor.clearColor;
|
||||
|
@ -55,17 +55,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
||||
navigationBar.shadowImage = [UIImage new];
|
||||
[navigationBar setTranslucent:NO];
|
||||
navigationBar.barTintColor = [UIColor colorWithRGBHex:0x161616]; // Colors.navigationBarBackground
|
||||
navigationBar.barTintColor = LKColors.navigationBarBackground;
|
||||
|
||||
// Loki: Customize title
|
||||
UILabel *titleLabel = [UILabel new];
|
||||
titleLabel.text = NSLocalizedString(@"Share to Session", @"");
|
||||
titleLabel.textColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:25]; // Values.veryLargeFontSize
|
||||
titleLabel.textColor = LKColors.text;
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:LKValues.veryLargeFontSize];
|
||||
self.navigationItem.titleView = titleLabel;
|
||||
|
||||
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"X"] style:UIBarButtonItemStylePlain target:self action:@selector(dismissPressed:)];
|
||||
closeButton.tintColor = [UIColor colorWithRGBHex:0xFFFFFF]; // Colors.text
|
||||
closeButton.tintColor = LKColors.text;
|
||||
self.navigationItem.leftBarButtonItem = closeButton;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue