Commit 6e0e758e cgx

实现倒计时圆弧进度

1 个父辈 85d6674e
正在显示 36 个修改的文件 包含 1217 行增加75 行删除
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
D0404A2B2870930A0062AD30 /* BeizerView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0404A2A2870930A0062AD30 /* BeizerView.m */; }; D0404A2B2870930A0062AD30 /* BeizerView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0404A2A2870930A0062AD30 /* BeizerView.m */; };
D043A8B3287EB94D00226176 /* sleep_ready_transit.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = D043A8B2287EB94C00226176 /* sleep_ready_transit.mp3 */; }; D043A8B3287EB94D00226176 /* sleep_ready_transit.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = D043A8B2287EB94C00226176 /* sleep_ready_transit.mp3 */; };
D043A8B6287EBA4000226176 /* ReadyItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8B5287EBA4000226176 /* ReadyItemView.m */; }; D043A8B6287EBA4000226176 /* ReadyItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8B5287EBA4000226176 /* ReadyItemView.m */; };
D043A8B9287EBCA200226176 /* ProgressCircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8B8287EBCA200226176 /* ProgressCircleView.m */; };
D043A8BC287EC71400226176 /* RingingTools.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8BB287EC71400226176 /* RingingTools.m */; }; D043A8BC287EC71400226176 /* RingingTools.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8BB287EC71400226176 /* RingingTools.m */; };
D043A8BF287ECB7100226176 /* StartReadyView.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8BE287ECB7100226176 /* StartReadyView.m */; }; D043A8BF287ECB7100226176 /* StartReadyView.m in Sources */ = {isa = PBXBuildFile; fileRef = D043A8BE287ECB7100226176 /* StartReadyView.m */; };
D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; }; D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; };
...@@ -95,6 +94,14 @@ ...@@ -95,6 +94,14 @@
D055BECB28252E4000BC11A4 /* SubAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D055BECA28252E4000BC11A4 /* SubAudioModel.m */; }; D055BECB28252E4000BC11A4 /* SubAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D055BECA28252E4000BC11A4 /* SubAudioModel.m */; };
D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A09D281838B800B4F48A /* FeedbackRequestModel.m */; }; D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A09D281838B800B4F48A /* FeedbackRequestModel.m */; };
D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A0A028183FE000B4F48A /* FeedbackDetailController.m */; }; D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A0A028183FE000B4F48A /* FeedbackDetailController.m */; };
D0691E01287FB330008BFFAB /* XLCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFE287FB330008BFFAB /* XLCircle.m */; };
D0691E02287FB331008BFFAB /* XLCircleProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFF287FB330008BFFAB /* XLCircleProgress.m */; };
D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E04287FEA04008BFFAB /* SleepReadyRequestModel.m */; };
D0691E08287FF56D008BFFAB /* JXMovableCellTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E06287FF56D008BFFAB /* JXMovableCellTableView.m */; };
D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E0A287FFB54008BFFAB /* ReadyItem.m */; };
D0691E0E288009D3008BFFAB /* ReadyItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E0D288009D3008BFFAB /* ReadyItemCell.m */; };
D0691E1128801D43008BFFAB /* RelaxItemsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E1028801D43008BFFAB /* RelaxItemsView.m */; };
D0691E1428801EF3008BFFAB /* ReadyTimeMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E1328801EF3008BFFAB /* ReadyTimeMarker.m */; };
D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */ = {isa = PBXBuildFile; fileRef = D070509928071BAF006D72E1 /* DSNetworkTool.m */; }; D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */ = {isa = PBXBuildFile; fileRef = D070509928071BAF006D72E1 /* DSNetworkTool.m */; };
D07257F0286BE5510080F458 /* GoodSleepHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257EF286BE5510080F458 /* GoodSleepHeadView.m */; }; D07257F0286BE5510080F458 /* GoodSleepHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257EF286BE5510080F458 /* GoodSleepHeadView.m */; };
D07257F3286BF99F0080F458 /* DailyTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F2286BF99F0080F458 /* DailyTaskView.m */; }; D07257F3286BF99F0080F458 /* DailyTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F2286BF99F0080F458 /* DailyTaskView.m */; };
...@@ -364,8 +371,6 @@ ...@@ -364,8 +371,6 @@
D043A8B2287EB94C00226176 /* sleep_ready_transit.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = sleep_ready_transit.mp3; sourceTree = "<group>"; }; D043A8B2287EB94C00226176 /* sleep_ready_transit.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = sleep_ready_transit.mp3; sourceTree = "<group>"; };
D043A8B4287EBA4000226176 /* ReadyItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyItemView.h; sourceTree = "<group>"; }; D043A8B4287EBA4000226176 /* ReadyItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyItemView.h; sourceTree = "<group>"; };
D043A8B5287EBA4000226176 /* ReadyItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyItemView.m; sourceTree = "<group>"; }; D043A8B5287EBA4000226176 /* ReadyItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyItemView.m; sourceTree = "<group>"; };
D043A8B7287EBCA200226176 /* ProgressCircleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProgressCircleView.h; sourceTree = "<group>"; };
D043A8B8287EBCA200226176 /* ProgressCircleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProgressCircleView.m; sourceTree = "<group>"; };
D043A8BA287EC71400226176 /* RingingTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RingingTools.h; sourceTree = "<group>"; }; D043A8BA287EC71400226176 /* RingingTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RingingTools.h; sourceTree = "<group>"; };
D043A8BB287EC71400226176 /* RingingTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RingingTools.m; sourceTree = "<group>"; }; D043A8BB287EC71400226176 /* RingingTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RingingTools.m; sourceTree = "<group>"; };
D043A8BD287ECB7100226176 /* StartReadyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StartReadyView.h; sourceTree = "<group>"; }; D043A8BD287ECB7100226176 /* StartReadyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StartReadyView.h; sourceTree = "<group>"; };
...@@ -431,6 +436,22 @@ ...@@ -431,6 +436,22 @@
D062A09D281838B800B4F48A /* FeedbackRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackRequestModel.m; sourceTree = "<group>"; }; D062A09D281838B800B4F48A /* FeedbackRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackRequestModel.m; sourceTree = "<group>"; };
D062A09F28183FE000B4F48A /* FeedbackDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackDetailController.h; sourceTree = "<group>"; }; D062A09F28183FE000B4F48A /* FeedbackDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackDetailController.h; sourceTree = "<group>"; };
D062A0A028183FE000B4F48A /* FeedbackDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackDetailController.m; sourceTree = "<group>"; }; D062A0A028183FE000B4F48A /* FeedbackDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackDetailController.m; sourceTree = "<group>"; };
D0691DFD287FB330008BFFAB /* XLCircleProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLCircleProgress.h; sourceTree = "<group>"; };
D0691DFE287FB330008BFFAB /* XLCircle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircle.m; sourceTree = "<group>"; };
D0691DFF287FB330008BFFAB /* XLCircleProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircleProgress.m; sourceTree = "<group>"; };
D0691E00287FB330008BFFAB /* XLCircle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLCircle.h; sourceTree = "<group>"; };
D0691E03287FEA04008BFFAB /* SleepReadyRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SleepReadyRequestModel.h; sourceTree = "<group>"; };
D0691E04287FEA04008BFFAB /* SleepReadyRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SleepReadyRequestModel.m; sourceTree = "<group>"; };
D0691E06287FF56D008BFFAB /* JXMovableCellTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXMovableCellTableView.m; sourceTree = "<group>"; };
D0691E07287FF56D008BFFAB /* JXMovableCellTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXMovableCellTableView.h; sourceTree = "<group>"; };
D0691E09287FFB54008BFFAB /* ReadyItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyItem.h; sourceTree = "<group>"; };
D0691E0A287FFB54008BFFAB /* ReadyItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyItem.m; sourceTree = "<group>"; };
D0691E0C288009D3008BFFAB /* ReadyItemCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyItemCell.h; sourceTree = "<group>"; };
D0691E0D288009D3008BFFAB /* ReadyItemCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyItemCell.m; sourceTree = "<group>"; };
D0691E0F28801D43008BFFAB /* RelaxItemsView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RelaxItemsView.h; sourceTree = "<group>"; };
D0691E1028801D43008BFFAB /* RelaxItemsView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RelaxItemsView.m; sourceTree = "<group>"; };
D0691E1228801EF3008BFFAB /* ReadyTimeMarker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadyTimeMarker.h; sourceTree = "<group>"; };
D0691E1328801EF3008BFFAB /* ReadyTimeMarker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadyTimeMarker.m; sourceTree = "<group>"; };
D070509828071BAF006D72E1 /* DSNetworkTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSNetworkTool.h; sourceTree = "<group>"; }; D070509828071BAF006D72E1 /* DSNetworkTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSNetworkTool.h; sourceTree = "<group>"; };
D070509928071BAF006D72E1 /* DSNetworkTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkTool.m; sourceTree = "<group>"; }; D070509928071BAF006D72E1 /* DSNetworkTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkTool.m; sourceTree = "<group>"; };
D07257EE286BE5510080F458 /* GoodSleepHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoodSleepHeadView.h; sourceTree = "<group>"; }; D07257EE286BE5510080F458 /* GoodSleepHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoodSleepHeadView.h; sourceTree = "<group>"; };
...@@ -1036,6 +1057,16 @@ ...@@ -1036,6 +1057,16 @@
D02D0826287BBEDE005C3A00 /* SleepReadyController.m */, D02D0826287BBEDE005C3A00 /* SleepReadyController.m */,
D02D082B287BD05D005C3A00 /* ReadyListController.h */, D02D082B287BD05D005C3A00 /* ReadyListController.h */,
D02D082C287BD05D005C3A00 /* ReadyListController.m */, D02D082C287BD05D005C3A00 /* ReadyListController.m */,
D0691E09287FFB54008BFFAB /* ReadyItem.h */,
D0691E0A287FFB54008BFFAB /* ReadyItem.m */,
D0691E0C288009D3008BFFAB /* ReadyItemCell.h */,
D0691E0D288009D3008BFFAB /* ReadyItemCell.m */,
D0691E1228801EF3008BFFAB /* ReadyTimeMarker.h */,
D0691E1328801EF3008BFFAB /* ReadyTimeMarker.m */,
D0691E0F28801D43008BFFAB /* RelaxItemsView.h */,
D0691E1028801D43008BFFAB /* RelaxItemsView.m */,
D0691E07287FF56D008BFFAB /* JXMovableCellTableView.h */,
D0691E06287FF56D008BFFAB /* JXMovableCellTableView.m */,
D02D0828287BCEF3005C3A00 /* SRTipsView.h */, D02D0828287BCEF3005C3A00 /* SRTipsView.h */,
D02D0829287BCEF3005C3A00 /* SRTipsView.m */, D02D0829287BCEF3005C3A00 /* SRTipsView.m */,
D024CE87287D59FF00FB4320 /* SRMusicView.h */, D024CE87287D59FF00FB4320 /* SRMusicView.h */,
...@@ -1044,8 +1075,12 @@ ...@@ -1044,8 +1075,12 @@
D043A8BE287ECB7100226176 /* StartReadyView.m */, D043A8BE287ECB7100226176 /* StartReadyView.m */,
D043A8B4287EBA4000226176 /* ReadyItemView.h */, D043A8B4287EBA4000226176 /* ReadyItemView.h */,
D043A8B5287EBA4000226176 /* ReadyItemView.m */, D043A8B5287EBA4000226176 /* ReadyItemView.m */,
D043A8B7287EBCA200226176 /* ProgressCircleView.h */, D0691E00287FB330008BFFAB /* XLCircle.h */,
D043A8B8287EBCA200226176 /* ProgressCircleView.m */, D0691DFE287FB330008BFFAB /* XLCircle.m */,
D0691DFD287FB330008BFFAB /* XLCircleProgress.h */,
D0691DFF287FB330008BFFAB /* XLCircleProgress.m */,
D0691E03287FEA04008BFFAB /* SleepReadyRequestModel.h */,
D0691E04287FEA04008BFFAB /* SleepReadyRequestModel.m */,
); );
path = SleepReady; path = SleepReady;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2159,6 +2194,7 @@ ...@@ -2159,6 +2194,7 @@
D0D00199282C9402004EAFA1 /* NoiseView.m in Sources */, D0D00199282C9402004EAFA1 /* NoiseView.m in Sources */,
D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */, D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */,
D0FAC429281B865300D4B859 /* GKYYWebImageManager.m in Sources */, D0FAC429281B865300D4B859 /* GKYYWebImageManager.m in Sources */,
D0691E1428801EF3008BFFAB /* ReadyTimeMarker.m in Sources */,
D0BB9AA4281626F200DB209E /* ExceptionDefaultView.m in Sources */, D0BB9AA4281626F200DB209E /* ExceptionDefaultView.m in Sources */,
D0FAC420281B817D00D4B859 /* GKPhotoBrowserConfigure.m in Sources */, D0FAC420281B817D00D4B859 /* GKPhotoBrowserConfigure.m in Sources */,
D0B5ECD827F2F1B0003EDFE3 /* ServerAPIUtil.m in Sources */, D0B5ECD827F2F1B0003EDFE3 /* ServerAPIUtil.m in Sources */,
...@@ -2182,11 +2218,13 @@ ...@@ -2182,11 +2218,13 @@
D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */, D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */,
D0D96FE22848493700461839 /* RelaxTrainModel.m in Sources */, D0D96FE22848493700461839 /* RelaxTrainModel.m in Sources */,
D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */, D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */,
D0691E1128801D43008BFFAB /* RelaxItemsView.m in Sources */,
D0BE53742845B27E007F15B3 /* DailyTaskModel.m in Sources */, D0BE53742845B27E007F15B3 /* DailyTaskModel.m in Sources */,
D07DACA62810557D0067A1BF /* RSKTouchView.m in Sources */, D07DACA62810557D0067A1BF /* RSKTouchView.m in Sources */,
D013CD402858373E00F920B4 /* DataStatisticsUtil.m in Sources */, D013CD402858373E00F920B4 /* DataStatisticsUtil.m in Sources */,
D0BE536E2845A7AF007F15B3 /* SignModel.m in Sources */, D0BE536E2845A7AF007F15B3 /* SignModel.m in Sources */,
D0D69ED628236E0800A0D5EB /* SafeSleepListController.m in Sources */, D0D69ED628236E0800A0D5EB /* SafeSleepListController.m in Sources */,
D0691E0E288009D3008BFFAB /* ReadyItemCell.m in Sources */,
D09D0E9A280D507F008DEDAB /* ProfileAlertView.m in Sources */, D09D0E9A280D507F008DEDAB /* ProfileAlertView.m in Sources */,
D0FAC41F281B817D00D4B859 /* UIScrollView+GKPhotoBrowser.m in Sources */, D0FAC41F281B817D00D4B859 /* UIScrollView+GKPhotoBrowser.m in Sources */,
D055BEC2282526B700BC11A4 /* CourseDetailController.m in Sources */, D055BEC2282526B700BC11A4 /* CourseDetailController.m in Sources */,
...@@ -2247,6 +2285,7 @@ ...@@ -2247,6 +2285,7 @@
D037B1172875635F00236753 /* DarwArcView.swift in Sources */, D037B1172875635F00236753 /* DarwArcView.swift in Sources */,
D08F79E0281A1838000D99DD /* TZImagePickerController.m in Sources */, D08F79E0281A1838000D99DD /* TZImagePickerController.m in Sources */,
D091E671283F2E6F00D3279E /* ScoreDetailListController.m in Sources */, D091E671283F2E6F00D3279E /* ScoreDetailListController.m in Sources */,
D0691E08287FF56D008BFFAB /* JXMovableCellTableView.m in Sources */,
D07DACAB2810557D0067A1BF /* RSKImageScrollView.m in Sources */, D07DACAB2810557D0067A1BF /* RSKImageScrollView.m in Sources */,
D0AEFE812817DD1500230DC6 /* MyFeedCell.m in Sources */, D0AEFE812817DD1500230DC6 /* MyFeedCell.m in Sources */,
D02D082D287BD05D005C3A00 /* ReadyListController.m in Sources */, D02D082D287BD05D005C3A00 /* ReadyListController.m in Sources */,
...@@ -2275,6 +2314,7 @@ ...@@ -2275,6 +2314,7 @@
D049886E286E9209000ACF55 /* TaskTimerTool.m in Sources */, D049886E286E9209000ACF55 /* TaskTimerTool.m in Sources */,
D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */, D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */,
D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */, D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */,
D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */,
D01814EB28002A8200583D4E /* DsMiddleView.m in Sources */, D01814EB28002A8200583D4E /* DsMiddleView.m in Sources */,
D0C50B4227FD39C800DC68F0 /* UIViewController+FullScreenModal.m in Sources */, D0C50B4227FD39C800DC68F0 /* UIViewController+FullScreenModal.m in Sources */,
D09BF337280E605900E5F06C /* NSObject+Extras.m in Sources */, D09BF337280E605900E5F06C /* NSObject+Extras.m in Sources */,
...@@ -2293,7 +2333,6 @@ ...@@ -2293,7 +2333,6 @@
D00A63572824C42300AFFEAA /* DSNetworkCache.m in Sources */, D00A63572824C42300AFFEAA /* DSNetworkCache.m in Sources */,
D0A72E42282B8BA600EED7BE /* CourseMusicCell.m in Sources */, D0A72E42282B8BA600EED7BE /* CourseMusicCell.m in Sources */,
D0A72E39282B566200EED7BE /* HomeBasicCell.m in Sources */, D0A72E39282B566200EED7BE /* HomeBasicCell.m in Sources */,
D043A8B9287EBCA200226176 /* ProgressCircleView.m in Sources */,
D091E665283F0C4800D3279E /* ScoreTaskRequestModel.m in Sources */, D091E665283F0C4800D3279E /* ScoreTaskRequestModel.m in Sources */,
D08F79DA281A1838000D99DD /* TZPhotoPreviewController.m in Sources */, D08F79DA281A1838000D99DD /* TZPhotoPreviewController.m in Sources */,
D01BD42B282C03FC00BA86B3 /* NoiseAudioModel.m in Sources */, D01BD42B282C03FC00BA86B3 /* NoiseAudioModel.m in Sources */,
...@@ -2314,6 +2353,7 @@ ...@@ -2314,6 +2353,7 @@
D0C50B3C27FD2EFD00DC68F0 /* PrivacyViewController.m in Sources */, D0C50B3C27FD2EFD00DC68F0 /* PrivacyViewController.m in Sources */,
D0AE1E3528281B6F008CEF27 /* TimerProxy.m in Sources */, D0AE1E3528281B6F008CEF27 /* TimerProxy.m in Sources */,
D0498874286E95F2000ACF55 /* DsTaskManager.m in Sources */, D0498874286E95F2000ACF55 /* DsTaskManager.m in Sources */,
D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */,
D0FAC41D281B817D00D4B859 /* GKPhotoBrowser.m in Sources */, D0FAC41D281B817D00D4B859 /* GKPhotoBrowser.m in Sources */,
D024CE89287D59FF00FB4320 /* SRMusicView.m in Sources */, D024CE89287D59FF00FB4320 /* SRMusicView.m in Sources */,
D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */, D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */,
...@@ -2330,6 +2370,7 @@ ...@@ -2330,6 +2370,7 @@
D091E677283F614900D3279E /* ScoreDetailCell.m in Sources */, D091E677283F614900D3279E /* ScoreDetailCell.m in Sources */,
D08F79DF281A1838000D99DD /* TZPhotoPreviewCell.m in Sources */, D08F79DF281A1838000D99DD /* TZPhotoPreviewCell.m in Sources */,
D0F808FE280421C20097899F /* UnityGameController.m in Sources */, D0F808FE280421C20097899F /* UnityGameController.m in Sources */,
D0691E02287FB331008BFFAB /* XLCircleProgress.m in Sources */,
D07A4B27280E9BAA00BA0EC0 /* AccountController.m in Sources */, D07A4B27280E9BAA00BA0EC0 /* AccountController.m in Sources */,
D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */, D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */,
D08F79D5281A1838000D99DD /* TZAssetCell.m in Sources */, D08F79D5281A1838000D99DD /* TZAssetCell.m in Sources */,
...@@ -2348,6 +2389,7 @@ ...@@ -2348,6 +2389,7 @@
D091E668283F0E8800D3279E /* MyPointController.m in Sources */, D091E668283F0E8800D3279E /* MyPointController.m in Sources */,
D08F79D7281A1838000D99DD /* TZAssetModel.m in Sources */, D08F79D7281A1838000D99DD /* TZAssetModel.m in Sources */,
D01C9D6F28168BFC00163567 /* WSDatePickerView.m in Sources */, D01C9D6F28168BFC00163567 /* WSDatePickerView.m in Sources */,
D0691E01287FB330008BFFAB /* XLCircle.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
//
// JXMovableCellTableView.h
// JXMovableCellTableView
//
// Created by jiaxin on 16/2/15.
// Copyright © 2016年 jiaxin. All rights reserved.
//
#import <UIKit/UIKit.h>
@class JXMovableCellTableView;
@protocol JXMovableCellTableViewDataSource <UITableViewDataSource>
@required
/**
* 获取tableView的数据源数组
*/
- (NSArray *)dataSourceArrayInTableView:(JXMovableCellTableView *)tableView;
/**
* 返回移动之后调换后的数据源
*/
- (void)tableView:(JXMovableCellTableView *)tableView newDataSourceArrayAfterMove:(NSArray *)newDataSourceArray;
@end
@protocol JXMovableCellTableViewDelegate <UITableViewDelegate>
@optional
/**
* 将要开始移动indexPath位置的cell
*/
- (void)tableView:(JXMovableCellTableView *)tableView willMoveCellAtIndexPath:(NSIndexPath *)indexPath;
/**
* 完成一次从fromIndexPath cell到toIndexPath cell的移动
*/
- (void)tableView:(JXMovableCellTableView *)tableView didMoveCellFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath;
/**
* 结束移动cell在indexPath
*/
- (void)tableView:(JXMovableCellTableView *)tableView endMoveCellAtIndexPath:(NSIndexPath *)indexPath;
@end
@interface JXMovableCellTableView : UITableView
@property (nonatomic, weak) id<JXMovableCellTableViewDataSource> dataSource;
@property (nonatomic, weak) id<JXMovableCellTableViewDelegate> delegate;
/**
* 长按手势最小触发时间,默认1.0,最小0.2
*/
@property (nonatomic, assign) CGFloat gestureMinimumPressDuration;
/**
* 自定义可移动cell的截图样式
*/
@property (nonatomic, copy) void(^drawMovalbeCellBlock)(UIView *movableCell);
/**
* 是否允许拖动到屏幕边缘后,开启边缘滚动,默认YES
*/
@property (nonatomic, assign) BOOL canEdgeScroll;
/**
* 边缘滚动触发范围,默认150,越靠近边缘速度越快
*/
@property (nonatomic, assign) CGFloat edgeScrollRange;
@end
//
// JXMovableCellTableView.m
// JXMovableCellTableView
//
// Created by jiaxin on 16/2/15.
// Copyright © 2016年 jiaxin. All rights reserved.
//
#import "JXMovableCellTableView.h"
static NSTimeInterval kJXMovableCellAnimationTime = 0.25;
@interface JXMovableCellTableView ()
@property (nonatomic, strong) UILongPressGestureRecognizer *gesture;
@property (nonatomic, strong) NSIndexPath *selectedIndexPath;
@property (nonatomic, strong) UIView *tempView;
@property (nonatomic, strong) NSMutableArray *tempDataSource;
@property (nonatomic, strong) CADisplayLink *edgeScrollTimer;
@end
@implementation JXMovableCellTableView
@dynamic dataSource, delegate;
- (void)dealloc {
_drawMovalbeCellBlock = nil;
}
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
self = [super initWithFrame:frame style:style];
if (self) {
[self jx_initData];
[self jx_addGesture];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self jx_initData];
[self jx_addGesture];
}
return self;
}
- (void)jx_initData {
_gestureMinimumPressDuration = 1.f;
_canEdgeScroll = YES;
_edgeScrollRange = 150.f;
}
#pragma mark - Setter
- (void)setGestureMinimumPressDuration:(CGFloat)gestureMinimumPressDuration {
_gestureMinimumPressDuration = gestureMinimumPressDuration;
_gesture.minimumPressDuration = MAX(.3, .3);
}
#pragma mark - Gesture
- (void)jx_addGesture {
_gesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(jx_processGesture:)];
_gesture.minimumPressDuration = _gestureMinimumPressDuration;
[self addGestureRecognizer:_gesture];
}
- (void)jx_processGesture:(UILongPressGestureRecognizer *)gesture {
if (self.visibleCells.count <= 1 ) return;
switch (gesture.state) {
case UIGestureRecognizerStateBegan: {
[self jx_gestureBegan:gesture];
}
break;
case UIGestureRecognizerStateChanged: {
if (!_canEdgeScroll) {
[self jx_gestureChanged:gesture];
}
}
break;
case UIGestureRecognizerStateEnded:
case UIGestureRecognizerStateCancelled: {
[self jx_gestureEndedOrCancelled:gesture];
}
break;
default:
break;
}
}
- (void)jx_gestureBegan:(UILongPressGestureRecognizer *)gesture {
CGPoint point = [gesture locationInView:gesture.view];
NSIndexPath *selectedIndexPath = [self indexPathForRowAtPoint:point];
if (!selectedIndexPath) {
if (self.dataSource && [self.dataSource respondsToSelector:@selector(dataSourceArrayInTableView:)]) {
_tempDataSource = [self.dataSource dataSourceArrayInTableView:self].mutableCopy;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(tableView:endMoveCellAtIndexPath:)]) {
[self.delegate tableView:self endMoveCellAtIndexPath:_selectedIndexPath];
}
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(tableView:willMoveCellAtIndexPath:)]) {
[self.delegate tableView:self willMoveCellAtIndexPath:selectedIndexPath];
}
if (_canEdgeScroll) {
// 开启边缘滚动
[self jx_startEdgeScroll];
}
// 每次移动开始获取一次数据源
if (self.dataSource && [self.dataSource respondsToSelector:@selector(dataSourceArrayInTableView:)]) {
_tempDataSource = [self.dataSource dataSourceArrayInTableView:self].mutableCopy;
}
_selectedIndexPath = selectedIndexPath;
UITableViewCell *cell = [self cellForRowAtIndexPath:selectedIndexPath];
_tempView = [self jx_snapshotViewWithInputView:cell];
if (_drawMovalbeCellBlock) {
// 将_tempView通过block让使用者自定义
_drawMovalbeCellBlock(_tempView);
} else {
//配置默认样式
_tempView.layer.shadowColor = [UIColor grayColor].CGColor;
_tempView.layer.masksToBounds = NO;
_tempView.layer.cornerRadius = 0;
_tempView.layer.shadowOffset = CGSizeMake(-5, 0);
_tempView.layer.shadowOpacity = 0.4;
_tempView.layer.shadowRadius = 5;
}
_tempView.frame = cell.frame;
[self addSubview:_tempView];
// 隐藏cell
cell.hidden = YES;
[UIView animateWithDuration:kJXMovableCellAnimationTime animations:^{
_tempView.center = CGPointMake(_tempView.center.x, point.y);
}];
}
- (void)jx_gestureChanged:(UILongPressGestureRecognizer *)gesture {
CGPoint point = [gesture locationInView:gesture.view];
NSIndexPath *currentIndexPath = [self indexPathForRowAtPoint:point];
if (currentIndexPath && ![_selectedIndexPath isEqual:currentIndexPath]) {
// 交换数据源和cell
[self jx_updateDataSourceAndCellFromIndexPath:_selectedIndexPath toIndexPath:currentIndexPath];
if (self.delegate && [self.delegate respondsToSelector:@selector(tableView:didMoveCellFromIndexPath:toIndexPath:)]) {
[self.delegate tableView:self didMoveCellFromIndexPath:_selectedIndexPath toIndexPath:currentIndexPath];
}
_selectedIndexPath = currentIndexPath;
}
// 让截图跟随手势
_tempView.center = CGPointMake(_tempView.center.x, point.y);
}
- (void)jx_gestureEndedOrCancelled:(UILongPressGestureRecognizer *)gesture {
if (_canEdgeScroll) {
[self jx_stopEdgeScroll];
}
// 返回交换后的数据源
if (self.dataSource && [self.dataSource respondsToSelector:@selector(tableView:newDataSourceArrayAfterMove:)]) {
[self.dataSource tableView:self newDataSourceArrayAfterMove:_tempDataSource.copy];
}
if (self.delegate && [self.delegate respondsToSelector:@selector(tableView:endMoveCellAtIndexPath:)]) {
[self.delegate tableView:self endMoveCellAtIndexPath:_selectedIndexPath];
}
UITableViewCell *cell = [self cellForRowAtIndexPath:_selectedIndexPath];
[UIView animateWithDuration:kJXMovableCellAnimationTime animations:^{
_tempView.frame = cell.frame;
} completion:^(BOOL finished) {
cell.hidden = NO;
[_tempView removeFromSuperview];
_tempView = nil;
}];
}
#pragma mark Private - action
- (UIView *)jx_snapshotViewWithInputView:(UIView *)inputView {
UIGraphicsBeginImageContextWithOptions(inputView.bounds.size, NO, 0);
[inputView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIView *snapshot = [[UIImageView alloc] initWithImage:image];
return snapshot;
}
- (void)jx_updateDataSourceAndCellFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
if ([self numberOfSections] == 1) {
// 只有一组
[_tempDataSource exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];
// 交换cell
[self moveRowAtIndexPath:fromIndexPath toIndexPath:toIndexPath];
} else {
// 有多组
id fromData = _tempDataSource[fromIndexPath.section][fromIndexPath.row];
id toData = _tempDataSource[toIndexPath.section][toIndexPath.row];
NSMutableArray *fromArray = [_tempDataSource[fromIndexPath.section] mutableCopy];
NSMutableArray *toArray = [_tempDataSource[toIndexPath.section] mutableCopy];
[fromArray replaceObjectAtIndex:fromIndexPath.row withObject:toData];
[toArray replaceObjectAtIndex:toIndexPath.row withObject:fromData];
[_tempDataSource replaceObjectAtIndex:fromIndexPath.section withObject:fromArray];
[_tempDataSource replaceObjectAtIndex:toIndexPath.section withObject:toArray];
// 交换cell
[self beginUpdates];
[self moveRowAtIndexPath:fromIndexPath toIndexPath:toIndexPath];
[self moveRowAtIndexPath:toIndexPath toIndexPath:fromIndexPath];
[self endUpdates];
}
}
#pragma mark - EdgeScroll
- (void)jx_startEdgeScroll {
_edgeScrollTimer = [CADisplayLink displayLinkWithTarget:self selector:@selector(jx_processEdgeScroll)];
[_edgeScrollTimer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
}
- (void)jx_processEdgeScroll {
[self jx_gestureChanged:_gesture];
CGFloat minOffsetY = self.contentOffset.y + _edgeScrollRange;
CGFloat maxOffsetY = self.contentOffset.y + self.bounds.size.height - _edgeScrollRange;
CGPoint touchPoint = _tempView.center;
// 处理上下达到极限之后不再滚动tableView,其中处理了滚动到最边缘的时候,当前处于edgeScrollRange内,但是tableView还未显示完,需要显示完tableView才停止滚动
if (touchPoint.y < _edgeScrollRange) {
if (self.contentOffset.y <= 0) {
return;
}else {
if (self.contentOffset.y - 1 < 0) {
return;
}
[self setContentOffset:CGPointMake(self.contentOffset.x, self.contentOffset.y - 1) animated:NO];
_tempView.center = CGPointMake(_tempView.center.x, _tempView.center.y - 1);
}
}
if (touchPoint.y > self.contentSize.height - _edgeScrollRange) {
if (self.contentOffset.y >= self.contentSize.height - self.bounds.size.height) {
return;
}else {
if (self.contentOffset.y + 1 > self.contentSize.height - self.bounds.size.height) {
return;
}
[self setContentOffset:CGPointMake(self.contentOffset.x, self.contentOffset.y + 1) animated:NO];
_tempView.center = CGPointMake(_tempView.center.x, _tempView.center.y + 1);
}
}
// 处理滚动
CGFloat maxMoveDistance = 20;
if (touchPoint.y < minOffsetY) {
// cell在往上移动
CGFloat moveDistance = (minOffsetY - touchPoint.y)/_edgeScrollRange*maxMoveDistance;
[self setContentOffset:CGPointMake(self.contentOffset.x, self.contentOffset.y - moveDistance) animated:NO];
_tempView.center = CGPointMake(_tempView.center.x, _tempView.center.y - moveDistance);
} else if (touchPoint.y > maxOffsetY) {
//cell在往下移动
CGFloat moveDistance = (touchPoint.y - maxOffsetY)/_edgeScrollRange*maxMoveDistance;
[self setContentOffset:CGPointMake(self.contentOffset.x, self.contentOffset.y + moveDistance) animated:NO];
_tempView.center = CGPointMake(_tempView.center.x, _tempView.center.y + moveDistance);
}
}
- (void)jx_stopEdgeScroll {
if (_edgeScrollTimer) {
[_edgeScrollTimer invalidate];
_edgeScrollTimer = nil;
}
}
@end
//
// ProgressCircleView.m
// DreamSleep
//
// Created by peter on 2022/7/13.
//
#import "ProgressCircleView.h"
@interface ProgressCircleView ()
@property (nonatomic, strong) UIImageView *dialplateIV;
@end
@implementation ProgressCircleView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self debugViewShowBorder];
self.backgroundColor = DSClearColor;
[self addSubview:self.dialplateIV];
[self.dialplateIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.height.equalTo(@170);
}];
}
return self;
}
- (void)drawRect:(CGRect)rect {
CGFloat radius = rect.size.height / 2.0;
UIBezierPath *path = [UIBezierPath bezierPath];
path.lineWidth = 2.0;
UIColor *strokeColor = [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? ColorFromHex(0xEEEEEE) : ColorFromHex(0x232A40);
[strokeColor setStroke];
[path addArcWithCenter:CGPointMake(radius, radius) radius:radius startAngle:0 endAngle:2*M_PI clockwise:YES];
[path stroke];
}
#pragma mark - lazy
- (UIImageView *)dialplateIV {
if (!_dialplateIV) {
_dialplateIV = [UIImageView new];
[_dialplateIV dk_setImagePicker:DKImagePickerWithNames(@"pic_zhunbei_biaopan", @"dk_pic_zhunbei_biaopan", @"pic_zhunbei_biaopan")];
}
return _dialplateIV;
}
@end
//
// ReadyItem.h
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 睡前安排列表数据项
@interface ReadyItem : NSObject
/// 选项id
@property (nonatomic, assign) int item_id;
/// 白天背景
@property (nonatomic, copy) NSString *bg_day;
/// 晚上背景
@property (nonatomic, copy) NSString *bg_night;
/// 名称
@property (nonatomic, copy) NSString *item_name;
/// 时长(分钟)
@property (nonatomic, assign) int time;
/// 优选标记
@property (nonatomic, copy) NSString *flag_tips;
/// 选项描述
@property (nonatomic, copy) NSString *desc;
/// 选项图标
@property (nonatomic, copy) NSString *icon;
@end
NS_ASSUME_NONNULL_END
//
// ReadyItem.m
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "ReadyItem.h"
@implementation ReadyItem
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
return @{@"desc" : @"description"};
}
@end
//
// ReadyItemCell.h
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import <UIKit/UIKit.h>
#import "ReadyItem.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, ItemCellType) {
ItemCellTypeStart, // 开始仪式itemcell
ItemCellTypeAdjust, // 设置睡前准备itemcell
};
/// 睡前安排列表顶部勾选任务cell
@interface ReadyItemCell : UIView
@property (nonatomic, strong) ReadyItem *item;
- (instancetype)initWithFrame:(CGRect)frame itemCellType:(ItemCellType)type;
@end
NS_ASSUME_NONNULL_END
//
// ReadyItemCell.m
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "ReadyItemCell.h"
@interface ReadyItemCell ()
@property (nonatomic, strong) UIImageView *icon;
@property (nonatomic, strong) UILabel *timeLab;
@property (nonatomic, strong) UILabel *nameLab;
@end
@implementation ReadyItemCell
- (instancetype)initWithFrame:(CGRect)frame itemCellType:(ItemCellType)type {
if (self = [super initWithFrame:frame]) {
[self addSubview:self.icon];
[self addSubview:self.timeLab];
if (type == ItemCellTypeStart) {
[self addSubview:self.nameLab];
}
[self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.width.height.equalTo(@40);
}];
[self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.left.right.equalTo(self);
}];
}
return self;
}
- (void)setItem:(ReadyItem *)item {
_item = item;
[self.icon yy_setImageWithURL:[NSURL URLWithString:item.icon] options:YYWebImageOptionShowNetworkActivity];
self.timeLab.text = [NSString stringWithFormat:@"%dmin", item.time];
}
#pragma mark - lazy
- (UIImageView *)icon {
if (!_icon) {
_icon = [UIImageView new];
}
return _icon;
}
- (UILabel *)timeLab {
if (!_timeLab) {
_timeLab = [UILabel labWithFont:SysFont(12.0)];
_timeLab.textAlignment = NSTextAlignmentCenter;
_timeLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, ColorFromHexA(0xFFFFFF, .3));
}
return _timeLab;
}
@end
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
// //
#import "ReadyItemView.h" #import "ReadyItemView.h"
#import "ProgressCircleView.h" #import "XLCircleProgress.h"
#import "RingingTools.h" #import "RingingTools.h"
@interface ReadyItemView () @interface ReadyItemView ()
@property (nonatomic, strong) ProgressCircleView *progressCircleView; @property (nonatomic, strong) XLCircleProgress *circleProgress;
@property (nonatomic, strong) UIImageView *bgIV; @property (nonatomic, strong) UIImageView *bgIV;
@property (nonatomic, strong) UIButton *enterBtn; @property (nonatomic, strong) UIButton *enterBtn;
@end @end
...@@ -22,18 +22,13 @@ ...@@ -22,18 +22,13 @@
self.hidden = YES; self.hidden = YES;
[self addSubview:self.bgIV]; [self addSubview:self.bgIV];
[self addSubview:self.progressCircleView]; [self addSubview:self.circleProgress];
[self addSubview:self.enterBtn]; [self addSubview:self.enterBtn];
[self.bgIV mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self); make.left.right.equalTo(self);
make.bottom.equalTo(self).offset(-34); make.bottom.equalTo(self).offset(-34);
}]; }];
[self.progressCircleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.width.height.equalTo(@200);
make.top.equalTo(self).offset(158);
}];
[self.enterBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.enterBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(155, 40)); make.size.mas_equalTo(CGSizeMake(155, 40));
make.centerX.equalTo(self); make.centerX.equalTo(self);
...@@ -46,14 +41,16 @@ ...@@ -46,14 +41,16 @@
- (void)start { - (void)start {
self.hidden = NO; self.hidden = NO;
[RingingTools playRingingWithName:@"sleep_ready_transit"]; [RingingTools playRingingWithName:@"sleep_ready_transit"];
[self.circleProgress fire];
} }
#pragma mark - lazy #pragma mark - lazy
- (ProgressCircleView *)progressCircleView { - (XLCircleProgress *)circleProgress {
if (!_progressCircleView) { if (!_circleProgress) {
_progressCircleView = [ProgressCircleView new]; _circleProgress = [[XLCircleProgress alloc] initWithFrame:CGRectMake(0, 158, 200, 200)];
_circleProgress.centerX = self.centerX;
} }
return _progressCircleView; return _circleProgress;
} }
- (UIImageView *)bgIV { - (UIImageView *)bgIV {
......
...@@ -6,9 +6,15 @@ ...@@ -6,9 +6,15 @@
// //
#import "ReadyListController.h" #import "ReadyListController.h"
#import "JXMovableCellTableView.h"
#import "SleepReadyRequestModel.h"
#import "RelaxItemsView.h"
@interface ReadyListController () @interface ReadyListController () <JXMovableCellTableViewDataSource, JXMovableCellTableViewDelegate>
@property (nonatomic, strong) RelaxItemsView *relaxItemsView;
@property (nonatomic, strong) JXMovableCellTableView *prepareItemsView;
@property (nonatomic, strong) NSArray *relax_items;
@property (nonatomic, strong) NSArray *prepare_items;
@end @end
@implementation ReadyListController @implementation ReadyListController
...@@ -25,12 +31,31 @@ ...@@ -25,12 +31,31 @@
self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG); self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.naviTitle = @"设置睡前准备"; self.naviTitle = @"设置睡前安排";
self.naviBarAlpha = 1.0; self.naviBarAlpha = 1.0;
self.dsNaviBar.dk_backgroundColorPicker = DKColorPickerWithColors(BrandColor, SubNaviDarkColor, BrandColor); self.dsNaviBar.dk_backgroundColorPicker = DKColorPickerWithColors(BrandColor, SubNaviDarkColor, BrandColor);
[self.dsNaviBar addSubview:self.backBtn]; [self.dsNaviBar addSubview:self.backBtn];
self.titleLab.dk_textColorPicker = DKColorPickerWithKey(Sub_Navi_TITLE); self.titleLab.dk_textColorPicker = DKColorPickerWithKey(Sub_Navi_TITLE);
[self.backBtn dk_setImage:DKImagePickerWithNames(@"sys_back_icon", @"sys_back_icon", @"sys_back_icon") forState:UIControlStateNormal]; [self.backBtn dk_setImage:DKImagePickerWithNames(@"sys_back_icon", @"sys_back_icon", @"sys_back_icon") forState:UIControlStateNormal];
[self.view addSubview:self.relaxItemsView];
[self.view addSubview:self.prepareItemsView];
[self queryPreparePeaceListRequest];
}
- (void)queryPreparePeaceListRequest {
[SleepReadyRequestModel queryPreparePeaceListWithCompletion:^(SleepReadyRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
[self.prepareItemsView.mj_header endRefreshing];
self.relax_items = requestModel.relax_items;
self.prepare_items = requestModel.prepare_items;
[self.relaxItemsView adjustRelax:self.relax_items];
[self.prepareItemsView reloadData];
}
}];
} }
#pragma mark - 设置状态栏文字颜色 #pragma mark - 设置状态栏文字颜色
...@@ -38,4 +63,86 @@ ...@@ -38,4 +63,86 @@
return UIStatusBarStyleLightContent; return UIStatusBarStyleLightContent;
} }
#pragma mark - UITableViewDataSource && UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.prepare_items.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"MoveCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
cell.textLabel.text = [NSString stringWithFormat:@"%ld", indexPath.row + 1];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 70.0;
}
#pragma mark - JXMovableCellTableViewDataSource && JXMovableCellTableViewDelegate
- (NSArray *)dataSourceArrayInTableView:(JXMovableCellTableView *)tableView {
return self.prepare_items.copy;
}
- (void)tableView:(JXMovableCellTableView *)tableView newDataSourceArrayAfterMove:(NSArray *)newDataSourceArray {
self.prepare_items = newDataSourceArray.copy;
}
- (void)tableView:(JXMovableCellTableView *)tableView endMoveCellAtIndexPath:(NSIndexPath *)indexPath {
[self.prepareItemsView reloadData];
}
#pragma mark - lazy
- (RelaxItemsView *)relaxItemsView {
if (!_relaxItemsView) {
_relaxItemsView = [[RelaxItemsView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.dsNaviBar.frame) + 15, kScreenWidth - 30, 162)];
}
return _relaxItemsView;
}
- (JXMovableCellTableView *)prepareItemsView {
if (!_prepareItemsView) {
_prepareItemsView = [[JXMovableCellTableView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.relaxItemsView.frame) + 15, kScreenWidth - 30, kScreenHeight - self.dsNaviBar.height - self.relaxItemsView.height - 30 - 24 - Bottom_SafeArea_Height) style:UITableViewStylePlain];
_prepareItemsView.dk_backgroundColorPicker = DKColorPickerWithKey(TabBarBG);
[_prepareItemsView cornerRadius:24.0];
_prepareItemsView.showsVerticalScrollIndicator = NO;
_prepareItemsView.separatorStyle = UITableViewCellSeparatorStyleNone;
_prepareItemsView.dataSource = self;
_prepareItemsView.delegate = self;
_prepareItemsView.gestureMinimumPressDuration = 1.0;
_prepareItemsView.drawMovalbeCellBlock = ^(UIView *movableCell) {
movableCell.layer.shadowColor = [UIColor grayColor].CGColor;
movableCell.layer.masksToBounds = NO;
movableCell.layer.cornerRadius = 0;
movableCell.layer.shadowOffset = CGSizeMake(-5, 0);
movableCell.layer.shadowOpacity = 0.4;
movableCell.layer.shadowRadius = 5;
};
WS(weakSelf);
_prepareItemsView.mj_header = [DSGifHeader headerWithRefreshingBlock:^{
[weakSelf queryPreparePeaceListRequest];
}];
[_prepareItemsView.mj_header beginRefreshing];
}
return _prepareItemsView;
}
- (NSArray *)relax_items {
if (!_relax_items) {
_relax_items = [NSArray array];
}
return _relax_items;
}
- (NSArray *)prepare_items {
if (!_prepare_items) {
_prepare_items = [NSArray array];
}
return _prepare_items;
}
@end @end
// //
// ProgressCircleView.h // ReadyTimeMarker.h
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/7/13. // Created by peter on 2022/7/14.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 安睡准备时间进度表盘 /// 安睡准备时间调整控制器
@interface ProgressCircleView : UIView @interface ReadyTimeMarker : UIView
@end @end
......
//
// ReadyTimeMarker.m
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "ReadyTimeMarker.h"
@interface ReadyTimeMarker () <UIGestureRecognizerDelegate>
@end
@implementation ReadyTimeMarker
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = DSClearColor;
UIImageView *markIV = [UIImageView new];
markIV.dk_imagePicker = DKImagePickerWithNames(@"ic_zhunbei_yidong", @"dk_ic_zhunbei_yidong", @"ic_zhunbei_yidong");
[self addSubview:markIV];
UIView *dotView = [UIView new];
[dotView cornerRadius:3.0];
dotView.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0xC7C7C7), ColorFromHex(0x383F55), DSWhite);
[self addSubview:dotView];
[markIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self);
make.width.height.equalTo(@30);
}];
[dotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.bottom.equalTo(markIV.mas_top).offset(-29);
make.width.height.equalTo(@6);
}];
// 添加拖动手势
UIPanGestureRecognizer *panGesture = [UIPanGestureRecognizer new];
panGesture.delegate = self;
[self addGestureRecognizer:panGesture];
}
return self;
}
#pragma mark - UIGestureRecognizerDelegate
- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer {
CGPoint translation = [gestureRecognizer translationInView:gestureRecognizer.view];
CGPoint locationPoint = [gestureRecognizer locationInView:gestureRecognizer.view];
if (translation.x < 0) {
// 向左滑
NSLog(@"向左滑");
} else if (translation.x > 0) {
// 向右滑
NSLog(@"向右滑");
}
return NO;
}
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
// 设置线条的样式
CGContextSetLineCap(context, kCGLineCapRound);
// 绘制线的宽度
CGContextSetLineWidth(context, 1.0);
// 线的颜色
UIColor *strokeColor = [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? ColorFromHex(0xC7C7C7) : ColorFromHex(0x383F55);
CGContextSetStrokeColorWithColor(context, strokeColor.CGColor);
// 开始绘制
CGContextBeginPath(context);
// 设置虚线绘制起点
CGFloat x = self.width/2.0;
CGContextMoveToPoint(context, x, 0);
// lengths的值{10, 10}表示先绘制10个点,再跳过10个点,如此反复
CGFloat lengths[] = {4, 10};
// 虚线的起始点
CGContextSetLineDash(context, 0, lengths, 1);
// 绘制虚线的终点
CGContextAddLineToPoint(context, x, self.height - 30);
// 绘制
CGContextStrokePath(context);
// 关闭图像
CGContextClosePath(context);
}
@end
//
// RelaxItemsView.h
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface RelaxItemsView : UIView
- (void)adjustRelax:(NSArray *)relax_items;
@end
NS_ASSUME_NONNULL_END
//
// RelaxItemsView.m
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "RelaxItemsView.h"
#import "ReadyItemCell.h"
#import "ReadyTimeMarker.h"
@interface RelaxItemsView ()
@end
@implementation RelaxItemsView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.dk_backgroundColorPicker = DKColorPickerWithKey(TabBarBG);
[self cornerRadius:24.0];
UIView *xAxis = [[UIView alloc] initWithFrame:CGRectMake(22, (self.height - 2)/2.0, self.width - 44, 2)];
[xAxis cornerRadius:1.0];
xAxis.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0xDDDDDD), ColorFromHex(0x3B4258), DSWhite);
[self addSubview:xAxis];
}
return self;
}
- (void)adjustRelax:(NSArray *)relax_items {
CGFloat lineMargin = 22;
CGFloat lineW = self.width - 2*lineMargin;
CGFloat divideW = lineW / relax_items.count;
CGFloat itemW = 40;
CGFloat itemLeftMargin = lineMargin + (divideW - itemW) / 2.0;
for (int index = 0; index < relax_items.count; index++) {
ReadyItemCell *itemCell = [[ReadyItemCell alloc] initWithFrame:CGRectMake(itemLeftMargin + index * divideW, 24, itemW, self.height - 24 - 47) itemCellType:ItemCellTypeAdjust];
itemCell.item = relax_items[index];
[self addSubview:itemCell];
}
CGFloat markerW = 30;
CGFloat markerLeftMargin = lineMargin + divideW - markerW/2.0;
for (int index = 0; index < relax_items.count - 1; index++) {
ReadyTimeMarker *marker = [[ReadyTimeMarker alloc] initWithFrame:CGRectMake(markerLeftMargin + index * divideW, 24, markerW, self.height - 24 - 19)];
[self addSubview:marker];
}
}
@end
//
// SleepReadyRequestModel.h
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
@interface SleepReadyRequestModel : DSNetworkTool
@property (nonatomic, strong) NSArray *relax_items;
@property (nonatomic, strong) NSArray *prepare_items;
/// 安睡准备设置页面列表数据
/// @param completion completion
+ (NSURLSessionDataTask *)queryPreparePeaceListWithCompletion:(void (^)(SleepReadyRequestModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
//
// SleepReadyRequestModel.m
// DreamSleep
//
// Created by peter on 2022/7/14.
//
#import "SleepReadyRequestModel.h"
#import "ReadyItem.h"
@implementation SleepReadyRequestModel
+ (NSURLSessionDataTask *)queryPreparePeaceListWithCompletion:(void (^)(SleepReadyRequestModel *requestModel))completion {
SleepReadyRequestModel * requestModel = [[SleepReadyRequestModel alloc] init];
NSString *api = @"query_prepare_peace_list";
NSString *argStr = [NSString stringWithFormat:@"query{%@}", api];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:YES success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"安睡准备设置页面列表数据接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
NSDictionary *resultDic = apiDic[@"result"];
NSArray *relax_items = resultDic[@"relax_items"];
NSArray *prepare_items = resultDic[@"prepare_items"];
NSMutableArray *tmp_relax_items = [NSMutableArray array];
for (int i = 0; i < relax_items.count; i++) {
ReadyItem *readyItem = [ReadyItem yy_modelWithJSON:relax_items[i]];
[tmp_relax_items addObject:readyItem];
}
requestModel.relax_items = [tmp_relax_items copy];
NSMutableArray *tmp_prepare_items = [NSMutableArray array];
for (int i = 0; i < prepare_items.count; i++) {
ReadyItem *prepareItem = [ReadyItem yy_modelWithJSON:prepare_items[i]];
[tmp_prepare_items addObject:prepareItem];
}
requestModel.prepare_items = [tmp_prepare_items copy];
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
}];
}
@end
//
// Circle.h
// YKL
//
// Created by Apple on 15/12/7.
// Copyright © 2015年 Apple. All rights reserved.
//
#import <UIKit/UIKit.h>
/// 安睡准备时间进度表盘
@interface XLCircle : UIView
- (instancetype)initWithFrame:(CGRect)frame lineWidth:(float)lineWidth;
@property (assign,nonatomic) float progress;
@property (assign,nonatomic) CGFloat lineWidth;
@end
//
// Circle.m
// YKL
//
// Created by Apple on 15/12/7.
// Copyright © 2015年 Apple. All rights reserved.
//
#import "XLCircle.h"
static CGFloat endPointMargin = 8.0f;
@interface XLCircle () {
CAShapeLayer* _trackLayer;
CAShapeLayer* _progressLayer;
// 进度指示器
UIImageView* _endPoint;
}
@end
@implementation XLCircle
- (instancetype)initWithFrame:(CGRect)frame lineWidth:(float)lineWidth {
if (self = [super initWithFrame:frame]) {
_lineWidth = lineWidth;
[self buildLayout];
}
return self;
}
- (void)buildLayout {
float centerX = self.bounds.size.width/2.0;
float centerY = self.bounds.size.height/2.0;
// 半径
float radius = (self.bounds.size.width - _lineWidth)/2.0;
// 创建贝塞尔路径
UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(centerX, centerY) radius:radius startAngle:(-0.5f*M_PI) endAngle:1.5f*M_PI clockwise:YES];
// 添加背景圆环
CAShapeLayer *backLayer = [CAShapeLayer layer];
backLayer.frame = self.bounds;
backLayer.fillColor = DSClearColor.CGColor;
UIColor *strokeColor = [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? ColorFromHex(0xEEEEEE) : ColorFromHex(0x232A40);
backLayer.strokeColor = strokeColor.CGColor;
backLayer.lineWidth = _lineWidth;
backLayer.path = [path CGPath];
backLayer.strokeEnd = 1;
[self.layer addSublayer:backLayer];
// 创建进度layer
_progressLayer = [CAShapeLayer layer];
_progressLayer.frame = self.bounds;
_progressLayer.fillColor = DSClearColor.CGColor;
// 指定path的渲染颜色
_progressLayer.strokeColor = BrandColor.CGColor;
_progressLayer.lineCap = kCALineCapRound;
_progressLayer.lineWidth = _lineWidth;
_progressLayer.path = [path CGPath];
_progressLayer.strokeEnd = 0;
[self.layer addSublayer:_progressLayer];
// 设置渐变颜色
// CAGradientLayer *gradientLayer = [CAGradientLayer layer];
// gradientLayer.frame = self.bounds;
// [gradientLayer setColors:[NSArray arrayWithObjects:(id)[RGB(255, 151, 0) CGColor],(id)[RGB(255, 203, 0) CGColor], nil]];
// gradientLayer.startPoint = CGPointMake(0, 0);
// gradientLayer.endPoint = CGPointMake(0, 1);
// // 用progressLayer来截取渐变层
// [gradientLayer setMask:_progressLayer];
// [self.layer addSublayer:gradientLayer];
// 进度指示器
_endPoint = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _lineWidth + endPointMargin*2, _lineWidth + endPointMargin*2)];
_endPoint.dk_imagePicker = DKImagePickerWithNames(@"ic_zhunbei_jindu", @"dk_ic_zhunbei_jindu", @"ic_zhunbei_jindu");
_endPoint.hidden = true;
_endPoint.backgroundColor = [UIColor greenColor];
_endPoint.layer.masksToBounds = true;
_endPoint.layer.cornerRadius = _endPoint.bounds.size.width/2;
[self addSubview:_endPoint];
}
- (void)setProgress:(float)progress {
_progress = progress;
_progressLayer.strokeEnd = progress;
[self updateEndPoint];
[_progressLayer removeAllAnimations];
}
// 更新小点的位置
- (void)updateEndPoint {
// 转成弧度
CGFloat angle = M_PI*2*_progress;
float radius = (self.bounds.size.width-_lineWidth)/2.0;
// 用户区分在第几象限内
int index = (angle)/M_PI_2;
// 用于计算正弦/余弦的角度
float needAngle = angle - index*M_PI_2;
float x = 0, y = 0;//用于保存_dotView的frame
switch (index) {
case 0: // 第一象限
x = radius + sinf(needAngle)*radius;
y = radius - cosf(needAngle)*radius;
break;
case 1: // 第二象限
x = radius + cosf(needAngle)*radius;
y = radius + sinf(needAngle)*radius;
break;
case 2: // 第三象限
x = radius - sinf(needAngle)*radius;
y = radius + cosf(needAngle)*radius;
break;
case 3: // 第四象限
x = radius - cosf(needAngle)*radius;
y = radius - sinf(needAngle)*radius;
break;
default:
break;
}
// 更新圆环的frame
CGRect rect = _endPoint.frame;
rect.origin.x = x - endPointMargin;
rect.origin.y = y - endPointMargin;
_endPoint.frame = rect;
// 移动到最前
[self bringSubviewToFront:_endPoint];
_endPoint.hidden = false;
if (_progress == 0 || _progress == 1) {
_endPoint.hidden = true;
}
}
@end
//
// CircleView.h
// YKL
//
// Created by Apple on 15/12/7.
// Copyright © 2015年 Apple. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XLCircleProgress : UIView
// 百分比
@property (assign,nonatomic) float progress;
- (void)fire;
@end
//
// CircleView.m
// YKL
//
// Created by Apple on 15/12/7.
// Copyright © 2015年 Apple. All rights reserved.
//
#import "XLCircleProgress.h"
#import "XLCircle.h"
@implementation XLCircleProgress {
UIImageView *_dialplateIV;
XLCircle* _circle;
UILabel *_percentLabel;
NSTimer *_timer;
NSInteger _countTime;
NSInteger _totalTime;
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initUI];
}
return self;
}
- (void)fire {
[_timer setFireDate:[NSDate date]];
}
- (void)dealloc {
[_timer invalidate];
_timer = nil;
}
- (void)initUI {
_countTime = 10*60;
_totalTime = _countTime;
float lineWidth = 2.0;
_circle = [[XLCircle alloc] initWithFrame:self.bounds lineWidth:lineWidth];
[self addSubview:_circle];
_dialplateIV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 170, 170)];
_dialplateIV.center = _circle.center;
[_dialplateIV dk_setImagePicker:DKImagePickerWithNames(@"pic_zhunbei_biaopan", @"dk_pic_zhunbei_biaopan", @"pic_zhunbei_biaopan")];
[self addSubview:_dialplateIV];
_percentLabel = [[UILabel alloc] initWithFrame:self.bounds];
_percentLabel.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
_percentLabel.textAlignment = NSTextAlignmentCenter;
_percentLabel.font = BoldFont(34.0);
[self addSubview:_percentLabel];
WS(weakSelf);
_timer = [NSTimer timerWithTimeInterval:1.0 repeats:YES block:^(NSTimer * _Nonnull timer) {
[weakSelf dealTimerTask];
}];
[_timer setFireDate:[NSDate distantFuture]];
[[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
}
- (void)dealTimerTask {
// 任务完成
if (_countTime == 0) {
[_timer setFireDate:[NSDate distantFuture]];
// 下一任务
return;
}
_countTime--;
NSString *countDownStr = [self formattimewithtimeinterval:_countTime];
_percentLabel.text = [NSString stringWithFormat:@"%@", countDownStr];
_circle.progress = (double)(_totalTime - _countTime)/(double)(_totalTime);
}
- (NSString *)formattimewithtimeinterval:(NSTimeInterval)timeinterval {
int minute = 0, hour = 0, secend = timeinterval;
minute = (secend % 3600)/60;
hour = secend / 3600;
secend = secend % 60;
if (hour == 0) {
return [NSString stringWithFormat:@"%02d:%02d", minute, secend];
} else if (minute == 0){
return [NSString stringWithFormat:@"%02d", secend];
} else {
return [NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, secend];
}
}
#pragma mark - Setter
- (void)setProgress:(float)progress {
_progress = progress;
_circle.progress = progress;
}
@end
{
"images" : [
{
"filename" : "dk_ic_zhunbei_jindu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_zhunbei_jindu@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_zhunbei_jindu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_ic_zhunbei_yidong.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_zhunbei_yidong@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_zhunbei_yidong@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_zhunbei_jindu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_zhunbei_jindu@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_zhunbei_jindu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_zhunbei_yidong.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_zhunbei_yidong@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_zhunbei_yidong@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!