@@ -397,7 +397,7 @@ struct InfineatWF: View {
397397 func infineatColor( for item: InfineatItem ) -> Color {
398398 switch item {
399399 case . base:
400- switch bleManagerVal. infineatColorIndex {
400+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
401401 case 0 :
402402 return orangeColors [ 2 ]
403403 case 1 :
@@ -413,10 +413,10 @@ struct InfineatWF: View {
413413 case 6 :
414414 return nordGreenColors [ 2 ]
415415 default :
416- break
416+ return orangeColors [ 2 ]
417417 }
418418 case . bottom:
419- switch bleManagerVal. infineatColorIndex {
419+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
420420 case 0 :
421421 return orangeColors [ 1 ]
422422 case 1 :
@@ -432,10 +432,10 @@ struct InfineatWF: View {
432432 case 6 :
433433 return nordGreenColors [ 1 ]
434434 default :
435- break
435+ return orangeColors [ 1 ]
436436 }
437437 case . topTop:
438- switch bleManagerVal. infineatColorIndex {
438+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
439439 case 0 :
440440 return orangeColors [ 4 ]
441441 case 1 :
@@ -451,10 +451,10 @@ struct InfineatWF: View {
451451 case 6 :
452452 return nordGreenColors [ 4 ]
453453 default :
454- break
454+ return orangeColors [ 4 ]
455455 }
456456 case . topBottom:
457- switch bleManagerVal. infineatColorIndex {
457+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
458458 case 0 :
459459 return orangeColors [ 5 ]
460460 case 1 :
@@ -470,10 +470,10 @@ struct InfineatWF: View {
470470 case 6 :
471471 return nordGreenColors [ 5 ]
472472 default :
473- break
473+ return orangeColors [ 5 ]
474474 }
475475 case . midBottom:
476- switch bleManagerVal. infineatColorIndex {
476+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
477477 case 0 :
478478 return orangeColors [ 3 ]
479479 case 1 :
@@ -489,10 +489,10 @@ struct InfineatWF: View {
489489 case 6 :
490490 return nordGreenColors [ 3 ]
491491 default :
492- break
492+ return orangeColors [ 3 ]
493493 }
494494 case . midTop:
495- switch bleManagerVal. infineatColorIndex {
495+ switch bleManagerVal. infineatWatchFace ? . colorIndex {
496496 case 0 :
497497 return orangeColors [ 0 ]
498498 case 1 :
@@ -508,15 +508,15 @@ struct InfineatWF: View {
508508 case 6 :
509509 return nordGreenColors [ 0 ]
510510 default :
511- break
511+ return orangeColors [ 0 ]
512512 }
513513 }
514514 return . clear
515515 }
516516
517517 var body : some View {
518518 ZStack {
519- if hour24 {
519+ if ! hour24 {
520520 CustomTextView ( text: Calendar . current. component ( . hour, from: Date ( ) ) >= 12 ? " PM " : " AM " , font: . custom( " Teko-Light " , size: geometry. size. width * 0.125 ) , lineSpacing: 0 )
521521 . foregroundColor ( . white)
522522 . frame ( width: geometry. size. width, height: geometry. size. height / 1.35 , alignment: . topTrailing)
@@ -565,59 +565,59 @@ struct InfineatWF: View {
565565 . foregroundColor ( . gray)
566566 . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . bottom)
567567 . padding ( . bottom, - 16 )
568- ZStack {
569- Rectangle ( )
570- . frame ( width: 19 )
571- . frame ( height: geometry. size. height / 1.5 , alignment: . topLeading)
572- . frame ( maxHeight: . infinity, alignment: . topLeading)
573- . foregroundColor ( infineatColor ( for: . midTop) )
574- . rotationEffect ( Angle ( degrees: 49 ) )
575- . offset ( x: - 36 , y: - 48 )
576- Rectangle ( )
577- . frame ( width: 19 )
578- . frame ( height: geometry. size. height / 1.5 , alignment: . bottomLeading)
579- . frame ( maxHeight: . infinity, alignment: . bottomLeading)
580- . foregroundColor ( infineatColor ( for: . bottom) )
581- . opacity ( 0.8 )
582- . rotationEffect ( Angle ( degrees: - 22 ) )
583- . offset ( x: - 16 , y: 14 )
584- Rectangle ( )
585- . frame ( width: 26 , alignment: . leading)
586- . offset ( x: - 9 )
587- . foregroundColor ( infineatColor ( for: . base) )
588- Rectangle ( )
589- . frame ( width: 26 )
590- . frame ( height: geometry. size. height / 1.5 , alignment: . topLeading)
591- . frame ( maxHeight: . infinity, alignment: . bottomLeading)
592- . foregroundColor ( infineatColor ( for: . midBottom) )
593- . rotationEffect ( Angle ( degrees: - 42 ) )
594- . offset ( x: - 31 , y: 38 )
595568 ZStack {
596- DiamondShape ( )
597- . fill ( Color . white)
598- . frame ( width: 50 , height: 75 )
599- . offset ( x: - 5 )
569+ if bleManagerVal. infineatWatchFace? . showSideCover ?? true {
570+ Rectangle ( )
571+ . frame ( width: 19 )
572+ . frame ( height: geometry. size. height / 1.5 , alignment: . topLeading)
573+ . frame ( maxHeight: . infinity, alignment: . topLeading)
574+ . foregroundColor ( infineatColor ( for: . midTop) )
575+ . rotationEffect ( Angle ( degrees: 49 ) )
576+ . offset ( x: - 36 , y: - 48 )
577+ Rectangle ( )
578+ . frame ( width: 19 )
579+ . frame ( height: geometry. size. height / 1.5 , alignment: . bottomLeading)
580+ . frame ( maxHeight: . infinity, alignment: . bottomLeading)
581+ . foregroundColor ( infineatColor ( for: . bottom) )
582+ . opacity ( 0.8 )
583+ . rotationEffect ( Angle ( degrees: - 22 ) )
584+ . offset ( x: - 16 , y: 14 )
585+ Rectangle ( )
586+ . frame ( width: 26 , alignment: . leading)
587+ . offset ( x: - 9 )
588+ . foregroundColor ( infineatColor ( for: . base) )
589+ Rectangle ( )
590+ . frame ( width: 26 )
591+ . frame ( height: geometry. size. height / 1.5 , alignment: . topLeading)
592+ . frame ( maxHeight: . infinity, alignment: . bottomLeading)
593+ . foregroundColor ( infineatColor ( for: . midBottom) )
594+ . rotationEffect ( Angle ( degrees: - 42 ) )
595+ . offset ( x: - 31 , y: 38 )
596+ DiamondShape ( )
597+ . fill ( Color . white)
598+ . frame ( width: 50 , height: 75 )
599+ . offset ( x: - 5 )
600+ Rectangle ( )
601+ . frame ( width: 38 )
602+ . frame ( height: geometry. size. height / 1.3 , alignment: . topLeading)
603+ . frame ( maxHeight: . infinity, alignment: . topLeading)
604+ . foregroundColor ( infineatColor ( for: . topTop) )
605+ . rotationEffect ( Angle ( degrees: 18 ) )
606+ . offset ( x: - 32 , y: - 16 )
607+ Rectangle ( )
608+ . frame ( width: 38 )
609+ . frame ( height: geometry. size. height / 1.3 , alignment: . topLeading)
610+ . frame ( maxHeight: . infinity, alignment: . bottomLeading)
611+ . foregroundColor ( infineatColor ( for: . topBottom) )
612+ . rotationEffect ( Angle ( degrees: - 18 ) )
613+ . offset ( x: - 32 , y: 16 )
614+ }
600615 Image ( " pine_logo " )
601616 . resizable ( )
602- . frame ( width: 20 , height: 25 )
617+ . frame ( width: 19 , height: 25 )
603618 . offset ( x: - 1 )
604619 }
605- Rectangle ( )
606- . frame ( width: 38 )
607- . frame ( height: geometry. size. height / 1.3 , alignment: . topLeading)
608- . frame ( maxHeight: . infinity, alignment: . topLeading)
609- . foregroundColor ( infineatColor ( for: . topTop) )
610- . rotationEffect ( Angle ( degrees: 18 ) )
611- . offset ( x: - 32 , y: - 16 )
612- Rectangle ( )
613- . frame ( width: 38 )
614- . frame ( height: geometry. size. height / 1.3 , alignment: . topLeading)
615- . frame ( maxHeight: . infinity, alignment: . bottomLeading)
616- . foregroundColor ( infineatColor ( for: . topBottom) )
617- . rotationEffect ( Angle ( degrees: - 18 ) )
618- . offset ( x: - 32 , y: 16 )
619- }
620- . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . leading)
620+ . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . leading)
621621 }
622622 . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . center)
623623 . clipped ( )
@@ -865,9 +865,6 @@ enum InfineatItem {
865865 . padding ( 22 )
866866 . frame ( width: geometry. size. width / 1.65 , height: geometry. size. width / 1.65 , alignment: . center)
867867 . clipped ( antialiased: true )
868- . onAppear {
869- BLEManagerVal . shared. infineatColorIndex = 1
870- }
871868 }
872869 }
873870}
0 commit comments