Skip to content
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

Dark Mode Fix #337

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions iOS/APIExample/APIExample/Common/NetworkManager/ToastView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class ToastView: UIView {
private lazy var label: UILabel = {
let label = UILabel()
label.text = ""
label.textColor = .white
if #available(iOS 13.0, *) {
label.textColor = .label
} else {
label.textColor = .white
}
label.font = .systemFont(ofSize: 14)
label.numberOfLines = 0
label.preferredMaxLayoutWidth = UIScreen.main.bounds.width - 60
Expand Down Expand Up @@ -66,9 +70,13 @@ class ToastView: UIView {
static func showWait(text: String, view: UIView? = nil) {
DispatchQueue.main.async {
self.currentToastView?.removeFromSuperview()
var textColor: UIColor = .white
if #available(iOS 13.0, *) {
textColor = .label
}
let toastView = show(text: text,
tagImage: nil,
textColor: .white,
textColor: textColor,
font: nil,
postion: .center,
view: view)
Expand All @@ -92,8 +100,12 @@ class ToastView: UIView {

static func show(text: String, duration: CGFloat = 2.5, view: UIView? = nil) {
DispatchQueue.main.async {
var textColor: UIColor = .white
if #available(iOS 13.0, *) {
textColor = .label
}
let toastView = show(text: text, tagImage: nil,
textColor: .white, font: nil,
textColor: textColor, font: nil,
postion: .center,
view: view)
showAnimation(toastView: toastView, duration: duration)
Expand All @@ -102,8 +114,12 @@ class ToastView: UIView {

static func show(text: String, postion: ToastViewPostion = .center) {
DispatchQueue.main.async {
var textColor: UIColor = .white
if #available(iOS 13.0, *) {
textColor = .label
}
let toastView = show(text: text, tagImage: nil,
textColor: .white, font: nil,
textColor: textColor, font: nil,
postion: postion,
view: nil)
showAnimation(toastView: toastView)
Expand All @@ -115,8 +131,12 @@ class ToastView: UIView {
duration: CGFloat = 2.5,
view: UIView? = nil) {
DispatchQueue.main.async {
var textColor: UIColor = .white
if #available(iOS 13.0, *) {
textColor = .label
}
let toastView = show(text: text, tagImage: nil,
textColor: .white, font: nil,
textColor: textColor, font: nil,
postion: postion,
view: view)
showAnimation(toastView: toastView, duration: duration)
Expand All @@ -125,8 +145,12 @@ class ToastView: UIView {

static func show(text: String, tagImage: UIImage? = nil, postion: ToastViewPostion = .center, view: UIView? = nil) {
DispatchQueue.main.async {
var textColor: UIColor = .white
if #available(iOS 13.0, *) {
textColor = .label
}
let toastView = show(text: text, tagImage: tagImage,
textColor: .white, font: nil,
textColor: textColor, font: nil,
postion: postion,
view: view)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class SpatialAudioActionSheet: UIView {
}()
private lazy var attenuationLabel: UILabel = {
let label = UILabel()
label.text = "Attenuatuin".localized
label.text = "Attenuation".localized
return label
}()
private lazy var muteSwitch: UISwitch = {
Expand Down Expand Up @@ -356,7 +356,11 @@ class SpatialAudioActionSheet: UIView {
}

private func setupUI() {
backgroundColor = .white
if #available(iOS 13.0, *) {
backgroundColor = .tertiarySystemBackground
} else {
backgroundColor = .white
}
addSubview(muteLabel)
addSubview(voiceBlurLabel)
addSubview(airborneLabel)
Expand Down