Skip to content

Commit

Permalink
Merge pull request #263 from skedgo/upstream
Browse files Browse the repository at this point in the history
Upstream
  • Loading branch information
nighthawk authored Mar 16, 2023
2 parents ff0b93e + 431fee8 commit 5d90771
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Sources/TripKit/UIKit/UIColor+TripKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ extension UIColor {
/// as its background colour.
@objc public static var tkBackgroundGrouped: UIColor = .tripgoBackgroundGrouped

/// The background colour for separators
@objc public static var tkBarSecondary: UIColor = .tripgoBarSecondary

// MARK: - Accessories

@objc public static var tkSeparator: UIColor = .tripgoSeparator
Expand Down
1 change: 1 addition & 0 deletions Sources/TripKit/UIKit/UIColor+TripKitDefault.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extension UIColor {
static let tripgoBackgroundTile = UIColor.tkBackground
static let tripgoBackgroundBelowTile = UIColor.tkBackgroundSecondary
static let tripgoBackgroundGrouped = UIColor.tkBackgroundSecondary
static let tripgoBarSecondary = UIColor(named: "TKBarSecondary", in: .tripKit, compatibleWith: nil)!

static let tripgoBackgroundSelected: UIColor = {
if #available(iOS 13.0, *) {
Expand Down
19 changes: 16 additions & 3 deletions Sources/TripKitUI/views/trip overview/TKUINotificationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class TKUINotificationView: UIView {
@IBOutlet weak var detailView4: UIView!
@IBOutlet weak var detailItem4: UILabel!

@IBOutlet weak var separator: UIView!

@IBOutlet var labels: [UILabel]!
@IBOutlet var detailImageViews: [UIImageView]!

class func newInstance() -> TKUINotificationView {
return Bundle(for: self).loadNibNamed("TKUINotificationView",
owner: self,
Expand All @@ -42,10 +47,8 @@ class TKUINotificationView: UIView {

override func awakeFromNib() {
super.awakeFromNib()

backgroundColor = .clear
contentWrapper.layer.cornerRadius = 6.0
titleImageView.tintColor = .tkAppTintColor
setupColors()
}

func updateAvailableKinds(_ notificationKinds: Set<TKAPI.TripNotification.MessageKind>) {
Expand All @@ -55,5 +58,15 @@ class TKUINotificationView: UIView {
detailView4.alpha = notificationKinds.contains(.tripEnd) ? 1 : 0.3
notificationSwitch.isEnabled = !notificationKinds.isEmpty
}

func setupColors() {
// Xib selected custom colors only use the selected color and does not use the dark mode color when in dark mode. These are programatically set so that the dark mode colors are used.
backgroundColor = .clear
contentWrapper.backgroundColor = .tkBackgroundSecondary
separator.backgroundColor = .tkBarSecondary
titleImageView.tintColor = .tkAppTintColor
labels.forEach { $0.textColor = .tkLabelPrimary }
detailImageViews.forEach { $0.tintColor = .tkLabelPrimary }
}

}
11 changes: 11 additions & 0 deletions Sources/TripKitUI/views/trip overview/TKUINotificationView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,19 @@
<outlet property="detailView3" destination="WVQ-PA-Qtc" id="BlR-72-J2r"/>
<outlet property="detailView4" destination="2KG-2y-hCb" id="A1w-uW-IOb"/>
<outlet property="notificationSwitch" destination="8XR-B9-N29" id="ofm-Xb-q8H"/>
<outlet property="separator" destination="rzS-YU-yFK" id="ZYv-Qo-J4F"/>
<outlet property="titleImageView" destination="1hS-SZ-wkW" id="lJu-hh-S7C"/>
<outlet property="titleLabel" destination="kGq-xy-KL6" id="Mgb-Nu-9uW"/>
<outletCollection property="labels" destination="Xhb-eD-3zR" collectionClass="NSMutableArray" id="FvN-Uh-f9C"/>
<outletCollection property="labels" destination="NCZ-t5-edC" collectionClass="NSMutableArray" id="HYA-8O-EiB"/>
<outletCollection property="labels" destination="LvQ-jF-6YF" collectionClass="NSMutableArray" id="seL-ps-1nq"/>
<outletCollection property="labels" destination="t4E-71-ewA" collectionClass="NSMutableArray" id="f9k-JZ-1wT"/>
<outletCollection property="labels" destination="4m9-ST-AzW" collectionClass="NSMutableArray" id="QmV-hE-Lpg"/>
<outletCollection property="labels" destination="kGq-xy-KL6" collectionClass="NSMutableArray" id="umL-8m-wry"/>
<outletCollection property="detailImageViews" destination="ruA-P7-CKU" collectionClass="NSMutableArray" id="wJe-b1-bEN"/>
<outletCollection property="detailImageViews" destination="zo9-87-Vjv" collectionClass="NSMutableArray" id="UGO-IO-gQ3"/>
<outletCollection property="detailImageViews" destination="AQj-Ng-cha" collectionClass="NSMutableArray" id="wyp-P0-997"/>
<outletCollection property="detailImageViews" destination="LCk-Wa-ncU" collectionClass="NSMutableArray" id="sxp-AE-8QI"/>
</connections>
<point key="canvasLocation" x="-70.229007633587784" y="-263.38028169014086"/>
</view>
Expand Down

0 comments on commit 5d90771

Please sign in to comment.