Skip to content

Commit 5f385b3

Browse files
authored
[LOOP-4348] notification permission banner for narrow display (#529)
1 parent aee8848 commit 5f385b3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,8 @@ final class StatusTableViewController: LoopChartsTableViewController {
828828
override func updateConfiguration(using state: UICellConfigurationState) {
829829
super.updateConfiguration(using: state)
830830

831+
let adjustViewsForNarrowDisplay: Bool = bounds.width < 350
832+
831833
var contentConfig = defaultContentConfiguration().updated(for: state)
832834
let titleImageAttachment = NSTextAttachment()
833835
titleImageAttachment.image = UIImage(systemName: "exclamationmark.triangle.fill")?.withTintColor(.white)
@@ -836,11 +838,11 @@ final class StatusTableViewController: LoopChartsTableViewController {
836838
titleWithImage.append(title)
837839
contentConfig.attributedText = titleWithImage
838840
contentConfig.textProperties.color = .white
839-
contentConfig.textProperties.font = .systemFont(ofSize: 18, weight: .bold)
841+
contentConfig.textProperties.font = .systemFont(ofSize: adjustViewsForNarrowDisplay ? 16 : 18, weight: .bold)
840842
contentConfig.textProperties.adjustsFontSizeToFitWidth = true
841843
contentConfig.secondaryText = "Fix now by turning Notifications, Critical Alerts and Time Sensitive Notifications ON."
842844
contentConfig.secondaryTextProperties.color = .white
843-
contentConfig.secondaryTextProperties.font = .systemFont(ofSize: 15)
845+
contentConfig.secondaryTextProperties.font = .systemFont(ofSize: adjustViewsForNarrowDisplay ? 13 : 15)
844846
contentConfiguration = contentConfig
845847

846848
var backgroundConfig = backgroundConfiguration?.updated(for: state)

0 commit comments

Comments
 (0)