From 3b2be079ff91c49c8b7ad71731bbb7efaa1e40c6 Mon Sep 17 00:00:00 2001 From: gmbnt Date: Tue, 17 Mar 2020 16:18:53 +1100 Subject: [PATCH] Finish implementing light mode --- .../ArrowUp.pdf | Bin .../Contents.json | 0 .../ArrowUpLightMode.pdf | Bin 0 -> 4649 bytes .../Contents.json | 2 +- .../Contents.json | 12 ++++++ .../FilledCircleCheckDarkMode.pdf} | Bin .../Contents.json | 12 ++++++ .../FilledCircleCheckLightMode.pdf | Bin 0 -> 6861 bytes Signal/src/Loki/Components/Button.swift | 2 +- .../Loki/Components/ConversationCell.swift | 11 ++--- .../Components/NewConversationButtonSet.swift | 11 +++-- .../View Controllers/NewClosedGroupVC.swift | 3 +- .../Loki/View Controllers/RegisterVC.swift | 2 +- .../OWSSoundSettingsViewController.m | 2 +- .../Cells/OWSMessageBubbleView.m | 13 ++++-- .../Cells/OWSQuotedMessageView.m | 5 ++- .../ConversationInputToolbar.m | 9 +++-- .../ConversationViewController.m | 2 +- .../GifPicker/GifPickerViewController.swift | 2 +- .../MediaTileViewController.swift | 7 ++-- .../Photos/PhotoCaptureViewController.swift | 2 +- .../SendMediaNavigationController.swift | 38 +++++++++++------- .../OWSConversationSettingsViewController.m | 4 +- Signal/src/views/CaptionView.swift | 2 +- .../Components/ProfilePictureView.swift | 12 +++--- .../Loki/Redesign/Style Guide/AppMode.swift | 2 +- .../Loki/Redesign/Style Guide/Colors.swift | 16 ++++---- .../Loki/Redesign/Style Guide/Values.swift | 10 ++--- ...AttachmentApprovalInputAccessoryView.swift | 4 +- .../AttachmentApprovalViewController.swift | 22 ++++------ .../AttachmentCaptionToolbar.swift | 6 +-- .../AttachmentPrepViewController.swift | 2 +- .../AttachmentTextToolbar.swift | 18 ++++----- .../ViewControllers/MediaMessageView.swift | 2 +- .../ViewControllers/OWSTableViewController.m | 27 +++++++------ .../ScreenLockViewController.m | 2 +- .../SelectThreadViewController.m | 6 +-- .../SharingThreadPickerViewController.m | 4 +- SignalMessaging/Views/ContactCellView.m | 4 +- SignalMessaging/Views/GalleryRailView.swift | 2 +- .../ImageEditorBrushViewController.swift | 2 +- .../ImageEditorCropViewController.swift | 8 ++-- .../ImageEditorTextViewController.swift | 2 +- .../OWSViewController+ImageEditor.swift | 16 +++----- SignalMessaging/Views/OWSSearchBar.m | 2 +- SignalMessaging/Views/OWSTextField.m | 3 +- SignalMessaging/Views/OWSTextView.m | 3 +- SignalMessaging/appearance/Theme.m | 33 ++++++--------- SignalMessaging/utils/ConversationStyle.swift | 36 ++++++++--------- SignalMessaging/utils/UIUtil.m | 5 ++- .../SAEScreenLockViewController.m | 10 ++--- 51 files changed, 217 insertions(+), 183 deletions(-) rename Signal/Images.xcassets/Loki V2/{ArrowUp.imageset => ArrowUpDarkMode.imageset}/ArrowUp.pdf (100%) rename Signal/Images.xcassets/Loki V2/{ArrowUp.imageset => ArrowUpDarkMode.imageset}/Contents.json (100%) create mode 100644 Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/ArrowUpLightMode.pdf rename Signal/Images.xcassets/Loki V2/{FilledCircleCheck.imageset => ArrowUpLightMode.imageset}/Contents.json (73%) create mode 100644 Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json rename Signal/Images.xcassets/Loki V2/{FilledCircleCheck.imageset/FilledCircleCheck.pdf => FilledCircleCheckDarkMode.imageset/FilledCircleCheckDarkMode.pdf} (100%) create mode 100644 Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json create mode 100644 Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/FilledCircleCheckLightMode.pdf diff --git a/Signal/Images.xcassets/Loki V2/ArrowUp.imageset/ArrowUp.pdf b/Signal/Images.xcassets/Loki V2/ArrowUpDarkMode.imageset/ArrowUp.pdf similarity index 100% rename from Signal/Images.xcassets/Loki V2/ArrowUp.imageset/ArrowUp.pdf rename to Signal/Images.xcassets/Loki V2/ArrowUpDarkMode.imageset/ArrowUp.pdf diff --git a/Signal/Images.xcassets/Loki V2/ArrowUp.imageset/Contents.json b/Signal/Images.xcassets/Loki V2/ArrowUpDarkMode.imageset/Contents.json similarity index 100% rename from Signal/Images.xcassets/Loki V2/ArrowUp.imageset/Contents.json rename to Signal/Images.xcassets/Loki V2/ArrowUpDarkMode.imageset/Contents.json diff --git a/Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/ArrowUpLightMode.pdf b/Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/ArrowUpLightMode.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5f67510351eb434b0f1a288a858ad74e6e3b5c3a GIT binary patch literal 4649 zcmai&2UJtb*2gJPARwU9MLlo{hyqDSC_zCwL`vw=OG4<)geHmg8j&U{AR-{WN=IH$?{~fHzHhx*XPq-^&p!Li%%1tL-x-LWs=7E_0s)4!Osq`I zK3aY7rlk#x1Ym$C)&+dw0sz&6wSgn|#G5OPLxlGZ#&Gvm(sW=)a z7AaeMx}X+(ZL9h?rWNVs{?cfp6Vu5`Nc7EVT3mCUQ#|@oiSb}p(T!&< z*2O9#?IvE)^{TyZb$52F%5%bI*!I75FQi@^QFx*7Nv`UGYnMkEM-d`Vbl`G}^sRf` z6hoW1E;2c=lOpF`m7V6}xv21daW8g2=jnC!2w}h7HT3n)E>-zd+jiopARXt>x0sAT z9%FezZCqc!JFajUKQBk9HqA(h^1}|)T#_eQMq=QvJ|YX5v(DA#YUkCuglbR4%=L!6 zf2lu^tVPJskk@x4{+V_6@O zLbteFIdkP?Q3*xYGvlQ%=NU%fu~iK`-H!F{o~lr77zHvgl!qOS6s zzEq7QyJ5l23k)ZjH*d)%^~`<^uJZX-^q|E*6eW^kYf3VHj18h?FFQk5GGnlRL_3dS`G}E0UV^t6-wQh7o_0z=kyP_gJmruM#1Y@! z(*So|C=)Tw3Sr_COBn()PNtkwyX&cz%L_dLH_vZ+;)90IW{Qbs_Mg47b)Mu~1UmUX z(tJ?)Ot!ohSA=Cimp$!RmwtxS*|B5&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ez}W`#3yZyK0(>HM1UiQ~JrOWa8CI_R6!m%X1ATb{1D`*_`9- z<0>WdpVVI}bJ6I3G?P0M!WWk|SwC~_*?ju@_78)NqwYbyw6XN93<{?>_@4)LZ0Na` zD7m-VeH<%(Ntw-_scm!&vI$b1*IZ7ZXoPD#Y;TV9=|A5$D3dRfEZrQN*!Fn*O1tOY zr*A6Pju%bqA#!RqL9zm<<6SufWR3O>~D>>87c97|DF=L6FN>*ph=e>JD-GVa*S-Ef|+T6C|U_Nv&s zGhTAL;ZWezw$%=FWW6?U;`V;}3Hq4B+Y1s6*Y>SH%1;N5?Da4duvuSx6(GCkw1=A; z&lUk=&Sn%|EZOVd9CRqCUz>X{XiKTM*>|p)H`B3Tb5jVW>YU-8p&@!Z4a!wPuYL{((C8E znD;1pq^RNIddObZ4sNYIVR{a;iAl+fz36wHX?Mk6*xg}rbR%qa=imH%K%qaNSsE_+ z7w{hN>w%35xo8y?Wji9?9ykD41HkGpmjj6Yi;4ecY$5>F!P`6ADSP?@7BH#{0!h7o zK(Y^&yx{;;%h{eth35lAr$+k?kl_dJ|BR?&=WXZa>G%`hiNCo0Z!CxZ_5u~l?R{|6 zKm9ZAb~ub7V1g$QojpAOI7|XAC4m4e&nWviyV(P9l&Xxhr6{29V@L1~0H_H6gZllw zMXBUYJrnSzzNAXUaPS#bIZ2o#42FQq!XyzWn6x@A7va{Rwyn zFbsgh!La`;fV7kpLJDvIe%X+47bE|76YQMb@Pr@dFNV$mcHk?*r7nOAID4cd9tW4PmqH+5QV2;T(g7}mL&+kMvUscm7OMdM-!4BF X5Yd~O%O4Ysl$4PKLm+Axb?|=xD32GL literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/Loki V2/FilledCircleCheck.imageset/Contents.json b/Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/Contents.json similarity index 73% rename from Signal/Images.xcassets/Loki V2/FilledCircleCheck.imageset/Contents.json rename to Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/Contents.json index ec956976d..eb11da86e 100644 --- a/Signal/Images.xcassets/Loki V2/FilledCircleCheck.imageset/Contents.json +++ b/Signal/Images.xcassets/Loki V2/ArrowUpLightMode.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "FilledCircleCheck.pdf" + "filename" : "ArrowUpLightMode.pdf" } ], "info" : { diff --git a/Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json b/Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json new file mode 100644 index 000000000..5f85830a2 --- /dev/null +++ b/Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "FilledCircleCheckDarkMode.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Signal/Images.xcassets/Loki V2/FilledCircleCheck.imageset/FilledCircleCheck.pdf b/Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/FilledCircleCheckDarkMode.pdf similarity index 100% rename from Signal/Images.xcassets/Loki V2/FilledCircleCheck.imageset/FilledCircleCheck.pdf rename to Signal/Images.xcassets/Loki V2/FilledCircleCheckDarkMode.imageset/FilledCircleCheckDarkMode.pdf diff --git a/Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json b/Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json new file mode 100644 index 000000000..7bc743383 --- /dev/null +++ b/Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "FilledCircleCheckLightMode.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/FilledCircleCheckLightMode.pdf b/Signal/Images.xcassets/Loki V2/FilledCircleCheckLightMode.imageset/FilledCircleCheckLightMode.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ccaf705a53b537d41109dbad4f30e2dabeffeb7a GIT binary patch literal 6861 zcmcIp2UJtdwx&uIP$^11^3z)qLIM#1=~6Uw=@=j&H5fXG6e-fANmWFehzO#f^xj2? zNL8eRh#*LjDsmH)`|FQyy>-{SFYB!2tbO+Enfbmw`^x0|L3PFomJ#V0(jXF!yUcTY^fH1MC(r0s8}Y9wjU?dK z>5_h3ZjNZ;>n_jQI#eaP?{S3wign0NTR69Oamcv>9Zgd8ViN;_G}jm6nJQ;R z6ypXoIeLq#gPWee(fn#(AXshsyu~14Q0rE{*bB1Un=e9ZTbTWX&VI`@bG&4p_Ka@$ zUCp>$7Z~N~u6q1clFXAt)6#H7qiqqpC||D3{HJMaWVze{YPy9L`R>ZkDeiZWD1_=n ztP}Z+#ZPn8-kdDp_!fhnKlaM~MW zy2N3+N2K*&%#RxFZ2c2={2hTV0!M^jC>%z3NVpaMg-Jbc7c>CULfP(rW6{oT0Q3i| zI%rpnJJt&A3c!CD6fw?j_~)(wAro{64F8Nrcut5*$P6tk#!46M2AJS)l~e#T0Az@? zv`1UH0feV2P7pxyM>G{DC;<7{m5P%%00IAu`b%Jf>p|e3DJS)_^&e6W^kXgu{eg7d zE#3BKr-H#c;rqsa6FjIP07yXr;{}+A!T|gQk-}g2asEAD#E(8yu^4xk{bB0@AU!O~ z+0_Mw2gu4B04eGMkbP9BL27^-)*TO?24I77bR{JIZ@Dk5N2w>E2PRTbv|uU-%;{tH8-q!qY*Nz)Rv|z*BaH4ssM)AV-jlgh-?C zc=usm2|y6Ak%S)5Kp6G`T8C*+#5iKGx-KXy^!}6-UGb3rpyJ1fe{#7`$w8E#m_vRL z{>OFxpMwqsMDfhS@z-ylLw**M{|f3HH>K$U0LFR`WDgAxMD;Mq7PE`a#PiH!xzteYE)ezgrvl;G3wu`A*_&tE)J-H5d8jJg8y@B z!~s!!R^XR}#P8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cunVL7nC7*=&w$J!Xo6FFDV=m`3Y^mfNa`6)g%phUgG*QJ=8{6Nj=|x}FVZB&7 zkT>kZY^G0^_^G>_*G*ort2*yPxH(tyMgOh)EKZ5(zTZE+&h6#3^6s-zX4x!AH92(# zy7+X0tI0p~Qqxk19POT1ji{fHA8&fHY_eDaw^^*1x`oD=I+un;`F2%TtnWIHIEyRq z3UhCNVR6}DiXlP>lgyPgwL-V0?LD9`xN`F>Z{D<7v7;xh>kcNj47)ZXkmbJPI%_y- z)MJX2A|2aJA?k`8k|bSiH_V>;VwW{$IZAtm%4sQKF#l%A5TgbrbQ+MI7%2e0duv(`}XS=V5UfHwo+VESt+QzCR%-qvH z#VHx;IYYX1Jl$8pDW&U$+{#w%U(eKiH>5UdGX+L1!BNA`+7+*f{-}UvznuQX4@Xo)xuF~}wm(!^*8@4$ z0F8CE!#D#Vh?vAL?SHMacs;|~-3qV73pk;ykh;J@69`xg0uzG*rUDA?c8-K%tt1II z6$G^1QCK%00I$>TOS@ifg7^{RHG4OFKT3GLfm%T6j5t^v42D9az~V3|D8d*F=Eq-n zzY7>^f(!6JyZo&WdtuQw)L=kdf*Snq4*-Y3pfJD&_-TWK;dtN(AHey*29}UIWP>3H zO4~pDz=T)JKWq|kJT(8X!T!((TmrAZ{KF3c#k2BH8|+X#hy?VoO%jUFqu<*?Bw>ff z48h}i$PY?TU;oh-3OzJ8n3N=5WBT1s0uDW7gGj;f%I)ud5Cr&8JUmqRclz&s5^%{w zV}?n=4*9_lh+pRGhDF&qqOtq`1nAoNpz)mJg>?+Z4cO0fyoRXeY=glsh= 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]; } } diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index 5dbbded66..f8e54485b 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -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; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index bc2af17b5..2b4fa64d0 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -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]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index ee47a7191..6c0e38228 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -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]; diff --git a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift index 5a5f53600..c4420c3b0 100644 --- a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift +++ b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift @@ -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) diff --git a/Signal/src/ViewControllers/MediaTileViewController.swift b/Signal/src/ViewControllers/MediaTileViewController.swift index 01ce4d55c..b91f4cdc3 100644 --- a/Signal/src/ViewControllers/MediaTileViewController.swift +++ b/Signal/src/ViewControllers/MediaTileViewController.swift @@ -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() diff --git a/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift b/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift index 7cf5b32ba..930548282 100644 --- a/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift +++ b/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift @@ -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() { diff --git a/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift b/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift index 94382bfb2..39129d4f3 100644 --- a/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift +++ b/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift @@ -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) } diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m index 2c53bcc5c..d36ea1ecb 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m @@ -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 { diff --git a/Signal/src/views/CaptionView.swift b/Signal/src/views/CaptionView.swift index 44bf66fd7..1624b09b7 100644 --- a/Signal/src/views/CaptionView.swift +++ b/Signal/src/views/CaptionView.swift @@ -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 diff --git a/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift b/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift index 44a856aa6..809fa8f24 100644 --- a/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift +++ b/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift @@ -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 } diff --git a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift index 166d0610a..ee386e790 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift @@ -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 { diff --git a/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift b/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift index 3ead76f3a..daff51918 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift @@ -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) } diff --git a/SignalMessaging/Loki/Redesign/Style Guide/Values.swift b/SignalMessaging/Loki/Redesign/Style Guide/Values.swift index 442896c83..3f8798361 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/Values.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/Values.swift @@ -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 diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalInputAccessoryView.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalInputAccessoryView.swift index dcdff6005..f46d83dea 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalInputAccessoryView.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalInputAccessoryView.swift @@ -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 diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift index 464ff7859..2f813cd2a 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift @@ -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) } diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift index 1e7f7c1c7..0f455717b 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift @@ -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 diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift index bb651d375..c49bea2e7 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift @@ -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 diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentTextToolbar.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentTextToolbar.swift index ba0a6710f..359e30053 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentTextToolbar.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentTextToolbar.swift @@ -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) diff --git a/SignalMessaging/ViewControllers/MediaMessageView.swift b/SignalMessaging/ViewControllers/MediaMessageView.swift index 3394dbd00..1b44ac446 100644 --- a/SignalMessaging/ViewControllers/MediaMessageView.swift +++ b/SignalMessaging/ViewControllers/MediaMessageView.swift @@ -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 } diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.m b/SignalMessaging/ViewControllers/OWSTableViewController.m index f2f4e0d53..67751f902 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.m +++ b/SignalMessaging/ViewControllers/OWSTableViewController.m @@ -8,6 +8,7 @@ #import "UIColor+OWS.h" #import "UIFont+OWS.h" #import "UIView+OWS.h" +#import 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(); diff --git a/SignalMessaging/ViewControllers/ScreenLockViewController.m b/SignalMessaging/ViewControllers/ScreenLockViewController.m index 8b2997d22..841fb0fb0 100644 --- a/SignalMessaging/ViewControllers/ScreenLockViewController.m +++ b/SignalMessaging/ViewControllers/ScreenLockViewController.m @@ -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 diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index a7c1b25a3..9d563c219 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -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]; diff --git a/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m b/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m index cf19441f5..3e724f558 100644 --- a/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m +++ b/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m @@ -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]; diff --git a/SignalMessaging/Views/ContactCellView.m b/SignalMessaging/Views/ContactCellView.m index 8c35b4d37..bb2185ab4 100644 --- a/SignalMessaging/Views/ContactCellView.m +++ b/SignalMessaging/Views/ContactCellView.m @@ -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]; diff --git a/SignalMessaging/Views/GalleryRailView.swift b/SignalMessaging/Views/GalleryRailView.swift index cf0f3a376..3be72bcd4 100644 --- a/SignalMessaging/Views/GalleryRailView.swift +++ b/SignalMessaging/Views/GalleryRailView.swift @@ -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 diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift index f28d6e542..f4aa2db76 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift @@ -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() diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift index c5677ac6b..2eab87b9b 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift @@ -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 diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift index ca380da0a..7345dfcc7 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift @@ -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() diff --git a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift index dd0d41f1a..60e3b7a92 100644 --- a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift +++ b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift @@ -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) } } diff --git a/SignalMessaging/Views/OWSSearchBar.m b/SignalMessaging/Views/OWSSearchBar.m index 6c9e84816..85a30cf66 100644 --- a/SignalMessaging/Views/OWSSearchBar.m +++ b/SignalMessaging/Views/OWSSearchBar.m @@ -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; } }]; } diff --git a/SignalMessaging/Views/OWSTextField.m b/SignalMessaging/Views/OWSTextField.m index f4a65a9e5..ed21e557b 100644 --- a/SignalMessaging/Views/OWSTextField.m +++ b/SignalMessaging/Views/OWSTextField.m @@ -4,6 +4,7 @@ #import "OWSTextField.h" #import "Theme.h" +#import 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 diff --git a/SignalMessaging/Views/OWSTextView.m b/SignalMessaging/Views/OWSTextView.m index d06d74036..4c862eaa8 100644 --- a/SignalMessaging/Views/OWSTextView.m +++ b/SignalMessaging/Views/OWSTextView.m @@ -4,6 +4,7 @@ #import "OWSTextView.h" #import "Theme.h" +#import 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: - diff --git a/SignalMessaging/appearance/Theme.m b/SignalMessaging/appearance/Theme.m index 92b5d2046..89922e092 100644 --- a/SignalMessaging/appearance/Theme.m +++ b/SignalMessaging/appearance/Theme.m @@ -8,6 +8,7 @@ #import #import #import +#import 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; diff --git a/SignalMessaging/utils/ConversationStyle.swift b/SignalMessaging/utils/ConversationStyle.swift index a8e347095..e6f907320 100644 --- a/SignalMessaging/utils/ConversationStyle.swift +++ b/SignalMessaging/utils/ConversationStyle.swift @@ -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 } } diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 01e2513cb..f06c983ce 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -6,6 +6,7 @@ #import "Theme.h" #import "UIColor+OWS.h" #import +#import #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 }; diff --git a/SignalShareExtension/SAEScreenLockViewController.m b/SignalShareExtension/SAEScreenLockViewController.m index 1125bb0a9..391be324c 100644 --- a/SignalShareExtension/SAEScreenLockViewController.m +++ b/SignalShareExtension/SAEScreenLockViewController.m @@ -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; }