Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 069c66e5e8
commit d34f83b445

@ -197,7 +197,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
}
private func heroBackgroundColor() -> UIColor {
return (Theme.isDarkThemeEnabled()
return (Theme.isDarkThemeEnabled
? UIColor(rgbHex: 0x272727)
: UIColor(rgbHex: 0xefeff4))
}

@ -30,7 +30,7 @@ private class IntroducingCustomNotificationAudioExperienceUpgradeViewController:
view.addSubview(bodyLabel)
bodyLabel.text = body
bodyLabel.font = UIFont.ows_lightFont(withSize: ScaleFromIPhone5To7Plus(17, 22))
bodyLabel.textColor = UIColor.black
bodyLabel.textColor = Theme.primaryColor
bodyLabel.numberOfLines = 0
bodyLabel.lineBreakMode = .byWordWrapping
bodyLabel.textAlignment = .center
@ -140,7 +140,7 @@ private class IntroductingReadReceiptsExperienceUpgradeViewController: Experienc
view.addSubview(bodyLabel)
bodyLabel.text = body
bodyLabel.font = UIFont.ows_lightFont(withSize: ScaleFromIPhone5To7Plus(17, 22))
bodyLabel.textColor = UIColor.black
bodyLabel.textColor = Theme.primaryColor
bodyLabel.numberOfLines = 0
bodyLabel.lineBreakMode = .byWordWrapping
bodyLabel.textAlignment = .center
@ -292,7 +292,7 @@ private class IntroductingProfilesExperienceUpgradeViewController: ExperienceUpg
view.addSubview(bodyLabel)
bodyLabel.text = body
bodyLabel.font = UIFont.ows_lightFont(withSize: ScaleFromIPhone5To7Plus(17, 22))
bodyLabel.textColor = UIColor.black
bodyLabel.textColor = Theme.primaryColor
bodyLabel.numberOfLines = 0
bodyLabel.lineBreakMode = .byWordWrapping
bodyLabel.textAlignment = .center
@ -443,7 +443,7 @@ private class ExperienceUpgradeViewController: OWSViewController {
view.addSubview(bodyLabel)
bodyLabel.text = body
bodyLabel.font = UIFont.ows_lightFont(withSize: ScaleFromIPhone5To7Plus(17, 22))
bodyLabel.textColor = UIColor.black
bodyLabel.textColor = Theme.primaryColor
bodyLabel.numberOfLines = 0
bodyLabel.lineBreakMode = .byWordWrapping
bodyLabel.textAlignment = .center
@ -529,7 +529,7 @@ public class ExperienceUpgradesPageViewController: OWSViewController, UIPageView
@objc public override func loadView() {
self.view = UIView.container()
view.backgroundColor = UIColor.white
view.backgroundColor = Theme.backgroundColor
//// Create Views

@ -267,7 +267,9 @@ class GifPickerCell: UICollectionViewCell {
private func clearViewState() {
imageView?.image = nil
self.backgroundColor = UIColor(white: 0.95, alpha: 1.0)
self.backgroundColor = (Theme.isDarkThemeEnabled
? UIColor(white: 0.25, alpha: 1.0)
: UIColor(white: 0.95, alpha: 1.0))
}
private func pickBestAsset() -> GiphyAsset? {

@ -150,7 +150,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
private func createViews() {
let backgroundColor = (Theme.isDarkThemeEnabled()
let backgroundColor = (Theme.isDarkThemeEnabled
? UIColor(white: 0.08, alpha: 1.0)
: Theme.backgroundColor)
self.view.backgroundColor = backgroundColor

@ -58,12 +58,12 @@ public class LongTextViewController: OWSViewController {
// MARK: - Create Views
private func createViews() {
view.backgroundColor = UIColor.white
view.backgroundColor = Theme.backgroundColor
let messageTextView = UITextView()
self.messageTextView = messageTextView
messageTextView.font = UIFont.ows_dynamicTypeBody
messageTextView.backgroundColor = UIColor.white
messageTextView.backgroundColor = Theme.backgroundColor
messageTextView.isOpaque = true
messageTextView.isEditable = false
messageTextView.isSelectable = true
@ -71,7 +71,7 @@ public class LongTextViewController: OWSViewController {
messageTextView.showsHorizontalScrollIndicator = false
messageTextView.showsVerticalScrollIndicator = true
messageTextView.isUserInteractionEnabled = true
messageTextView.textColor = UIColor.black
messageTextView.textColor = Theme.primaryColor
messageTextView.text = messageBody
view.addSubview(messageTextView)

@ -139,7 +139,7 @@ public struct GalleryDate: Hashable, Comparable, Equatable {
return month.hashValue ^ year.hashValue
}
// Mark: Comparable
// MARK: Comparable
public static func < (lhs: GalleryDate, rhs: GalleryDate) -> Bool {
if lhs.year != rhs.year {
@ -368,7 +368,7 @@ class MediaGalleryViewController: OWSNavigationController, MediaGalleryDataSourc
// fade out content behind the pageViewController
// and behind the presentation view
self.view.backgroundColor = .white
self.view.backgroundColor = Theme.backgroundColor
},
completion: { (_: Bool) in
// At this point our presentation view should be overlayed perfectly
@ -512,7 +512,7 @@ class MediaGalleryViewController: OWSNavigationController, MediaGalleryDataSourc
// In case user has hidden bars, which changes background to black.
// We don't want to change this while detailView is visible, lest
// we obscure out the presentationView
detailView.backgroundColor = .white
detailView.backgroundColor = Theme.backgroundColor
})
// This intentionally overlaps the previous animation a bit

@ -170,7 +170,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
let kFooterHeight: CGFloat = 44
view.backgroundColor = UIColor.white
view.backgroundColor = Theme.backgroundColor
let footerBar = UIToolbar()
self.footerBar = footerBar
@ -245,7 +245,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
// We don't animate the background color change because the old color shows through momentarily
// behind where the status bar "used to be".
self.view.backgroundColor = shouldHideToolbars ? UIColor.black : UIColor.white
self.view.backgroundColor = (shouldHideToolbars ? UIColor.black : Theme.backgroundColor)
UIView.animate(withDuration: 0.1) {
self.currentViewController.setShouldHideToolbars(self.shouldHideToolbars)
@ -474,7 +474,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
}
Logger.debug("\(logTag) in \(#function) cache miss.")
var fetchedItem: ConversationViewItem? = nil
var fetchedItem: ConversationViewItem?
self.uiDatabaseConnection.read { transaction in
let message = galleryItem.message
let thread = message.thread(with: transaction)

@ -80,7 +80,7 @@ public class MediaTileViewController: UICollectionViewController, MediaGalleryDa
return
}
collectionView.backgroundColor = UIColor.white
collectionView.backgroundColor = Theme.backgroundColor
collectionView.register(MediaGalleryCell.self, forCellWithReuseIdentifier: MediaGalleryCell.reuseIdentifier)
collectionView.register(MediaGallerySectionHeader.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: MediaGallerySectionHeader.reuseIdentifier)
@ -877,12 +877,12 @@ private class MediaGalleryCell: UICollectionViewCell {
self.highlightedView = UIView()
highlightedView.alpha = 0.2
highlightedView.backgroundColor = .black
highlightedView.backgroundColor = Theme.primaryColor
highlightedView.isHidden = true
self.selectedView = UIView()
selectedView.alpha = 0.3
selectedView.backgroundColor = .white
selectedView.backgroundColor = Theme.backgroundColor
selectedView.isHidden = true
super.init(frame: frame)

@ -288,7 +288,9 @@ class MenuActionSheetView: UIView, MenuActionViewDelegate {
super.init(frame: frame)
backgroundColor = UIColor.ows_light10
backgroundColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark85
: UIColor.ows_light10)
addSubview(actionStackView)
actionStackView.autoPinEdgesToSuperviewEdges()
@ -410,7 +412,9 @@ class MenuActionView: UIButton {
super.init(frame: CGRect.zero)
isUserInteractionEnabled = true
backgroundColor = .white
backgroundColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark60
: UIColor.white)
let imageView = UIImageView(image: action.image)
let imageWidth: CGFloat = 24
@ -419,13 +423,15 @@ class MenuActionView: UIButton {
let titleLabel = UILabel()
titleLabel.font = UIFont.ows_dynamicTypeBody
titleLabel.textColor = UIColor.ows_light90
titleLabel.textColor = Theme.primaryColor
titleLabel.text = action.title
titleLabel.isUserInteractionEnabled = false
let subtitleLabel = UILabel()
subtitleLabel.font = UIFont.ows_dynamicTypeSubheadline
subtitleLabel.textColor = UIColor.ows_light60
subtitleLabel.textColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark30
: Theme.secondaryColor)
subtitleLabel.text = action.subtitle
subtitleLabel.isUserInteractionEnabled = false
@ -451,7 +457,7 @@ class MenuActionView: UIButton {
override var isHighlighted: Bool {
didSet {
self.backgroundColor = isHighlighted ? UIColor.ows_light10 : UIColor.white
self.backgroundColor = isHighlighted ? Theme.backgroundColor.withAlphaComponent(0.9) : Theme.backgroundColor
}
}

@ -67,7 +67,7 @@ class ReminderView: UIView {
self.backgroundColor = UIColor.ows_reminderYellow
case .explanation:
// TODO: Theme, review with design.
self.backgroundColor = (Theme.isDarkThemeEnabled()
self.backgroundColor = (Theme.isDarkThemeEnabled
? UIColor(rgbHex: 0x202020)
: UIColor(rgbHex: 0xf5f5f5))
}

@ -16,7 +16,8 @@ extern NSString *const ThemeDidChangeNotification;
- (instancetype)init NS_UNAVAILABLE;
+ (BOOL)isDarkThemeEnabled;
@property (class, readonly, nonatomic) BOOL isDarkThemeEnabled;
#ifdef THEME_ENABLED
+ (void)setIsDarkThemeEnabled:(BOOL)value;
#endif

Loading…
Cancel
Save