-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUMM-2972 [SR] Support UISegmentedControl
elements in session replay
#1169
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
DatadogSessionReplay/Sources/Recorder/Utilities/SystemColors.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-Present Datadog, Inc. | ||
*/ | ||
|
||
import UIKit | ||
|
||
/// Collection of system colors. | ||
/// | ||
/// Contextual colors are light- and dark-mode sensitive and must be implemented as computed variables, | ||
/// so they return different values upon `UIUserInterfaceStyle` change. | ||
/// | ||
/// For older iOS versions that do not support `UIUserInterfaceStyle`, approximate fallbacks are provided. | ||
/// See https://gist.github.com/ncreated/35bf4d69d83d1a5ab408ff29a77fc9ff for reference when updating this collection. | ||
internal enum SystemColors { | ||
static let clear: CGColor = UIColor.clear.cgColor | ||
|
||
static var tertiarySystemFill: CGColor { | ||
if #available(iOS 13.0, *) { | ||
return UIColor.tertiarySystemFill.cgColor | ||
} else { | ||
// Fallback to iOS 16.2 light mode color: | ||
return UIColor(red: 118 / 255, green: 118 / 255, blue: 128 / 255, alpha: 1).cgColor | ||
} | ||
} | ||
|
||
static var tertiarySystemBackground: CGColor { | ||
if #available(iOS 13.0, *) { | ||
return UIColor.tertiarySystemBackground.cgColor | ||
} else { | ||
// Fallback to iOS 16.2 light mode color: | ||
return UIColor(red: 255 / 255, green: 255 / 255, blue: 255 / 255, alpha: 1).cgColor | ||
} | ||
} | ||
|
||
static var secondarySystemFill: CGColor { | ||
if #available(iOS 13.0, *) { | ||
return UIColor.secondarySystemFill.cgColor | ||
} else { | ||
// Fallback to iOS 16.2 light mode color: | ||
return UIColor(red: 120 / 255, green: 120 / 255, blue: 128 / 255, alpha: 1).cgColor | ||
} | ||
} | ||
|
||
static var tintColor: CGColor { | ||
if #available(iOS 15.0, *) { | ||
return UIColor.tintColor.cgColor | ||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why 15? this one is available since iOS7 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} else { | ||
// Fallback to iOS 16.2 light mode color: | ||
return UIColor(red: 0 / 255, green: 122 / 255, blue: 255 / 255, alpha: 1).cgColor | ||
} | ||
} | ||
|
||
static var label: CGColor { | ||
if #available(iOS 13.0, *) { | ||
return UIColor.label.cgColor | ||
} else { | ||
// Fallback to iOS 16.2 light mode color: | ||
return UIColor(red: 0 / 255, green: 0 / 255, blue: 0 / 255, alpha: 1).cgColor | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointing to stable branch in https://github.com/ncreated/Framing/tree/ship-framer - I added basic text alignment options in there, so we can preview
SRTextPosition
in snapshot tests.