@@ -15,8 +15,8 @@ struct AppIconView: View, ThemeApplicable {
15
15
// MARK: - Theming
16
16
// FIXME FXIOS-11472 Improve our SwiftUI theming
17
17
@Environment ( \. themeManager)
18
- var themeManager
19
- @State var currentTheme : Theme = LightTheme ( )
18
+ private var themeManager
19
+ @State private var currentTheme : Theme = LightTheme ( )
20
20
@State private var themeColors : ThemeColourPalette = LightTheme ( ) . colors
21
21
22
22
struct UX {
@@ -30,13 +30,13 @@ struct AppIconView: View, ThemeApplicable {
30
30
static let appIconDarkBackgroundColor = UIColor ( rgb: 33 ) . color
31
31
}
32
32
33
- var selectionImageAccessibilityLabel : String {
33
+ private var selectionImageAccessibilityLabel : String {
34
34
return isSelected
35
35
? . Settings. AppIconSelection. Accessibility. AppIconSelectedLabel
36
36
: . Settings. AppIconSelection. Accessibility. AppIconUnselectedLabel
37
37
}
38
38
39
- var selectionAccessibilityHint : String {
39
+ private var selectionAccessibilityHint : String {
40
40
return . localizedStringWithFormat(
41
41
. Settings. AppIconSelection. Accessibility. AppIconSelectionHint,
42
42
appIcon. displayName
@@ -63,14 +63,28 @@ struct AppIconView: View, ThemeApplicable {
63
63
}
64
64
65
65
/// Devices prior to iOS 18 cannot change their icon display mode with their system settings
66
- var forceLightTheme : Bool {
66
+ private var forceLightTheme : Bool {
67
67
if #available( iOS 18 , * ) {
68
68
return false
69
69
} else {
70
70
return true
71
71
}
72
72
}
73
73
74
+ /// The expected default app icon background for iOS 18+ app icons with transparency
75
+ private var appIconBackgroundColor : Color {
76
+ if forceLightTheme {
77
+ return UX . appIconLightBackgroundColor
78
+ } else {
79
+ switch currentTheme. type. colorScheme {
80
+ case . light:
81
+ return UX . appIconLightBackgroundColor
82
+ default :
83
+ return UX . appIconDarkBackgroundColor
84
+ }
85
+ }
86
+ }
87
+
74
88
private func button( for image: UIImage ) -> some View {
75
89
Button ( action: {
76
90
setAppIcon ( appIcon)
@@ -85,7 +99,7 @@ struct AppIconView: View, ThemeApplicable {
85
99
. background (
86
100
forceLightTheme
87
101
? UX . appIconLightBackgroundColor
88
- : UX . appIconDarkBackgroundColor
102
+ : appIconBackgroundColor
89
103
)
90
104
// Pre iOS 18, force Light mode for the icons since users will only ever see Light home screen icons
91
105
// Note: This fix does not work on iOS15 but it's a small user base
0 commit comments