closed #27
88
Feels.xcodeproj/xcshareddata/xcschemes/Feels (iOS).xcscheme
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1320"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90B01278C7DE0001C4FEA"
|
||||||
|
BuildableName = "Tests iOS.xctest"
|
||||||
|
BlueprintName = "Tests iOS"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1320"
|
||||||
|
wasCreatedForAppExtension = "YES"
|
||||||
|
version = "2.0">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90B44278C7E7A001C4FEA"
|
||||||
|
BuildableName = "FeelsWidgetExtension.appex"
|
||||||
|
BlueprintName = "FeelsWidgetExtension"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = ""
|
||||||
|
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||||
|
launchStyle = "0"
|
||||||
|
askForAppToLaunch = "Yes"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES"
|
||||||
|
launchAutomaticallySubstyle = "2">
|
||||||
|
<RemoteRunnable
|
||||||
|
runnableDebuggingMode = "2"
|
||||||
|
BundleIdentifier = "com.apple.springboard">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90B44278C7E7A001C4FEA"
|
||||||
|
BuildableName = "FeelsWidgetExtension.appex"
|
||||||
|
BlueprintName = "FeelsWidgetExtension"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</RemoteRunnable>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "_XCWidgetKind"
|
||||||
|
value = "FeelsGraphicWidget"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "_XCWidgetDefaultView"
|
||||||
|
value = "timeline"
|
||||||
|
isEnabled = "NO">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "_XCWidgetFamily"
|
||||||
|
value = "small"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
askForAppToLaunch = "Yes"
|
||||||
|
launchAutomaticallySubstyle = "2">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "1CD90AF4278C7DE0001C4FEA"
|
||||||
|
BuildableName = "iFeel.app"
|
||||||
|
BlueprintName = "Feels (iOS)"
|
||||||
|
ReferencedContainer = "container:Feels.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>5</integer>
|
<integer>4</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>PlaygroundChart (Playground) 10.xcscheme</key>
|
<key>PlaygroundChart (Playground) 10.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>6</integer>
|
<integer>5</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>PlaygroundChart (Playground) 3.xcscheme</key>
|
<key>PlaygroundChart (Playground) 3.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -122,7 +122,25 @@
|
|||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>4</integer>
|
<integer>3</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>1CD90AF4278C7DE0001C4FEA</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>1CD90B01278C7DE0001C4FEA</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>1CD90B44278C7E7A001C4FEA</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
BIN
FeelsWidget/Assets.xcassets/AverageGraphic.imageset/AverageGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 208 KiB |
21
FeelsWidget/Assets.xcassets/AverageGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "AverageGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FeelsWidget/Assets.xcassets/BadGraphic.imageset/BadGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 207 KiB |
21
FeelsWidget/Assets.xcassets/BadGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "BadGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
21
FeelsWidget/Assets.xcassets/GoodGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "GoodGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FeelsWidget/Assets.xcassets/GoodGraphic.imageset/GoodGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 210 KiB |
21
FeelsWidget/Assets.xcassets/GreatGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "GreatGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FeelsWidget/Assets.xcassets/GreatGraphic.imageset/GreatGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 209 KiB |
21
FeelsWidget/Assets.xcassets/HorribleGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "HorribleGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FeelsWidget/Assets.xcassets/HorribleGraphic.imageset/HorribleGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 212 KiB |
21
FeelsWidget/Assets.xcassets/MissingGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "MissingGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FeelsWidget/Assets.xcassets/MissingGraphic.imageset/MissingGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 236 KiB |
@@ -13,13 +13,15 @@ import CoreData
|
|||||||
class WatchTimelineView: Identifiable {
|
class WatchTimelineView: Identifiable {
|
||||||
let id = UUID()
|
let id = UUID()
|
||||||
let image: Image
|
let image: Image
|
||||||
|
let graphic: Image
|
||||||
let date: Date
|
let date: Date
|
||||||
let color: Color
|
let color: Color
|
||||||
|
|
||||||
init(image: Image, date: Date, color: Color) {
|
init(image: Image, date: Date, color: Color, graphic: Image) {
|
||||||
self.image = image
|
self.image = image
|
||||||
self.date = date
|
self.date = date
|
||||||
self.color = color
|
self.color = color
|
||||||
|
self.graphic = graphic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,13 +53,20 @@ struct TimeLineCreator {
|
|||||||
|
|
||||||
return day == entryDay && month == entryMonth && year == entryYear
|
return day == entryDay && month == entryMonth && year == entryYear
|
||||||
}).first {
|
}).first {
|
||||||
let timeLineView = WatchTimelineView(image: item.mood.icon, date: pastDate, color: item.mood.color)
|
let timeLineView = WatchTimelineView(image: item.mood.icon,
|
||||||
|
date: pastDate,
|
||||||
|
color: item.mood.color,
|
||||||
|
graphic: item.mood.graphic)
|
||||||
returnViews.append(timeLineView)
|
returnViews.append(timeLineView)
|
||||||
} else {
|
} else {
|
||||||
let timeLineView = WatchTimelineView(image: Mood.missing.icon, date: pastDate, color: Mood.missing.color)
|
let timeLineView = WatchTimelineView(image: Mood.missing.icon,
|
||||||
|
date: pastDate,
|
||||||
|
color: Mood.missing.color,
|
||||||
|
graphic: Mood.missing.graphic)
|
||||||
returnViews.append(timeLineView)
|
returnViews.append(timeLineView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
returnViews = returnViews.sorted(by: { $0.date > $1.date })
|
||||||
return returnViews
|
return returnViews
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +81,7 @@ struct Provider: IntentTimelineProvider {
|
|||||||
for pastDay in 0...10 {
|
for pastDay in 0...10 {
|
||||||
let pastDate = Calendar.current.date(byAdding: .day, value: -pastDay, to: Date())!
|
let pastDate = Calendar.current.date(byAdding: .day, value: -pastDay, to: Date())!
|
||||||
let mood = Mood.allValues.randomElement()!
|
let mood = Mood.allValues.randomElement()!
|
||||||
sampleViews.append( WatchTimelineView(image: mood.icon, date: pastDate, color: mood.color) )
|
sampleViews.append(WatchTimelineView(image: mood.icon, date: pastDate, color: mood.color, graphic: mood.graphic))
|
||||||
}
|
}
|
||||||
return SimpleEntry(date: Date(), configuration: ConfigurationIntent(), timeLineViews: sampleViews)
|
return SimpleEntry(date: Date(), configuration: ConfigurationIntent(), timeLineViews: sampleViews)
|
||||||
}
|
}
|
||||||
@@ -84,7 +93,7 @@ struct Provider: IntentTimelineProvider {
|
|||||||
for pastDay in 0...10 {
|
for pastDay in 0...10 {
|
||||||
let pastDate = Calendar.current.date(byAdding: .day, value: -pastDay, to: Date())!
|
let pastDate = Calendar.current.date(byAdding: .day, value: -pastDay, to: Date())!
|
||||||
let mood = Mood.allValues.randomElement()!
|
let mood = Mood.allValues.randomElement()!
|
||||||
timeLineViews.append( WatchTimelineView(image: mood.icon, date: pastDate, color: mood.color) )
|
timeLineViews.append( WatchTimelineView(image: mood.icon, date: pastDate, color: mood.color, graphic: mood.graphic))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let data = TimeLineCreator.getData()
|
let data = TimeLineCreator.getData()
|
||||||
@@ -148,6 +157,22 @@ struct FeelsWidgetEntryView : View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct FeelsGraphicWidgetEntryView : View {
|
||||||
|
@Environment(\.sizeCategory) var sizeCategory
|
||||||
|
@Environment(\.widgetFamily) var family
|
||||||
|
|
||||||
|
var entry: Provider.Entry
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
var body: some View {
|
||||||
|
SmallGraphicWidgetView(entry: entry)
|
||||||
|
.onReceive(NotificationCenter.default.publisher(for: .NSPersistentStoreRemoteChange)) { _ in
|
||||||
|
// make sure you don't call this too often
|
||||||
|
WidgetCenter.shared.reloadAllTimelines()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct SmallWidgetView: View {
|
struct SmallWidgetView: View {
|
||||||
var entry: Provider.Entry
|
var entry: Provider.Entry
|
||||||
|
|
||||||
@@ -167,6 +192,18 @@ struct SmallWidgetView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct SmallGraphicWidgetView: View {
|
||||||
|
var entry: Provider.Entry
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
GeometryReader { geo in
|
||||||
|
entry.timeLineViews.first!.graphic
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct TimeHeaderView: View {
|
struct TimeHeaderView: View {
|
||||||
let startDate: Date
|
let startDate: Date
|
||||||
let endDate: Date
|
let endDate: Date
|
||||||
@@ -275,6 +312,13 @@ struct EntryCard: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@main
|
@main
|
||||||
|
struct FeelsBundle: WidgetBundle {
|
||||||
|
var body: some Widget {
|
||||||
|
FeelsWidget()
|
||||||
|
FeelsGraphicWidget()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct FeelsWidget: Widget {
|
struct FeelsWidget: Widget {
|
||||||
let kind: String = "FeelsWidget"
|
let kind: String = "FeelsWidget"
|
||||||
|
|
||||||
@@ -290,6 +334,21 @@ struct FeelsWidget: Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct FeelsGraphicWidget: Widget {
|
||||||
|
let kind: String = "FeelsGraphicWidget"
|
||||||
|
|
||||||
|
var body: some WidgetConfiguration {
|
||||||
|
IntentConfiguration(kind: kind,
|
||||||
|
intent: ConfigurationIntent.self,
|
||||||
|
provider: Provider()) { entry in
|
||||||
|
FeelsGraphicWidgetEntryView(entry: entry)
|
||||||
|
}
|
||||||
|
.configurationDisplayName("Feels")
|
||||||
|
.description("")
|
||||||
|
.supportedFamilies([.systemSmall])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct FeelsWidget_Previews: PreviewProvider {
|
struct FeelsWidget_Previews: PreviewProvider {
|
||||||
static var data: [WatchTimelineView] {
|
static var data: [WatchTimelineView] {
|
||||||
var data = PersistenceController.shared.randomEntries(count: 10)
|
var data = PersistenceController.shared.randomEntries(count: 10)
|
||||||
|
|||||||
BIN
Shared/Assets.xcassets/AverageGraphic.imageset/AverageGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 208 KiB |
21
Shared/Assets.xcassets/AverageGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "AverageGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Shared/Assets.xcassets/BadGraphic.imageset/BadGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 207 KiB |
21
Shared/Assets.xcassets/BadGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "BadGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
21
Shared/Assets.xcassets/GoodGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "GoodGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Shared/Assets.xcassets/GoodGraphic.imageset/GoodGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 210 KiB |
21
Shared/Assets.xcassets/GreatGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "GreatGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Shared/Assets.xcassets/GreatGraphic.imageset/GreatGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 209 KiB |
21
Shared/Assets.xcassets/HorribleGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "HorribleGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Shared/Assets.xcassets/HorribleGraphic.imageset/HorribleGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 212 KiB |
21
Shared/Assets.xcassets/MissingGraphic.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "MissingGraphic.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Shared/Assets.xcassets/MissingGraphic.imageset/MissingGraphic.png
vendored
Normal file
|
After Width: | Height: | Size: 236 KiB |
@@ -71,6 +71,24 @@ enum Mood: Int {
|
|||||||
return Image("missing", bundle: .main)
|
return Image("missing", bundle: .main)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var graphic: Image {
|
||||||
|
switch self {
|
||||||
|
|
||||||
|
case .horrible:
|
||||||
|
return Image("HorribleGraphic", bundle: .main)
|
||||||
|
case .bad:
|
||||||
|
return Image("BadGraphic", bundle: .main)
|
||||||
|
case .average:
|
||||||
|
return Image("AverageGraphic", bundle: .main)
|
||||||
|
case .good:
|
||||||
|
return Image("GoodGraphic", bundle: .main)
|
||||||
|
case .great:
|
||||||
|
return Image("GreatGraphic", bundle: .main)
|
||||||
|
case .missing:
|
||||||
|
return Image("MissingGraphic", bundle: .main)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Mood: Identifiable {
|
extension Mood: Identifiable {
|
||||||
|
|||||||
@@ -62,11 +62,6 @@ class PersistenceController {
|
|||||||
try! viewContext.setQueryGenerationFrom(.current)
|
try! viewContext.setQueryGenerationFrom(.current)
|
||||||
viewContext.refreshAllObjects()
|
viewContext.refreshAllObjects()
|
||||||
|
|
||||||
let fakeRequest = NSFetchRequest<MoodEntry>(entityName: "MoodEntry")
|
|
||||||
let fakeData = try! viewContext.fetch(fakeRequest)
|
|
||||||
for item in fakeData {
|
|
||||||
print(item.forDate!)
|
|
||||||
}
|
|
||||||
var includedDays16 = [Int16]()
|
var includedDays16 = [Int16]()
|
||||||
|
|
||||||
if includedDays.isEmpty {
|
if includedDays.isEmpty {
|
||||||
|
|||||||