diff --git a/ios/AlarmApp/AlarmApp.xcodeproj/project.pbxproj b/ios/AlarmApp/AlarmApp.xcodeproj/project.pbxproj index 59c9dad..d525652 100644 --- a/ios/AlarmApp/AlarmApp.xcodeproj/project.pbxproj +++ b/ios/AlarmApp/AlarmApp.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 3008B04B296C17FA00A05731 /* MaterialButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3008B04A296C17FA00A05731 /* MaterialButton.swift */; }; 3008B04D296C1A4800A05731 /* C8yAlarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3008B04C296C1A4800A05731 /* C8yAlarm.swift */; }; 3008B04F296C245500A05731 /* MaterialTextfield.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3008B04E296C245500A05731 /* MaterialTextfield.swift */; }; + 3008B05329700CF500A05731 /* ColorScheme.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3008B05229700CF500A05731 /* ColorScheme.xcassets */; }; 300B2B5B27C9103B0051CDBC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300B2B5A27C9103B0051CDBC /* AppDelegate.swift */; }; 300B2B5D27C9103B0051CDBC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300B2B5C27C9103B0051CDBC /* SceneDelegate.swift */; }; 300B2B5F27C9103C0051CDBC /* DashboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300B2B5E27C9103C0051CDBC /* DashboardViewController.swift */; }; @@ -93,6 +94,7 @@ 3008B04A296C17FA00A05731 /* MaterialButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MaterialButton.swift; sourceTree = ""; }; 3008B04C296C1A4800A05731 /* C8yAlarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = C8yAlarm.swift; sourceTree = ""; }; 3008B04E296C245500A05731 /* MaterialTextfield.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MaterialTextfield.swift; sourceTree = ""; }; + 3008B05229700CF500A05731 /* ColorScheme.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ColorScheme.xcassets; sourceTree = ""; }; 300B2B5727C9103B0051CDBC /* AlarmApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AlarmApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 300B2B5A27C9103B0051CDBC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 300B2B5C27C9103B0051CDBC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -218,6 +220,7 @@ 3056B77A27CE896F00ED443B /* Material */, 309A860B27DF659F00F69ED0 /* MaterialUI */, 307385EB27E2798B00D05F03 /* AlarmApp.entitlements */, + 3008B05229700CF500A05731 /* ColorScheme.xcassets */, 300B2B6327C910470051CDBC /* Assets.xcassets */, 300B2B6827C910470051CDBC /* Info.plist */, 300B2B6527C910470051CDBC /* LaunchScreen.storyboard */, @@ -454,6 +457,7 @@ 300B2B6727C910470051CDBC /* LaunchScreen.storyboard in Resources */, 30F6C36327D6B89300884CE8 /* SeparatorItem.xib in Resources */, 30CFCAE727CFF32A0061BF71 /* AuditRecordItem.xib in Resources */, + 3008B05329700CF500A05731 /* ColorScheme.xcassets in Resources */, 30FBB9CA27CD417F008302D0 /* DetailsItem.xib in Resources */, 3056B77727CE696B00ED443B /* AlarmListItem.xib in Resources */, 300B2B6427C910470051CDBC /* Assets.xcassets in Resources */, diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/onBackground.colorset/Contents.json b/ios/AlarmApp/AlarmApp/Assets.xcassets/onBackground.colorset/Contents.json deleted file mode 100644 index 701447a..0000000 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/onBackground.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x1B", - "green" : "0x1B", - "red" : "0x1B" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000", - "red" : "1.000" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/onSurface.colorset/Contents.json b/ios/AlarmApp/AlarmApp/Assets.xcassets/onSurface.colorset/Contents.json deleted file mode 100644 index 701447a..0000000 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/onSurface.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x1B", - "green" : "0x1B", - "red" : "0x1B" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000", - "red" : "1.000" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/secondary.colorset/Contents.json b/ios/AlarmApp/AlarmApp/Assets.xcassets/secondary.colorset/Contents.json deleted file mode 100644 index 4b3ab72..0000000 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/secondary.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x7F", - "green" : "0x00", - "red" : "0xE0" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0xC6", - "green" : "0x91", - "red" : "0xF3" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/ios/AlarmApp/AlarmApp/Base.lproj/Main.storyboard b/ios/AlarmApp/AlarmApp/Base.lproj/Main.storyboard index 3d0afb9..9b7874a 100644 --- a/ios/AlarmApp/AlarmApp/Base.lproj/Main.storyboard +++ b/ios/AlarmApp/AlarmApp/Base.lproj/Main.storyboard @@ -62,13 +62,13 @@ @@ -189,7 +189,7 @@ @@ -633,7 +633,7 @@ - + @@ -1118,13 +1118,13 @@ @@ -1307,7 +1307,7 @@ - + @@ -1317,28 +1317,31 @@ - + - + + + + - + - + - - + + - + diff --git a/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/background.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/background.colorset/Contents.json similarity index 88% rename from ios/AlarmApp/AlarmApp/Assets.xcassets/background.colorset/Contents.json rename to ios/AlarmApp/AlarmApp/ColorScheme.xcassets/background.colorset/Contents.json index f05c359..2dd8f81 100644 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/background.colorset/Contents.json +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/background.colorset/Contents.json @@ -7,7 +7,7 @@ "alpha" : "1.000", "blue" : "0xFF", "green" : "0xFC", - "red" : "0xFC" + "red" : "0xFB" } }, "idiom" : "universal" @@ -23,8 +23,8 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x00", - "green" : "0x00", + "blue" : "0x2A", + "green" : "0x1F", "red" : "0x00" } }, diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/onPrimary.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onBackground.colorset/Contents.json similarity index 80% rename from ios/AlarmApp/AlarmApp/Assets.xcassets/onPrimary.colorset/Contents.json rename to ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onBackground.colorset/Contents.json index 2960d72..fc1c9a4 100644 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/onPrimary.colorset/Contents.json +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onBackground.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000", - "red" : "1.000" + "blue" : "0x2A", + "green" : "0x1F", + "red" : "0x00" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x00", - "green" : "0x00", - "red" : "0x00" + "blue" : "0xFF", + "green" : "0xE9", + "red" : "0xBF" } }, "idiom" : "universal" diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/onSecondary.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimary.colorset/Contents.json similarity index 80% rename from ios/AlarmApp/AlarmApp/Assets.xcassets/onSecondary.colorset/Contents.json rename to ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimary.colorset/Contents.json index 2960d72..7815368 100644 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/onSecondary.colorset/Contents.json +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimary.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000", - "red" : "1.000" + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" } }, "idiom" : "universal" @@ -23,8 +23,8 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x00", - "green" : "0x00", + "blue" : "0x57", + "green" : "0x32", "red" : "0x00" } }, diff --git a/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimaryContainer.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimaryContainer.colorset/Contents.json new file mode 100644 index 0000000..329bc02 --- /dev/null +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onPrimaryContainer.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x35", + "green" : "0x1D", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xE4", + "red" : "0xD1" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onSurface.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onSurface.colorset/Contents.json new file mode 100644 index 0000000..fc1c9a4 --- /dev/null +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/onSurface.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x2A", + "green" : "0x1F", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xE9", + "red" : "0xBF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/primary.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primary.colorset/Contents.json similarity index 80% rename from ios/AlarmApp/AlarmApp/Assets.xcassets/primary.colorset/Contents.json rename to ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primary.colorset/Contents.json index d87b97f..fa83d8e 100644 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/primary.colorset/Contents.json +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primary.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x9F", + "blue" : "0xA2", "green" : "0x61", - "red" : "0x24" + "red" : "0x00" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0xFC", - "green" : "0xD4", - "red" : "0x83" + "blue" : "0xFF", + "green" : "0xCA", + "red" : "0x9D" } }, "idiom" : "universal" diff --git a/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primaryContainer.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primaryContainer.colorset/Contents.json new file mode 100644 index 0000000..aaf8ea1 --- /dev/null +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/primaryContainer.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xE4", + "red" : "0xD1" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7C", + "green" : "0x49", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AlarmApp/AlarmApp/Assets.xcassets/surface.colorset/Contents.json b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/surface.colorset/Contents.json similarity index 84% rename from ios/AlarmApp/AlarmApp/Assets.xcassets/surface.colorset/Contents.json rename to ios/AlarmApp/AlarmApp/ColorScheme.xcassets/surface.colorset/Contents.json index f21d542..17db84c 100644 --- a/ios/AlarmApp/AlarmApp/Assets.xcassets/surface.colorset/Contents.json +++ b/ios/AlarmApp/AlarmApp/ColorScheme.xcassets/surface.colorset/Contents.json @@ -7,7 +7,7 @@ "alpha" : "1.000", "blue" : "0xFF", "green" : "0xFC", - "red" : "0xFC" + "red" : "0xFA" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x12", - "green" : "0x12", - "red" : "0x12" + "blue" : "0x2A", + "green" : "0x1F", + "red" : "0x00" } }, "idiom" : "universal" diff --git a/ios/AlarmApp/AlarmApp/Extensions/UITableViewHeaderFooterView.swift b/ios/AlarmApp/AlarmApp/Extensions/UITableViewHeaderFooterView.swift index 71e5e9c..9cbe60f 100644 --- a/ios/AlarmApp/AlarmApp/Extensions/UITableViewHeaderFooterView.swift +++ b/ios/AlarmApp/AlarmApp/Extensions/UITableViewHeaderFooterView.swift @@ -19,9 +19,7 @@ import UIKit extension UITableViewHeaderFooterView { func setBackgroundConfiguration() { - let theme = M3Theme() - let color = theme.elevationOverlayColor(elevation: 2) - setBackgroundConfiguration(with: color) + setBackgroundConfiguration(with: M3Theme().elevationOverlayColor(elevation: 1)) } func setBackgroundConfiguration(with color: UIColor) { diff --git a/ios/AlarmApp/AlarmApp/Extensions/UIViewController.swift b/ios/AlarmApp/AlarmApp/Extensions/UIViewController.swift index 29d4d02..2dfa478 100644 --- a/ios/AlarmApp/AlarmApp/Extensions/UIViewController.swift +++ b/ios/AlarmApp/AlarmApp/Extensions/UIViewController.swift @@ -22,8 +22,7 @@ extension UIViewController { detents: [UISheetPresentationController.Detent] = [.medium()], isModal: Bool = false ) { - let m3Theme = M3Theme() - bottomSheet.view.backgroundColor = m3Theme.elevationOverlayColor(elevation: 2) + bottomSheet.view.backgroundColor = .surface let navigationController = UINavigationController(rootViewController: bottomSheet) navigationController.modalPresentationStyle = .pageSheet navigationController.navigationBar.isHidden = true diff --git a/ios/AlarmApp/AlarmApp/Material/Colors.swift b/ios/AlarmApp/AlarmApp/Material/Colors.swift index f5f1683..b26287c 100644 --- a/ios/AlarmApp/AlarmApp/Material/Colors.swift +++ b/ios/AlarmApp/AlarmApp/Material/Colors.swift @@ -32,6 +32,8 @@ extension UIColor { static var primary = UIColor(named: "primary") ?? .black static var onPrimary = UIColor(named: "onPrimary") ?? .black + static var primaryContainer = UIColor(named: "primaryContainer") ?? .black + static var onPrimaryContainer = UIColor(named: "onPrimaryContainer") ?? .black static var secondary = UIColor(named: "secondary") ?? .black static var onSecondary = UIColor(named: "onSecondary") ?? .black static var background = UIColor(named: "background") ?? .black diff --git a/ios/AlarmApp/AlarmApp/Material/M3Theme.swift b/ios/AlarmApp/AlarmApp/Material/M3Theme.swift index 7509438..8ca223c 100644 --- a/ios/AlarmApp/AlarmApp/Material/M3Theme.swift +++ b/ios/AlarmApp/AlarmApp/Material/M3Theme.swift @@ -68,7 +68,11 @@ extension M3Theme { extension M3Theme { static func applyTheme(card: MaterialCardView) { let theme = M3Theme() - card.layer.backgroundColor = theme.elevationOverlayColor(elevation: 1).cgColor + if let backgroundColor = card.cardBackgroundColor { + card.layer.backgroundColor = backgroundColor.cgColor + } else { + card.layer.backgroundColor = theme.elevationOverlayColor(elevation: 1).cgColor + } } } diff --git a/ios/AlarmApp/AlarmApp/MaterialUI/MaterialCardView.swift b/ios/AlarmApp/AlarmApp/MaterialUI/MaterialCardView.swift index fb45e60..1e142f6 100644 --- a/ios/AlarmApp/AlarmApp/MaterialUI/MaterialCardView.swift +++ b/ios/AlarmApp/AlarmApp/MaterialUI/MaterialCardView.swift @@ -45,11 +45,6 @@ class MaterialCardView: UIView { layer.rasterizationScale = UIScreen.main.scale let shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRedious) layer.shadowPath = shadowPath.cgPath - - if let backgroundColor = self.cardBackgroundColor { - self.layer.backgroundColor = backgroundColor.cgColor - } else { - M3Theme.applyTheme(card: self) - } + M3Theme.applyTheme(card: self) } } diff --git a/ios/AlarmApp/AlarmApp/MaterialUI/MaterialLabel.swift b/ios/AlarmApp/AlarmApp/MaterialUI/MaterialLabel.swift index 8439f0b..b419eda 100644 --- a/ios/AlarmApp/AlarmApp/MaterialUI/MaterialLabel.swift +++ b/ios/AlarmApp/AlarmApp/MaterialUI/MaterialLabel.swift @@ -61,7 +61,6 @@ class MaterialLabel: UILabel { } private func commonInit() { - self.textColor = .onBackground self.alpha = UIFont.TextEmphasis.full.rawValue } } diff --git a/ios/AlarmApp/AlarmApp/Views/AlarmCountItem.xib b/ios/AlarmApp/AlarmApp/Views/AlarmCountItem.xib index 9555322..6e0598b 100644 --- a/ios/AlarmApp/AlarmApp/Views/AlarmCountItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/AlarmCountItem.xib @@ -1,8 +1,9 @@ - + - + + @@ -18,15 +19,15 @@ @@ -46,7 +47,12 @@ - + + + + + + diff --git a/ios/AlarmApp/AlarmApp/Views/AlarmListItem.swift b/ios/AlarmApp/AlarmApp/Views/AlarmListItem.swift index 63b807e..6b68c4f 100644 --- a/ios/AlarmApp/AlarmApp/Views/AlarmListItem.swift +++ b/ios/AlarmApp/AlarmApp/Views/AlarmListItem.swift @@ -37,7 +37,7 @@ class AlarmListItem: UITableViewCell { override func layoutSubviews() { super.layoutSubviews() - self.selectedBackgroundView?.backgroundColor = UIColor.background.overlay(withColor: .primary, alpha: 0.12) + self.selectedBackgroundView?.backgroundColor = M3Theme().elevationOverlayColor(elevation: 1) self.messageLabel.alpha = UIFont.TextEmphasis.full.rawValue self.deviceLabel.alpha = UIFont.TextEmphasis.full.rawValue self.timeLabel.alpha = UIFont.TextEmphasis.full.rawValue diff --git a/ios/AlarmApp/AlarmApp/Views/AlarmListItem.xib b/ios/AlarmApp/AlarmApp/Views/AlarmListItem.xib index 5e46618..048654e 100644 --- a/ios/AlarmApp/AlarmApp/Views/AlarmListItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/AlarmListItem.xib @@ -118,7 +118,7 @@ - + diff --git a/ios/AlarmApp/AlarmApp/Views/AuditRecordItem.xib b/ios/AlarmApp/AlarmApp/Views/AuditRecordItem.xib index a6b7f32..55644e6 100644 --- a/ios/AlarmApp/AlarmApp/Views/AuditRecordItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/AuditRecordItem.xib @@ -3,6 +3,7 @@ + @@ -19,13 +20,13 @@ @@ -56,4 +57,9 @@ + + + + + diff --git a/ios/AlarmApp/AlarmApp/Views/CommentItem.swift b/ios/AlarmApp/AlarmApp/Views/CommentItem.swift index 76f4ab4..ab2e812 100644 --- a/ios/AlarmApp/AlarmApp/Views/CommentItem.swift +++ b/ios/AlarmApp/AlarmApp/Views/CommentItem.swift @@ -38,6 +38,7 @@ class CommentItem: UITableViewCell { self.titleLabel.font = UIFont.preferredFont(forTextStyle: .body).bold() self.timeLabel.alpha = UIFont.TextEmphasis.medium.rawValue self.valueLabel.alpha = UIFont.TextEmphasis.full.rawValue + setCardBackgroundColor() } func bind(with comment: C8yComment?) { @@ -53,14 +54,17 @@ class CommentItem: UITableViewCell { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if self.traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { - if self.traitCollection.userInterfaceStyle == .dark { - let theme = M3Theme() - self.cardView.cardBackgroundColor = theme.elevationOverlayColor(elevation: 2) - self.cardView.shadowRadius = 0 - } else { - self.cardView.cardBackgroundColor = .background - self.cardView.shadowRadius = 2 - } + setCardBackgroundColor() + } + } + + private func setCardBackgroundColor() { + if self.traitCollection.userInterfaceStyle == .dark { + self.cardView.cardBackgroundColor = nil + self.cardView.shadowRadius = 0 + } else { + self.cardView.cardBackgroundColor = .surface + self.cardView.shadowRadius = 2 } } } diff --git a/ios/AlarmApp/AlarmApp/Views/CommentItem.xib b/ios/AlarmApp/AlarmApp/Views/CommentItem.xib index c428e72..bf068aa 100644 --- a/ios/AlarmApp/AlarmApp/Views/CommentItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/CommentItem.xib @@ -22,19 +22,19 @@ @@ -52,9 +52,6 @@ - - - @@ -78,6 +75,7 @@ + @@ -100,8 +98,8 @@ - - + + diff --git a/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.swift b/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.swift index 5928ca5..f1d24ec 100644 --- a/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.swift +++ b/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.swift @@ -25,11 +25,13 @@ class DecoratedLabel: UIView { override init(frame: CGRect) { super.init(frame: frame) self.loadFromNib() + self.severityLabel.alpha = UIFont.TextEmphasis.full.rawValue } required init?(coder: NSCoder) { super.init(coder: coder) self.loadFromNib() + self.severityLabel.alpha = UIFont.TextEmphasis.full.rawValue } func bind(with severity: C8yAlarm.C8ySeverity?) { @@ -37,18 +39,13 @@ class DecoratedLabel: UIView { self.severityImage.image = severity.icon() self.severityImage.tintColor = severity.tint() self.severityLabel.text = severity.localised() - self.severityLabel.textColor = .onBackground - self.severityLabel.alpha = UIFont.TextEmphasis.full.rawValue } } func bind(with status: C8yAlarm.C8yStatus?) { if let status = status { self.severityImage.image = status.icon() - self.severityImage.tintColor = UIColor.background.overlay(withColor: .onBackground, alpha: UIColor.Opacity.medium) self.severityLabel.text = status.localised() - self.severityLabel.textColor = .onBackground - self.severityLabel.alpha = UIFont.TextEmphasis.full.rawValue } } @@ -56,15 +53,12 @@ class DecoratedLabel: UIView { self.severityImage.image = nil self.severityLabel.text = "" if let count = commentCount { - self.severityImage.tintColor = UIColor.background.overlay(withColor: .onBackground, alpha: UIColor.Opacity.medium) self.severityImage.image = UIImage(systemName: "message.circle.fill") if count > 10 { self.severityLabel.text = "9+" } else { self.severityLabel.text = String(describing: count) } - self.severityLabel.textColor = .onBackground - self.severityLabel.alpha = UIFont.TextEmphasis.full.rawValue } } } diff --git a/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.xib b/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.xib index 67b1373..2f699c0 100644 --- a/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.xib +++ b/ios/AlarmApp/AlarmApp/Views/DecoratedLabel.xib @@ -20,6 +20,7 @@ + @@ -52,7 +53,7 @@ - + diff --git a/ios/AlarmApp/AlarmApp/Views/DetailsItem.xib b/ios/AlarmApp/AlarmApp/Views/DetailsItem.xib index 6095ef8..ce75ec3 100644 --- a/ios/AlarmApp/AlarmApp/Views/DetailsItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/DetailsItem.xib @@ -3,6 +3,7 @@ + @@ -20,7 +21,7 @@ @@ -54,4 +55,9 @@ + + + + + diff --git a/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.swift b/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.swift index 3e55bf9..ca6da9d 100644 --- a/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.swift +++ b/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.swift @@ -40,7 +40,6 @@ class EmptyAlarmsItem: UIView { self.loadFromNib() self.titleLabel.alpha = UIFont.TextEmphasis.full.rawValue self.subTitleLabel.alpha = UIFont.TextEmphasis.medium.rawValue - self.icon.tintColor = UIColor.background.overlay(withColor: .primary, alpha: UIColor.Opacity.low) self.button.addTarget(self, action: #selector(onOpenFilterTapped(sender:)), for: .touchUpInside) } diff --git a/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.xib b/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.xib index e8e7852..6b8a8d2 100644 --- a/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/EmptyAlarmsItem.xib @@ -22,7 +22,7 @@ - + @@ -78,13 +78,16 @@ - + - + + + + diff --git a/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.swift b/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.swift index be35a94..42a85c2 100644 --- a/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.swift +++ b/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.swift @@ -35,6 +35,5 @@ class EmptyCommentsItem: UIView { private func commonInit() { self.loadFromNib() self.titleLabel.alpha = UIFont.TextEmphasis.medium.rawValue - self.titleImage.tintColor = UIColor.background.overlay(withColor: .primary, alpha: UIColor.Opacity.low) } } diff --git a/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.xib b/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.xib index 2a2496d..0d93103 100644 --- a/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/EmptyCommentsItem.xib @@ -19,7 +19,7 @@ - + @@ -52,10 +52,13 @@ - + - + + + + diff --git a/ios/AlarmApp/AlarmApp/Views/SeparatorItem.xib b/ios/AlarmApp/AlarmApp/Views/SeparatorItem.xib index 19156c2..d64dddc 100644 --- a/ios/AlarmApp/AlarmApp/Views/SeparatorItem.xib +++ b/ios/AlarmApp/AlarmApp/Views/SeparatorItem.xib @@ -3,6 +3,7 @@ + @@ -18,7 +19,7 @@