Widget preview: real small-tile proportions + iOS-default-style wallpaper
- Small widget card sized to actual system-small content (158×158pt + padding) instead of filling available width; medium keeps 338×158pt - Wallpaper now mimics the iOS default (dark navy→black in dark mode, soft blue-grey in light) via colorScheme-adaptive gradient - Added 10-widgets-light.png; re-captured 9-widgets-dark.png with data - 95/95 tests green; Release IPA rebuilt + re-served
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 516 KiB After Width: | Height: | Size: 2.4 MiB |
@@ -6,15 +6,11 @@ import WidgetKit
|
|||||||
/// code the widget extension renders) at small + medium sizes. Used for App
|
/// code the widget extension renders) at small + medium sizes. Used for App
|
||||||
/// Store screenshot captures; not reachable from the UI.
|
/// Store screenshot captures; not reachable from the UI.
|
||||||
struct WidgetMockScreen: View {
|
struct WidgetMockScreen: View {
|
||||||
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
LinearGradient(
|
wallpaper
|
||||||
colors: [
|
|
||||||
Color(red: 0.09, green: 0.10, blue: 0.14),
|
|
||||||
Color(red: 0.02, green: 0.03, blue: 0.06)
|
|
||||||
],
|
|
||||||
startPoint: .top, endPoint: .bottom
|
|
||||||
)
|
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 26) {
|
VStack(alignment: .leading, spacing: 26) {
|
||||||
@@ -27,10 +23,10 @@ struct WidgetMockScreen: View {
|
|||||||
VStack(alignment: .leading, spacing: 3) {
|
VStack(alignment: .leading, spacing: 3) {
|
||||||
Text("FuelBoard")
|
Text("FuelBoard")
|
||||||
.font(.title2.bold())
|
.font(.title2.bold())
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.primary)
|
||||||
Text("Cheapest fuel near you")
|
Text("Cheapest fuel near you")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundStyle(.white.opacity(0.65))
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.top, 8)
|
.padding(.top, 8)
|
||||||
@@ -44,15 +40,46 @@ struct WidgetMockScreen: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// iOS-default-style wallpaper (dark navy → black in dark mode, soft
|
||||||
|
/// blue-grey in light), matching the system default look.
|
||||||
|
private var wallpaper: some View {
|
||||||
|
Group {
|
||||||
|
if colorScheme == .dark {
|
||||||
|
LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(red: 0.09, green: 0.14, blue: 0.26),
|
||||||
|
Color(red: 0.05, green: 0.08, blue: 0.15),
|
||||||
|
Color(red: 0.02, green: 0.03, blue: 0.06)
|
||||||
|
],
|
||||||
|
startPoint: .topLeading, endPoint: .bottomTrailing
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(red: 0.72, green: 0.80, blue: 0.94),
|
||||||
|
Color(red: 0.85, green: 0.90, blue: 0.97),
|
||||||
|
Color(red: 0.94, green: 0.96, blue: 0.99)
|
||||||
|
],
|
||||||
|
startPoint: .topLeading, endPoint: .bottomTrailing
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func widgetCard(_ family: WidgetFamily, label: String) -> some View {
|
private func widgetCard(_ family: WidgetFamily, label: String) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
// Real widget proportions: system small content is 158×158pt,
|
||||||
|
// medium 338×158pt (card adds the 14pt padding each side).
|
||||||
|
let contentW: CGFloat = family == .systemSmall ? 158 : 338
|
||||||
|
let cardW: CGFloat = contentW + 28
|
||||||
|
let cardH: CGFloat = contentW + 28
|
||||||
|
return VStack(alignment: .leading, spacing: 10) {
|
||||||
Text(label.uppercased())
|
Text(label.uppercased())
|
||||||
.font(.caption.weight(.semibold))
|
.font(.caption.weight(.semibold))
|
||||||
.tracking(1)
|
.tracking(1)
|
||||||
.foregroundStyle(.white.opacity(0.5))
|
.foregroundStyle(.secondary)
|
||||||
FuelPriceWidgetContent(entry: mockEntry(family: family), family: family, isWidget: false)
|
FuelPriceWidgetContent(entry: mockEntry(family: family), family: family, isWidget: false)
|
||||||
.padding(14)
|
.padding(14)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(width: cardW, height: cardH, alignment: .leading)
|
||||||
.background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 24, style: .continuous))
|
.background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 24, style: .continuous))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1786807226.939194: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-pm/ModuleCache.noindex")
|
1786807715.783432: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-pm/ModuleCache.noindex")
|
||||||
|
|||||||
BIN
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>LastAccessedDate</key>
|
<key>LastAccessedDate</key>
|
||||||
<date>2026-08-15T15:20:26Z</date>
|
<date>2026-08-15T15:28:33Z</date>
|
||||||
<key>WorkspacePath</key>
|
<key>WorkspacePath</key>
|
||||||
<string>/Users/apt/workspace/fuelboard/FuelBoard.xcodeproj</string>
|
<string>/Users/apt/workspace/fuelboard/FuelBoard.xcodeproj</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
Reference in New Issue
Block a user