Skip to content

Commit 460a2f5

Browse files
committed
Create tinted and dark app icons for iOS 18
1 parent 71c42b9 commit 460a2f5

File tree

5 files changed

+28
-16
lines changed

5 files changed

+28
-16
lines changed

OneKDay.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
3E6B9FD6291C8CF6000A8808 /* WidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 3E6B9FC3291C8CF5000A8808 /* WidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
2828
3E9D1A17292BFAA500594281 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D1A1A292BFAA500594281 /* Localizable.strings */; };
2929
3E9D1A18292BFAA500594281 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D1A1A292BFAA500594281 /* Localizable.strings */; };
30-
3EABCC6D291C92DA00EB680B /* WidgetBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EABCC6B291C92BB00EB680B /* WidgetBaseView.swift */; };
30+
3EABCC6D291C92DA00EB680B /* StepCountWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EABCC6B291C92BB00EB680B /* StepCountWidget.swift */; };
3131
3EABCC6E291C93BF00EB680B /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45C61C291B6E8D0002B1C5 /* Types.swift */; };
3232
3EABCC6F291C93BF00EB680B /* HealthData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45C614291B5D620002B1C5 /* HealthData.swift */; };
3333
3EABCC70291C93BF00EB680B /* HealthKitSupport+Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45C619291B5E2C0002B1C5 /* HealthKitSupport+Strings.swift */; };
@@ -100,7 +100,7 @@
100100
3E9D1A1D292C1F9900594281 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
101101
3E9D1A1E292C1F9D00594281 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
102102
3E9D1A1F292C24D200594281 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
103-
3EABCC6B291C92BB00EB680B /* WidgetBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetBaseView.swift; sourceTree = "<group>"; };
103+
3EABCC6B291C92BB00EB680B /* StepCountWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepCountWidget.swift; sourceTree = "<group>"; };
104104
3EABCC72291C94BD00EB680B /* SmallWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmallWidget.swift; sourceTree = "<group>"; };
105105
3EABCC74291C94C800EB680B /* FullWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullWidget.swift; sourceTree = "<group>"; };
106106
3EABCC77291C97F200EB680B /* ChartUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartUtils.swift; sourceTree = "<group>"; };
@@ -245,7 +245,7 @@
245245
children = (
246246
3EABCC74291C94C800EB680B /* FullWidget.swift */,
247247
3EABCC72291C94BD00EB680B /* SmallWidget.swift */,
248-
3EABCC6B291C92BB00EB680B /* WidgetBaseView.swift */,
248+
3EABCC6B291C92BB00EB680B /* StepCountWidget.swift */,
249249
);
250250
path = Widget;
251251
sourceTree = "<group>";
@@ -420,7 +420,7 @@
420420
3E3167D6292E8765009E6B00 /* Widget.intentdefinition in Sources */,
421421
3EABCC70291C93BF00EB680B /* HealthKitSupport+Strings.swift in Sources */,
422422
3E6B9FCD291C8CF5000A8808 /* WidgetProvider.swift in Sources */,
423-
3EABCC6D291C92DA00EB680B /* WidgetBaseView.swift in Sources */,
423+
3EABCC6D291C92DA00EB680B /* StepCountWidget.swift in Sources */,
424424
3EABCC6F291C93BF00EB680B /* HealthData.swift in Sources */,
425425
3EABCC6E291C93BF00EB680B /* Types.swift in Sources */,
426426
);
@@ -465,7 +465,7 @@
465465
CURRENT_PROJECT_VERSION = 1;
466466
DEVELOPMENT_TEAM = 69RV8YV62P;
467467
GENERATE_INFOPLIST_FILE = YES;
468-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
468+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
469469
MARKETING_VERSION = 1.0;
470470
PRODUCT_BUNDLE_IDENTIFIER = com.hbiede.OneKDayUITests;
471471
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -487,7 +487,7 @@
487487
CURRENT_PROJECT_VERSION = 1;
488488
DEVELOPMENT_TEAM = 69RV8YV62P;
489489
GENERATE_INFOPLIST_FILE = YES;
490-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
490+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
491491
MARKETING_VERSION = 1.0;
492492
PRODUCT_BUNDLE_IDENTIFIER = com.hbiede.OneKDayUITests;
493493
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -662,7 +662,7 @@
662662
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
663663
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
664664
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
665-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
665+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
666666
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
667667
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
668668
MACOSX_DEPLOYMENT_TARGET = 12.5;
@@ -708,7 +708,7 @@
708708
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
709709
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
710710
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
711-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
711+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
712712
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
713713
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
714714
MACOSX_DEPLOYMENT_TARGET = 12.5;
@@ -738,7 +738,7 @@
738738
INFOPLIST_FILE = Widget/Info.plist;
739739
INFOPLIST_KEY_CFBundleDisplayName = "OneK Day";
740740
INFOPLIST_KEY_NSHumanReadableCopyright = "";
741-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
741+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
742742
LD_RUNPATH_SEARCH_PATHS = (
743743
"$(inherited)",
744744
"@executable_path/Frameworks",
@@ -768,7 +768,7 @@
768768
INFOPLIST_FILE = Widget/Info.plist;
769769
INFOPLIST_KEY_CFBundleDisplayName = "OneK Day";
770770
INFOPLIST_KEY_NSHumanReadableCopyright = "";
771-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
771+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
772772
LD_RUNPATH_SEARCH_PATHS = (
773773
"$(inherited)",
774774
"@executable_path/Frameworks",

OneKDay/Views/ContentView.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ struct ContentView: View {
288288
}
289289
}
290290
loading = false
291-
animateData()
292291
} else {
293292
// Data empty, skip to non-empty metric
294293
currentMetricIndex = (currentMetricIndex + 1) % metricOptions.count
@@ -297,7 +296,6 @@ struct ContentView: View {
297296
loadMetrics(for: metricOptions[currentMetricIndex])
298297
} else {
299298
loading = false
300-
animateData()
301299
}
302300
}
303301
}

Widget/Widget/FullWidget.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ struct FullWidget: View {
2828
Circle()
2929
.foregroundColor(.accentColor)
3030
.frame(maxWidth: 56)
31+
.widgetAccentable(true)
3132
Text("\(Int(metrics[metrics.count - 1].metric))")
3233
.font(.title2)
3334
.multilineTextAlignment(.center)
3435
.foregroundColor(.white)
36+
.widgetAccentable(false)
37+
.scaledToFit()
38+
.minimumScaleFactor(0.5)
3539
}
3640
.padding(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 0))
3741
Chart(metrics, id: \.startDate) {
@@ -46,6 +50,7 @@ struct FullWidget: View {
4650
typeIdentifier: .stepCount
4751
) ?? "X")
4852
}
53+
.widgetAccentable(false)
4954
.padding(EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16))
5055
}
5156
}
@@ -56,6 +61,7 @@ struct FullWidget: View {
5661
struct FullWidget_Previews: PreviewProvider {
5762
static var previews: some View {
5863
FullWidget(metrics: generateData())
64+
.containerBackground(Color.clear, for: .widget)
5965
.previewContext(WidgetPreviewContext(family: .systemMedium))
6066
}
6167

Widget/Widget/SmallWidget.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct SmallWidget: View {
1717
ZStack {
1818
Circle()
1919
.foregroundColor(Color.green)
20+
.widgetAccentable(true)
2021
VStack {
2122
Text("")
2223
.accessibilityHidden(true)
@@ -27,9 +28,11 @@ struct SmallWidget: View {
2728
.font(.system(size: 500))
2829
.minimumScaleFactor(0.01)
2930
.padding(EdgeInsets(top: 0, leading: 4, bottom: 0, trailing: 4))
31+
.widgetAccentable(false)
3032
Text(getUnitSuffix(for: .count(), with: Double(stepCount))!.capitalized)
3133
.foregroundColor(.white)
3234
.font(.title3)
35+
.widgetAccentable(false)
3336
}
3437
.padding(EdgeInsets(top: 16, leading: 0, bottom: 16, trailing: 0))
3538
}
@@ -47,6 +50,7 @@ struct SmallWidget: View {
4750
struct SmallWidget_Previews: PreviewProvider {
4851
static var previews: some View {
4952
SmallWidget(stepCount: 1000)
53+
.containerBackground(Color.clear, for: .widget)
5054
.previewContext(WidgetPreviewContext(family: .systemSmall))
5155
}
5256
}

Widget/Widget/WidgetBaseView.swift renamed to Widget/Widget/StepCountWidget.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// WidgetBaseView.swift
2+
// StepCountWidget.swift
33
// WidgetExtension
44
//
55
// Created by Hundter Biede on 11/9/22.
@@ -26,17 +26,21 @@ struct StepCountWidgetEntryView: View {
2626
Text("\(Int(lastCount))")
2727
.font(.largeTitle)
2828
}
29+
.containerBackground(Color.clear, for: .widget)
2930
case .accessoryRectangular, .accessoryInline:
3031
Text(formattedValue(
31-
lastCount,
32-
typeIdentifier: .stepCount
33-
)!
32+
lastCount,
33+
typeIdentifier: .stepCount
34+
)!
3435
)
3536
.font(.largeTitle)
37+
.containerBackground(Color.clear, for: .widget)
3638
case .systemSmall:
3739
SmallWidget(stepCount: metrics.isEmpty ? 0 : Int(lastCount))
40+
.containerBackground(Color.clear, for: .widget)
3841
default:
3942
FullWidget(metrics: metrics)
43+
.containerBackground(Color.clear, for: .widget)
4044
}
4145
}
4246
}

0 commit comments

Comments
 (0)