Merge pull request #3154 from omnivore-app/fix/ios-dark-light-switch
Better light/dark mode switching on iOS
This commit is contained in:
@ -482,7 +482,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
.background(Color.isDarkMode ? Color(hex: "#1C1C1C") : Color.systemBackground)
|
||||
.background(Color.themeFeatureBackground)
|
||||
.frame(height: 190)
|
||||
|
||||
if !Color.isDarkMode {
|
||||
@ -567,7 +567,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
||||
featureCard
|
||||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
.listRowSeparator(.hidden, edges: .all)
|
||||
.modifier(AnimatingCellHeight(height: 190 + (Color.isDarkMode ? 13 : 13)))
|
||||
.modifier(AnimatingCellHeight(height: 190 + 13))
|
||||
.onDisappear {
|
||||
withAnimation {
|
||||
isListScrolled = true
|
||||
|
||||
@ -29,6 +29,8 @@ public extension Color {
|
||||
static var themeLightestGray: Color { Color("_lightestGray", bundle: .module) }
|
||||
static var themeDarkWhiteGray: Color { Color("_darkWhiteGray", bundle: .module) }
|
||||
static var themeDarkGray: Color { Color("_darkGray", bundle: .module) }
|
||||
static var themeLibraryItemSubtle: Color { Color("_themeLibraryItemSubtle", bundle: .module) }
|
||||
static var themeFeatureBackground: Color { Color("_themeFeatureBackground", bundle: .module) }
|
||||
|
||||
static var themeLabelOutline: Color { Color("_labelOutline", bundle: .module) }
|
||||
static var themeLabelForeground: Color { Color("_labelForeground", bundle: .module) }
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"color-space" : "display-p3",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xD9",
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xFF",
|
||||
"green" : "0xFF",
|
||||
"red" : "0xFE"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x1C",
|
||||
"green" : "0x1C",
|
||||
"red" : "0x1C"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x3C",
|
||||
"green" : "0x3C",
|
||||
"red" : "0x3C"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xD9",
|
||||
"green" : "0xD9",
|
||||
"red" : "0xD9"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -215,25 +215,24 @@ public struct LibraryItemCard: View {
|
||||
$0.icon
|
||||
}
|
||||
|
||||
let fgcolor = Color.isDarkMode ? Color.themeDarkWhiteGray : Color.themeMiddleGray
|
||||
Text("\(estimatedReadingTime)")
|
||||
.font(.caption2).fontWeight(.medium)
|
||||
.foregroundColor(fgcolor)
|
||||
.foregroundColor(Color.themeLibraryItemSubtle)
|
||||
|
||||
+
|
||||
Text("\(readingProgress)")
|
||||
.font(.caption2).fontWeight(.medium)
|
||||
.foregroundColor(isPartiallyRead ? Color.appGreenSuccess : fgcolor)
|
||||
.foregroundColor(isPartiallyRead ? Color.appGreenSuccess : Color.themeLibraryItemSubtle)
|
||||
|
||||
+
|
||||
Text("\(highlightsText)")
|
||||
.font(.caption2).fontWeight(.medium)
|
||||
.foregroundColor(fgcolor)
|
||||
.foregroundColor(Color.themeLibraryItemSubtle)
|
||||
|
||||
+
|
||||
Text("\(notesText)")
|
||||
.font(.caption2).fontWeight(.medium)
|
||||
.foregroundColor(fgcolor)
|
||||
.foregroundColor(Color.themeLibraryItemSubtle)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
@ -293,7 +292,7 @@ public struct LibraryItemCard: View {
|
||||
var byLine: some View {
|
||||
Text(bylineStr)
|
||||
.font(.caption2)
|
||||
.foregroundColor(Color.isDarkMode ? Color.themeDarkWhiteGray : Color.themeMiddleGray)
|
||||
.foregroundColor(Color.themeLibraryItemSubtle)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.lineLimit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user