ContactImageHelpView.swift 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import SwiftUI
  2. struct ContactImageHelpView: View {
  3. var state: ContactImage.StateModel
  4. var helpSheetDetent: Binding<PresentationDetent>
  5. var body: some View {
  6. NavigationStack {
  7. List {
  8. DefinitionRow(
  9. term: "How Trio Manages Contact Images",
  10. definition: Text(
  11. "Trio will automatically assign a name like 'Trio 1' to any contact image you add, and a create an entry under your iOS Contacts. Use the 'Save' button at the bottom to save your customized contact image."
  12. )
  13. ).listRowBackground(Color.gray.opacity(0.1))
  14. DefinitionRow(
  15. term: "Preview Contact Image",
  16. definition: Text(
  17. "See a live preview of your contact image design at the top of the screen. Changes made to styles, layouts, or settings are instantly reflected."
  18. )
  19. ).listRowBackground(Color.gray.opacity(0.1))
  20. DefinitionRow(term: "Customize Layout and Style", definition: VStack(alignment: .leading) {
  21. Text("Choose from multiple layout options using the Layout Picker in the 'Style' section.")
  22. Text("Enable High Contrast Mode for better visibility in certain conditions.")
  23. Text("Available Layouts:")
  24. Text("• Default: Single 'primary' value with up to two smaller values ('Top', 'Bottom') above and below it.")
  25. Text("• Split: Divides values into two separate areas of same size.")
  26. }).listRowBackground(Color.gray.opacity(0.1))
  27. DefinitionRow(term: "Set Display Values", definition: VStack(alignment: .leading) {
  28. Text("Select what values to show on the contact image (e.g., glucose, trend, none) for the available slots:")
  29. Text("• None: No value displayed.")
  30. Text("• Glucose Reading: Current CGM provided glucose value.")
  31. Text("• Eventual Glucose: Glucose value as forecasted by the oref algorithm.")
  32. Text("• Glucose Delta: Change in glucose value.")
  33. Text("• Glucose Trend: Direction of glucose change.")
  34. Text("• COB: Carbs on Board.")
  35. Text("• IOB: Insulin on Board.")
  36. Text("• Loop Status: Indicates current loop status (green, yellow, red).")
  37. Text("• Last Loop Time: Time of the last algorithm run.")
  38. }).listRowBackground(Color.gray.opacity(0.1))
  39. DefinitionRow(term: "Adjust Ring Settings", definition: VStack(alignment: .leading) {
  40. Text("Add visual Rings around the contact image to highlight information.")
  41. Text("Fine-tune the ring’s Width and Gap to suit your design preferences.")
  42. Text("Available Rings:")
  43. Text("• Hidden: No ring displayed.")
  44. Text("• Loop Status: Indicates current loop status (green, yellow, red).")
  45. }).listRowBackground(Color.gray.opacity(0.1))
  46. DefinitionRow(term: "Customize Fonts", definition: VStack(alignment: .leading) {
  47. Text("Select font size, weight, and width to match your style:")
  48. Text("• Font Size: Adjust the main text size.")
  49. Text("• Secondary Font Size: Adjust text size for values in split layouts.")
  50. Text("• Font Weight: Control how bold the text appears.")
  51. Text("• Font Width: Choose between standard or expanded text spacing.")
  52. }).listRowBackground(Color.gray.opacity(0.1))
  53. }
  54. .scrollContentBackground(.hidden)
  55. .navigationBarTitle("Help", displayMode: .inline)
  56. Button { state.isHelpSheetPresented.toggle() }
  57. label: { Text("Got it!").bold().frame(maxWidth: .infinity, minHeight: 30, alignment: .center) }
  58. .buttonStyle(.bordered)
  59. .padding(.top)
  60. }
  61. .padding()
  62. .presentationDetents(
  63. [.fraction(0.9), .large],
  64. selection: helpSheetDetent
  65. )
  66. }
  67. }