@@ -723,17 +723,14 @@ struct CasioWF: View {
723723 case . H24:
724724 return true
725725 default :
726- return true
726+ return false
727727 }
728728 }
729729
730730 var body : some View {
731731 ZStack {
732732 Image ( " casio " )
733733 . scaleEffect ( 0.81 )
734- CustomTextView ( text: String ( Int ( bleManager. batteryLevel) ) , font: . custom( " open_sans_light " , size: geometry. size. width * 0.09 ) , lineSpacing: 0 )
735- . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . topTrailing)
736- . padding ( . trailing, 22 )
737734 CustomTextView (
738735 text: {
739736 let dateFormatter = DateFormatter ( )
@@ -746,7 +743,7 @@ struct CasioWF: View {
746743 font: . custom( " repetitionscrolling " , size: geometry. size. width * 0.16 ) ,
747744 lineSpacing: 0
748745 )
749- . frame ( width: geometry. size. width / 1.04 , height: geometry. size. height / 1.2 , alignment: . topLeading)
746+ . frame ( width: geometry. size. width / 1.04 , height: geometry. size. height / 1.15 , alignment: . topLeading)
750747 CustomTextView (
751748 text: {
752749 let calendar = Calendar . current
@@ -760,10 +757,10 @@ struct CasioWF: View {
760757
761758 return " \( daysIn) - \( daysLeft) "
762759 } ( ) ,
763- font: . custom( " open_sans_light " , size: geometry. size. width * 0.13 ) ,
760+ font: . custom( " 7-Segment " , size: geometry. size. width * 0.16 ) ,
764761 lineSpacing: 0
765762 )
766- . frame ( width: geometry. size. width / 1.04 , height: geometry. size. height / 1.3 , alignment: . topTrailing)
763+ . frame ( width: geometry. size. width / 1.04 , height: geometry. size. height / 1.25 , alignment: . topTrailing)
767764 CustomTextView (
768765 text: {
769766 let calendar = Calendar . current
@@ -772,42 +769,27 @@ struct CasioWF: View {
772769 let month = calendar. component ( . month, from: now)
773770 let day = calendar. component ( . day, from: now)
774771
775- return " \( month) - \( day) "
772+ return " \( month) - \( day) "
776773 } ( ) ,
777- font: . custom( " open_sans_light " , size: geometry. size. width * 0.13 ) ,
774+ font: . custom( " 7-Segment " , size: geometry. size. width * 0.16 ) ,
778775 lineSpacing: 0
779776 )
780777 . frame ( width: geometry. size. width / 1.08 , height: geometry. size. height / 2.25 , alignment: . topTrailing)
781- if Calendar . current. component ( . hour, from: Date ( ) ) >= 12 && !hour24 {
782- CustomTextView ( text: " \( Calendar . current. component ( . hour, from: Date ( ) ) - 12 ) : \( String ( format: " %02d " , Calendar . current. component ( . minute, from: Date ( ) ) ) ) " , font: . custom( " 7-segment " , size: geometry. size. width * 0.36 ) , lineSpacing: 0 )
783- . frame ( maxWidth: . infinity, maxHeight: . infinity, alignment: . trailing)
784- . position ( x: geometry. size. width / 2.0 , y: geometry. size. height / 1.30 )
785- } else {
786- CustomTextView ( text: " \( String ( format: " %02d " , Calendar . current. component ( . hour, from: Date ( ) ) ) ) : \( String ( format: " %02d " , Calendar . current. component ( . minute, from: Date ( ) ) ) ) " , font: . custom( " 7-segment " , size: geometry. size. width * 0.36 ) , lineSpacing: 0 )
787- . frame ( maxWidth: . infinity, maxHeight: . infinity, alignment: . trailing)
788- . position ( x: geometry. size. width / 2.0 , y: geometry. size. height / 1.30 )
789- }
790- HStack ( spacing: 4 ) {
791- Image ( systemName: " heart.fill " )
792- . font ( . system( size: geometry. size. width * 0.08 ) )
793- . foregroundColor ( bleManagerVal. heartBPM != 0 ? colorText : . gray)
794- . opacity ( bleManagerVal. heartBPM != 0 ? 1.0 : 0.5 )
795- if bleManagerVal. heartBPM != 0 {
796- CustomTextView ( text: String ( Int ( bleManagerVal. heartBPM) ) , font: . custom( " open_sans_light " , size: geometry. size. width * 0.11 ) , lineSpacing: 0 )
778+ CustomTextView ( text: {
779+ if hour24 {
780+ return " \( String ( format: " %02d " , Calendar . current. component ( . hour, from: Date ( ) ) ) ) : \( String ( format: " %02d " , Calendar . current. component ( . minute, from: Date ( ) ) ) ) "
781+ } else {
782+ return " \( Calendar . current. component ( . hour, from: Date ( ) ) - 12 ) : \( String ( format: " %02d " , Calendar . current. component ( . minute, from: Date ( ) ) ) ) "
797783 }
784+ } ( ) , font: . custom( " 7-Segment " , size: geometry. size. width * 0.48 ) , lineSpacing: 0 )
785+ . frame ( maxWidth: . infinity, maxHeight: . infinity, alignment: . trailing)
786+ . position ( x: geometry. size. width / 2.0 , y: geometry. size. height / 1.165 )
787+ if !hour24 {
788+ CustomTextView ( text: " \( Calendar . current. component ( . hour, from: Date ( ) ) >= 12 ? " P " : " A " ) " , font: . custom( " JetBrainsMono-Bold " , size: geometry. size. width * 0.08 ) , lineSpacing: 0 )
789+ . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . leading)
790+ . padding ( . leading, 6 )
791+ . padding ( . top, - 5 )
798792 }
799- . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . bottomLeading)
800- . padding ( . leading, 10 )
801- . padding ( . bottom, bleManagerVal. heartBPM != 0 ? 0 : - 4 )
802- HStack ( spacing: 4 ) {
803- Image ( systemName: " shoeprints.fill " )
804- . rotationEffect ( Angle ( degrees: 90 ) )
805- . font ( . system( size: geometry. size. width * 0.08 ) )
806- CustomTextView ( text: " \( bleManagerVal. stepCount) " , font: . custom( " open_sans_light " , size: geometry. size. width * 0.11 ) , lineSpacing: 0 )
807- }
808- . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . bottomTrailing)
809- . padding ( . trailing, 10 )
810- . padding ( . bottom, - 4 )
811793 }
812794 . foregroundColor ( colorText)
813795 . frame ( width: geometry. size. width, height: geometry. size. height, alignment: . center)
@@ -861,7 +843,7 @@ enum InfineatItem {
861843#Preview {
862844 NavigationView {
863845 GeometryReader { geometry in
864- WatchFaceView ( watchface: . constant( 4 ) )
846+ WatchFaceView ( watchface: . constant( 5 ) )
865847 . padding ( 22 )
866848 . frame ( width: geometry. size. width / 1.65 , height: geometry. size. width / 1.65 , alignment: . center)
867849 . clipped ( antialiased: true )
0 commit comments