Skip to content

Commit d7f877b

Browse files
committed
Darkmode schedule cell background tweak
1 parent fa669e1 commit d7f877b

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

BrickHack-Mobile/Controllers/ScheduleTableViewController.swift

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,21 @@ class ScheduleTableViewController: UITableViewController {
149149
*/
150150

151151
// Colors, and point (if not nil)
152+
// @TODO: Increase contrast of description color, see TimelineTableViewCell fork
153+
cell.backgroundColor = UIColor.clear
152154
cell.timeline.backColor = allColor
153155
cell.timelinePoint = timelinePoint ?? TimelinePoint(diameter: 0, color: allColor, filled: true)
154156
cell.timeline.frontColor = allColor
155157

156158
// If point is filled, set FRONTCOLOR to match rest of list, and show bubble.
157159
// (point is current bit)
158160
if (indexPath.section == 0 && indexPath.row == sampleData[0]!.count - 1) {
159-
160161
// This is a bit counterintuitive but it works ¯\_(ツ)_/¯
161162
cell.timeline.backColor = frontColor
163+
// Sets white text no matter what, due to contrastive background of bubble (set later in method)
164+
cell.titleLabel.textColor = UIColor.white
162165
cell.bubbleEnabled = true
163166
} else {
164-
165167
// Only current item gets button.
166168
// @TODO: Check with design on this one.
167169
cell.bubbleEnabled = false
@@ -174,15 +176,6 @@ class ScheduleTableViewController: UITableViewController {
174176
dateFormatter.dateFormat = "hh:mm a"
175177
cell.descriptionLabel.text = dateFormatter.string(from: date)
176178

177-
178-
// Set label color properly depending on dark mode, or no dark mode option.
179-
// Only change if bubble is not enableld to preserve contrast. Might need tweaking.
180-
if #available(iOS 13.0, *), !cell.bubbleEnabled {
181-
cell.titleLabel.textColor = UIColor.label
182-
} else {
183-
cell.titleLabel.textColor = UIColor.black
184-
}
185-
186179
// Configure favorite accessory
187180
let favButton = FavoriteButton(type: .custom)
188181
// Set images
@@ -197,9 +190,10 @@ class ScheduleTableViewController: UITableViewController {
197190
favButton.isSelected = isFavorite
198191

199192
// Confgure bubble
200-
cell.bubbleColor = UIColor.clear
201-
cell.bubbleWidth = 20.0
202-
cell.bubbleBorderColor = UIColor(named: "primaryColor")!
193+
cell.bubbleColor = UIColor(named: "primaryColor")!
194+
cell.bubbleBorderColor = UIColor.clear
195+
// (I dont think this property works, check TimelineTableViewCell fork)
196+
// cell.bubbleWidth = 100.0
203197

204198
// Disable selection per cell
205199
cell.selectionStyle = .none

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ EXTERNAL SOURCES:
5151

5252
CHECKOUT OPTIONS:
5353
TimelineTableViewCell:
54-
:commit: d93f32e0caf1042fc88b43b5b0efb235a8e519f2
54+
:commit: 333072fb1bdfd67087e939cfa0db8d29cfdef801
5555
:git: https://github.com/peterkos/TimelineTableViewCell.git
5656

5757
SPEC CHECKSUMS:

0 commit comments

Comments
 (0)