-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// LocationInlineAccessory.swift | ||
// OTLWidgetsExtension | ||
// | ||
// Created by Soongyu Kwon on 28/07/2023. | ||
// Copyright © 2023 The Chromium Authors. All rights reserved. | ||
// | ||
|
||
import WidgetKit | ||
import SwiftUI | ||
import Intents | ||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct LocationInlineAccessoryEntryView : View { | ||
@Environment(\.widgetFamily) var widgetFamily | ||
var entry: Provider.Entry | ||
|
||
var body: some View { | ||
switch widgetFamily { | ||
case .accessoryInline: | ||
HStack { | ||
Image(systemName: "tablecells") | ||
Text("(E11 303) 프로그래밍기초") | ||
} | ||
|
||
default: | ||
Text("Not Implemented") | ||
} | ||
} | ||
} | ||
|
||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct LocationInlineAccessory: Widget { | ||
let kind: String = "LocationInlineAccessory" | ||
|
||
var body: some WidgetConfiguration { | ||
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in | ||
LocationInlineAccessoryEntryView(entry: entry) | ||
} | ||
.configurationDisplayName("다음 수업과 장소") | ||
.description("다음 수업과 장소를 확인합니다.") | ||
.supportedFamilies([.accessoryInline]) | ||
} | ||
} | ||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct LocationInlineAccessoryPreviews: PreviewProvider { | ||
static var previews: some View { | ||
LocationInlineAccessoryEntryView(entry: WidgetEntry(date: Date(), timetableData: nil, configuration: ConfigurationIntent())) | ||
.previewContext(WidgetPreviewContext(family: .accessoryInline)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// TimeInlineAccessory.swift | ||
// OTLWidgetsExtension | ||
// | ||
// Created by Soongyu Kwon on 28/07/2023. | ||
// Copyright © 2023 The Chromium Authors. All rights reserved. | ||
// | ||
|
||
import WidgetKit | ||
import SwiftUI | ||
import Intents | ||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct TimeInlineAccessoryEntryView : View { | ||
@Environment(\.widgetFamily) var widgetFamily | ||
var entry: Provider.Entry | ||
|
||
var body: some View { | ||
switch widgetFamily { | ||
case .accessoryInline: | ||
HStack { | ||
Image(systemName: "tablecells") | ||
Text("10:30 프로그래밍기초") | ||
} | ||
|
||
default: | ||
Text("Not Implemented") | ||
} | ||
} | ||
} | ||
|
||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct TimeInlineAccessory: Widget { | ||
let kind: String = "TimeInlineAccessory" | ||
|
||
var body: some WidgetConfiguration { | ||
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in | ||
TimeInlineAccessoryEntryView(entry: entry) | ||
} | ||
.configurationDisplayName("다음 수업과 시간") | ||
.description("다음 수업과 시간을 확인합니다.") | ||
.supportedFamilies([.accessoryInline]) | ||
} | ||
} | ||
|
||
@available(iOSApplicationExtension 16.0, *) | ||
struct TimeInlineAccessoryPreviews: PreviewProvider { | ||
static var previews: some View { | ||
TimeInlineAccessoryEntryView(entry: WidgetEntry(date: Date(), timetableData: nil, configuration: ConfigurationIntent())) | ||
.previewContext(WidgetPreviewContext(family: .accessoryInline)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters