Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LoopKit/LoopPluginBundleKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ public enum LoopPluginBundleKey: String {
case serviceIdentifier = "com.loopkit.Loop.ServiceIdentifier"
case statefulPluginIdentifier = "com.loopkit.Loop.StatefulPluginIdentifier"
case supportIdentifier = "com.loopkit.Loop.SupportIdentifier"
case deviceManufacturer = "com.loopkit.Loop.DeviceManufacturer"
case serviceCategory = "com.loopkit.Loop.ServiceCategory"
case pluginSubtitle = "com.loopkit.Loop.PluginSubtitle"
}
16 changes: 15 additions & 1 deletion LoopKitUI/CGMManagerUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@

import HealthKit
import SwiftUI
import UIKit
import LoopKit
import LoopAlgorithm

public struct CGMManagerDescriptor {
public let identifier: String
public let localizedTitle: String
/// The models the plugin supports, or other details shown under the title in the picker
public let subtitle: String?
public let manufacturer: String?
public let image: UIImage?

public init(identifier: String, localizedTitle: String) {
public init(
identifier: String,
localizedTitle: String,
subtitle: String? = nil,
manufacturer: String?,
image: UIImage?
) {
self.identifier = identifier
self.localizedTitle = localizedTitle
self.subtitle = subtitle
self.manufacturer = manufacturer
self.image = image
}
}

Expand Down
7 changes: 7 additions & 0 deletions LoopKitUI/DeviceManagerUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public protocol DeviceManagerUI: DeviceManager {
/// An image representing a generalized device. Used during onboarding.
static var onboardingImage: UIImage? { get }

/// An image used in the device picker
static var pickerImage: UIImage? { get }

/// An image representing a device configuration after it is set up
var smallImage: UIImage? { get }
}

public extension DeviceManagerUI {
static var pickerImage: UIImage? { onboardingImage }
}
17 changes: 15 additions & 2 deletions LoopKitUI/PumpManagerUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ import LoopAlgorithm
public struct PumpManagerDescriptor {
public let identifier: String
public let localizedTitle: String

public init(identifier: String, localizedTitle: String) {
/// The models the plugin supports, or other details shown under the title in the picker
public let subtitle: String?
public let manufacturer: String?
public let image: UIImage?

public init(
identifier: String,
localizedTitle: String,
subtitle: String? = nil,
manufacturer: String?,
image: UIImage?
) {
self.identifier = identifier
self.localizedTitle = localizedTitle
self.subtitle = subtitle
self.manufacturer = manufacturer
self.image = image
}
}

Expand Down
15 changes: 14 additions & 1 deletion LoopKitUI/ServiceUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ import LoopKit
public struct ServiceDescriptor {
public let identifier: String
public let localizedTitle: String
/// Details shown under the title in the picker
public let subtitle: String?
public let category: String?
public let image: UIImage?

public init(identifier: String, localizedTitle: String) {
public init(
identifier: String,
localizedTitle: String,
subtitle: String? = nil,
category: String?,
image: UIImage?
) {
self.identifier = identifier
self.localizedTitle = localizedTitle
self.subtitle = subtitle
self.category = category
self.image = image
}
}

Expand Down