diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml deleted file mode 100644 index 001b5daa50f839d6905d605e9e0c434fa0921bfc..0000000000000000000000000000000000000000 --- a/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/checkstyleidea-libs/readme.txt b/.idea/checkstyleidea-libs/readme.txt deleted file mode 100644 index 819c0b68d506516ebce15a9fa65a93c0d5f8983e..0000000000000000000000000000000000000000 --- a/.idea/checkstyleidea-libs/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ -This folder contains libraries copied from the "Harmony-TimetableView" project. -It is managed by the CheckStyle-IDEA IDE plugin. -Do not modify this folder while the IDE is running. -When the IDE is stopped, you may delete this folder at any time. It will be recreated as needed. -In order to prevent the CheckStyle-IDEA IDE plugin from creating this folder, -uncheck the "Copy libraries from project directory" option in the CheckStyle-IDEA settings dialog. diff --git a/.idea/code-check/java/codemars.log b/.idea/code-check/java/codemars.log deleted file mode 100644 index 2babbd9e4a303c595710cdc512c5090aa857e323..0000000000000000000000000000000000000000 --- a/.idea/code-check/java/codemars.log +++ /dev/null @@ -1,134 +0,0 @@ -2021-04-02 14:22:31.728 [main] INFO . - user input: D:\DevEco Studio 2.1.0.301\tools\openjdk\bin\java,-j,-source,@E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/.idea/code-check/java/detect.txt,-output,E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/.idea/code-check/java/output.xml -2021-04-02 14:22:31.728 [main] INFO . - CodeMars Version:2.1.2.sp4 -2021-04-02 14:22:31.884 [main] INFO . - starting analyzing. -2021-04-02 14:22:31.899 [main] INFO . - start collecting report. -2021-04-02 14:22:31.919 [CodeMars1] INFO . - Command: "D:\DevEco Studio 2.1.0.301\plugins\codecheck\lib\CodeMars\engines\SecFinder-J\bin\run_SecFinder-J.bat",-filelist,E:\HarmonyWorkSpace\SOW-33\Harmony-TimetableView\.idea\code-check\java\filelist_2021_04_02_14_22_31_899_49.txt,-f,xml,-default,-progress,-r,E:\HarmonyWorkSpace\SOW-33\Harmony-TimetableView\.idea\code-check\java\\errorreport_2021_04_02_14_22_31_681_81.xml,-ruleclasspath,file:///E:\HarmonyWorkSpace\SOW-33\Harmony-TimetableView\.idea\code-check\java\ruleclasspath.txt -2021-04-02 14:22:32.044 [Thread-2] INFO . - 四月 02, 2021 2:22:32 下午 com.huawei.secfinderj.SecFinderJ needScan -2021-04-02 14:22:32.044 [Thread-2] INFO . - 信息: SecFinder-J Version: 2.1.3 -2021-04-02 14:22:32.122 [Thread-1] INFO . - 2021-04-02 14:22:32.075: SecFinder-J Output: Inspect start... -2021-04-02 14:22:32.170 [Thread-1] INFO . - 2021-04-02 14:22:32.170: SecFinder-J Output: Load checkers... -2021-04-02 14:22:32.295 [Thread-1] INFO . - 2021-04-02 14:22:32.295: SecFinder-J Output: Load config... -2021-04-02 14:22:32.326 [Thread-1] INFO . - 2021-04-02 14:22:32.326: SecFinder-J Output: step 1/4: Find files -2021-04-02 14:22:32.373 [Thread-1] INFO . - 2021-04-02 14:22:32.373: SecFinder-J Output: step 2/4: Process files -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: step 3/4: Run analysis... -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [BuildConfig.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [R.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [R.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [AttrAbilityShellActivity.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [MainAbilityShellActivity.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [ResourceTable.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [ShellMyApplication.java] -2021-04-02 14:22:32.421 [Thread-1] INFO . - 2021-04-02 14:22:32.421: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [ResourceTable.java] -2021-04-02 14:22:32.750 [Thread-1] INFO . - 2021-04-02 14:22:32.750: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [BaseFucAbilityShellActivity.java] -2021-04-02 14:22:32.766 [Thread-1] INFO . - 2021-04-02 14:22:32.766: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [ColorPoolAbilityShellActivity.java] -2021-04-02 14:22:32.782 [Thread-1] INFO . - 2021-04-02 14:22:32.782: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [CustomWidthAbilityShellActivity.java] -2021-04-02 14:22:32.782 [Thread-1] INFO . - 2021-04-02 14:22:32.782: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [DateAbilityShellActivity.java] -2021-04-02 14:22:32.782 [Thread-1] INFO . - 2021-04-02 14:22:32.782: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [DateDelayAbilityShellActivity.java] -2021-04-02 14:22:32.782 [Thread-1] INFO . - 2021-04-02 14:22:32.782: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [ElasticAbilityShellActivity.java] -2021-04-02 14:22:32.797 [Thread-1] INFO . - 2021-04-02 14:22:32.797: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [ExtrasAbilityShellActivity.java] -2021-04-02 14:22:32.797 [Thread-1] INFO . - 2021-04-02 14:22:32.797: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [FlaglayoutAbilityShellActivity.java] -2021-04-02 14:22:32.844 [Thread-1] INFO . - 2021-04-02 14:22:32.844: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [ItemStyleAbilityShellActivity.java] -2021-04-02 14:22:32.860 [Thread-1] INFO . - 2021-04-02 14:22:32.860: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [LocalConfigAbilityShellActivity.java] -2021-04-02 14:22:32.860 [Thread-1] INFO . - 2021-04-02 14:22:32.860: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [NonViewAbilityShellActivity.java] -2021-04-02 14:22:32.875 [Thread-1] INFO . - 2021-04-02 14:22:32.875: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [SimpleAbilityShellActivity.java] -2021-04-02 14:22:32.891 [Thread-1] INFO . - 2021-04-02 14:22:32.891: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [SlideAbilityShellActivity.java] -2021-04-02 14:22:32.891 [Thread-1] INFO . - 2021-04-02 14:22:32.891: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [MainAbility.java] -2021-04-02 14:22:32.938 [Thread-1] INFO . - 2021-04-02 14:22:32.938: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [MyApplication.java] -2021-04-02 14:22:32.938 [Thread-1] INFO . - 2021-04-02 14:22:32.938: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [AttrAbility.java] -2021-04-02 14:22:32.938 [Thread-1] INFO . - 2021-04-02 14:22:32.938: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [BaseFucAbility.java] -2021-04-02 14:22:32.954 [Thread-1] INFO . - 2021-04-02 14:22:32.954: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [ColorPoolAbility.java] -2021-04-02 14:22:32.954 [Thread-1] INFO . - 2021-04-02 14:22:32.954: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [CustomWidthAbility.java] -2021-04-02 14:22:32.969 [Thread-1] INFO . - 2021-04-02 14:22:32.969: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [DateAbility.java] -2021-04-02 14:22:33.047 [Thread-1] INFO . - 2021-04-02 14:22:33.032: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [DateDelayAbility.java] -2021-04-02 14:22:33.047 [Thread-1] INFO . - 2021-04-02 14:22:33.047: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [ElasticAbility.java] -2021-04-02 14:22:33.047 [Thread-1] INFO . - 2021-04-02 14:22:33.047: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [ExtrasAbility.java] -2021-04-02 14:22:33.079 [Thread-1] INFO . - 2021-04-02 14:22:33.079: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [FlaglayoutAbility.java] -2021-04-02 14:22:33.094 [Thread-1] INFO . - 2021-04-02 14:22:33.094: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [ItemStyleAbility.java] -2021-04-02 14:22:33.094 [Thread-1] INFO . - 2021-04-02 14:22:33.094: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [LocalConfigAbility.java] -2021-04-02 14:22:33.110 [Thread-1] INFO . - 2021-04-02 14:22:33.110: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [NonViewAbility.java] -2021-04-02 14:22:33.125 [Thread-1] INFO . - 2021-04-02 14:22:33.125: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [SimpleAbility.java] -2021-04-02 14:22:33.141 [Thread-1] INFO . - 2021-04-02 14:22:33.141: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [SlideAbility.java] -2021-04-02 14:22:33.157 [Thread-1] INFO . - 2021-04-02 14:22:33.157: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [NonViewAdapter.java] -2021-04-02 14:22:33.172 [Thread-1] INFO . - 2021-04-02 14:22:33.172: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [OnDateDelayAdapter.java] -2021-04-02 14:22:33.172 [Thread-1] INFO . - 2021-04-02 14:22:33.172: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [OnMyConfigHandleAdapter.java] -2021-04-02 14:22:33.235 [Thread-1] INFO . - 2021-04-02 14:22:33.235: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [CustomOperater.java] -2021-04-02 14:22:33.235 [Thread-1] INFO . - 2021-04-02 14:22:33.235: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [ToastUtil.java] -2021-04-02 14:22:33.235 [Thread-1] INFO . - 2021-04-02 14:22:33.235: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [ToastViewDialog.java] -2021-04-02 14:22:33.235 [Thread-1] INFO . - 2021-04-02 14:22:33.235: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [OnEnglishDateBuildAdapter.java] -2021-04-02 14:22:33.266 [Thread-1] INFO . - 2021-04-02 14:22:33.266: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [OnEnglishItemBuildAdapter.java] -2021-04-02 14:22:33.266 [Thread-1] INFO . - 2021-04-02 14:22:33.266: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [MySubject.java] -2021-04-02 14:22:33.266 [Thread-1] INFO . - 2021-04-02 14:22:33.266: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [SubjectExtras.java] -2021-04-02 14:22:33.282 [Thread-1] INFO . - 2021-04-02 14:22:33.266: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [MyListSubject.java] -2021-04-02 14:22:33.297 [Thread-1] INFO . - 2021-04-02 14:22:33.297: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [SubjectRepertory.java] -2021-04-02 14:22:33.328 [Thread-1] INFO . - 2021-04-02 14:22:33.328: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [AttrSlice.java] -2021-04-02 14:22:33.344 [Thread-1] INFO . - 2021-04-02 14:22:33.344: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [BaseFuncSlice.java] -2021-04-02 14:22:33.344 [Thread-1] INFO . - 2021-04-02 14:22:33.344: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [ColorPoolSlice.java] -2021-04-02 14:22:33.360 [Thread-1] INFO . - 2021-04-02 14:22:33.360: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [CustomWidthSlice.java] -2021-04-02 14:22:33.360 [Thread-1] INFO . - 2021-04-02 14:22:33.360: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [DateDelaySlice.java] -2021-04-02 14:22:33.375 [Thread-1] INFO . - 2021-04-02 14:22:33.375: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [DateSlice.java] -2021-04-02 14:22:33.407 [Thread-1] INFO . - 2021-04-02 14:22:33.407: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [ElasticSlice.java] -2021-04-02 14:22:33.438 [Thread-1] INFO . - 2021-04-02 14:22:33.438: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [ExtrasSlice.java] -2021-04-02 14:22:33.438 [Thread-1] INFO . - 2021-04-02 14:22:33.438: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [FlaglayoutSlice.java] -2021-04-02 14:22:33.453 [Thread-1] INFO . - 2021-04-02 14:22:33.453: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [ItemStyleSlice.java] -2021-04-02 14:22:33.453 [Thread-1] INFO . - 2021-04-02 14:22:33.453: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [LocalConfigSlice.java] -2021-04-02 14:22:33.485 [Thread-1] INFO . - 2021-04-02 14:22:33.485: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [MainAbilitySlice.java] -2021-04-02 14:22:33.500 [Thread-1] INFO . - 2021-04-02 14:22:33.500: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [NonViewSlice.java] -2021-04-02 14:22:33.516 [Thread-1] INFO . - 2021-04-02 14:22:33.516: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [SimpleSlice.java] -2021-04-02 14:22:33.532 [Thread-1] INFO . - 2021-04-02 14:22:33.532: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [SlideSlice.java] -2021-04-02 14:22:33.532 [Thread-1] INFO . - 2021-04-02 14:22:33.532: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [MaterialSpinner.java] -2021-04-02 14:22:33.532 [Thread-1] INFO . - 2021-04-02 14:22:33.532: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [MaterialSpinnerAdapter.java] -2021-04-02 14:22:33.563 [Thread-1] INFO . - 2021-04-02 14:22:33.563: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [MaterialSpinnerBaseAdapter.java] -2021-04-02 14:22:33.594 [Thread-1] INFO . - 2021-04-02 14:22:33.594: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [TypedAttrUtils.java] -2021-04-02 14:22:33.594 [Thread-1] INFO . - 2021-04-02 14:22:33.594: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [Utils.java] -2021-04-02 14:22:33.641 [Thread-1] INFO . - 2021-04-02 14:22:33.641: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [ElasticScrollView.java] -2021-04-02 14:22:33.657 [Thread-1] INFO . - 2021-04-02 14:22:33.641: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [BuildConfig.java] -2021-04-02 14:22:33.657 [Thread-1] INFO . - 2021-04-02 14:22:33.657: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [ResourceTable.java] -2021-04-02 14:22:33.703 [Thread-1] INFO . - 2021-04-02 14:22:33.703: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [TimetableView.java] -2021-04-02 14:22:33.719 [Thread-1] INFO . - 2021-04-02 14:22:33.719: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [ISchedule.java] -2021-04-02 14:22:33.735 [Thread-1] INFO . - 2021-04-02 14:22:33.735: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [IWeekView.java] -2021-04-02 14:22:33.750 [Thread-1] INFO . - 2021-04-02 14:22:33.750: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [OnConfigHandleAdapter.java] -2021-04-02 14:22:33.750 [Thread-1] INFO . - 2021-04-02 14:22:33.750: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [OnDateBuildAapter.java] -2021-04-02 14:22:33.766 [Thread-1] INFO . - 2021-04-02 14:22:33.766: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [OnFlaglayoutClickAdapter.java] -2021-04-02 14:22:33.766 [Thread-1] INFO . - 2021-04-02 14:22:33.766: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [OnItemBuildAdapter.java] -2021-04-02 14:22:33.804 [Thread-1] INFO . - 2021-04-02 14:22:33.804: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [OnItemLongClickAdapter.java] -2021-04-02 14:22:33.820 [Thread-1] INFO . - 2021-04-02 14:22:33.797: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [OnItemClickAdapter.java] -2021-04-02 14:22:33.820 [Thread-1] INFO . - 2021-04-02 14:22:33.820: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [OnScrollViewBuildAdapter.java] -2021-04-02 14:22:33.836 [Thread-1] INFO . - 2021-04-02 14:22:33.836: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [OnSlideBuildAdapter.java] -2021-04-02 14:22:33.851 [Thread-1] INFO . - 2021-04-02 14:22:33.851: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [OnSpaceItemClickAdapter.java] -2021-04-02 14:22:33.851 [Thread-1] INFO . - 2021-04-02 14:22:33.851: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [OnWeekChangedAdapter.java] -2021-04-02 14:22:33.851 [Thread-1] INFO . - 2021-04-02 14:22:33.851: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [OnWeekItemClickedAdapter.java] -2021-04-02 14:22:33.851 [Thread-1] INFO . - 2021-04-02 14:22:33.851: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [OnWeekLeftClickedAdapter.java] -2021-04-02 14:22:33.882 [Thread-1] INFO . - 2021-04-02 14:22:33.882: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [package-info.java] -2021-04-02 14:22:33.898 [Thread-1] INFO . - 2021-04-02 14:22:33.898: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [Schedule.java] -2021-04-02 14:22:33.914 [Thread-1] INFO . - 2021-04-02 14:22:33.914: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [ScheduleConfig.java] -2021-04-02 14:22:33.914 [Thread-1] INFO . - 2021-04-02 14:22:33.914: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [ScheduleColorPool.java] -2021-04-02 14:22:33.961 [Thread-1] INFO . - 2021-04-02 14:22:33.961: SecFinder-J Output: [SecFinder-J--Thread--5] - during processing of [ScheduleSupport.java] -2021-04-02 14:22:33.961 [Thread-1] INFO . - 2021-04-02 14:22:33.961: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [WeekViewEnable.java] -2021-04-02 14:22:33.976 [Thread-1] INFO . - 2021-04-02 14:22:33.961: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [ScheduleEnable.java] -2021-04-02 14:22:33.976 [Thread-1] INFO . - 2021-04-02 14:22:33.976: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [package-info.java] -2021-04-02 14:22:33.992 [Thread-1] INFO . - 2021-04-02 14:22:33.992: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [AbsOperater.java] -2021-04-02 14:22:34.007 [Thread-1] INFO . - 2021-04-02 14:22:34.007: SecFinder-J Output: [SecFinder-J--Thread--7] - during processing of [SimpleOperater.java] -2021-04-02 14:22:34.023 [Thread-1] INFO . - 2021-04-02 14:22:34.023: SecFinder-J Output: [SecFinder-J--Thread--6] - during processing of [package-info.java] -2021-04-02 14:22:34.023 [Thread-1] INFO . - 2021-04-02 14:22:34.023: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [AttrUtils.java] -2021-04-02 14:22:34.039 [Thread-1] INFO . - 2021-04-02 14:22:34.039: SecFinder-J Output: [SecFinder-J--Thread--4] - during processing of [ColorUtils.java] -2021-04-02 14:22:34.039 [Thread-1] INFO . - 2021-04-02 14:22:34.039: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [ScreenUtils.java] -2021-04-02 14:22:34.054 [Thread-1] INFO . - 2021-04-02 14:22:34.054: SecFinder-J Output: [SecFinder-J--Thread--2] - during processing of [package-info.java] -2021-04-02 14:22:34.054 [Thread-1] INFO . - 2021-04-02 14:22:34.054: SecFinder-J Output: [SecFinder-J--Thread--8] - during processing of [PerWeekView.java] -2021-04-02 14:22:34.101 [Thread-1] INFO . - 2021-04-02 14:22:34.101: SecFinder-J Output: [SecFinder-J--Thread--1] - during processing of [WeekView.java] -2021-04-02 14:22:34.117 [Thread-1] INFO . - 2021-04-02 14:22:34.117: SecFinder-J Output: [SecFinder-J--Thread--3] - during processing of [package-info.java] -2021-04-02 14:22:34.258 [Thread-1] INFO . - 2021-04-02 14:22:34.258: SecFinder-J Output: step 4/4: Result output... -2021-04-02 14:22:34.258 [Thread-1] INFO . - 2021-04-02 14:22:34.258: SecFinder-J Output: Inspect finish... -2021-04-02 14:22:34.258 [Thread-1] INFO . - Analysis result: -2021-04-02 14:22:34.258 [Thread-1] INFO . - files analyzed : 105 -2021-04-02 14:22:34.258 [Thread-1] INFO . - lines analyzed : 10933 -2021-04-02 14:22:34.258 [Thread-1] INFO . - rules used : 59 -2021-04-02 14:22:34.258 [Thread-1] INFO . - issues detected : 0 -2021-04-02 14:22:34.258 [Thread-1] INFO . - time cost(sec) : 2 -2021-04-02 14:22:34.258 [Thread-1] INFO . - -2021-04-02 14:22:34.258 [Thread-2] INFO . - 四月 02, 2021 2:22:34 下午 com.huawei.secfinderj.override.HwPmd end -2021-04-02 14:22:34.258 [Thread-2] INFO . - 信息: SecFinder-J run successed! -2021-04-02 14:22:34.368 [CodeMars1] INFO . - start parse errorreport xml -2021-04-02 14:22:34.368 [CodeMars1] INFO . - parse xml time : 0 -2021-04-02 14:22:34.368 [CodeMars1] INFO . - end parse errorreport xml -2021-04-02 14:22:34.368 [main] INFO . - end collecting report. -2021-04-02 14:22:34.368 [main] INFO . - end analyzing. diff --git a/.idea/code-check/java/detect.txt b/.idea/code-check/java/detect.txt deleted file mode 100644 index 8a95787309254d43fbfd76165b829fd3897628c9..0000000000000000000000000000000000000000 --- a/.idea/code-check/java/detect.txt +++ /dev/null @@ -1,106 +0,0 @@ -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/utils/ColorUtils.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/TimetableView.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/build/res/r/com/chinasoft/ohos/R.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/test/java/com/chinasoft/ohos/ExampleTest.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/SlideAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/FlaglayoutSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/build/generated/source/r/com/zhuangfei/ResourceTable.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/model/SubjectRepertory.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/AttrAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/utils/AttrUtils.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/spinner/TypedAttrUtils.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/IWeekView.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/model/MyListSubject.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/ElasticAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerBaseAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/DateSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/DateDelaySlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/generated/source/buildConfig/debug/com/chinasoft/ohos/BuildConfig.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/MainAbilitySlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/build/generated/source/buildConfig/debug/com/zhuangfei/BuildConfig.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleColorPool.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/SimpleSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/views/ElasticScrollView.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinner.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/ISchedule.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/DateDelayAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/SlideAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/package-info.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleSupport.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/WeekViewEnable.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/dialog/ToastUtil.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/BaseFuncSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/AttrSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekItemClickedAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/ExtrasAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/BaseFucAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnConfigHandleAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/generated/source/r/com/zhuangfei/ResourceTable.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/SimpleAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/package-info.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/ElasticSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/DateDelayAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemClickAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/MainAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/view/WeekView.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/operater/package-info.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/custom/CustomOperater.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/view/package-info.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/utils/ScreenUtils.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/adapter/OnDateDelayAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/model/SubjectExtras.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/ExtrasAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/NonViewAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/language/OnEnglishItemBuildAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekLeftClickedAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/operater/SimpleOperater.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/AttrAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/CustomWidthSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/DateAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/MainAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemLongClickAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekChangedAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/config/OnMyConfigHandleAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/language/OnEnglishDateBuildAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/build/res/r/com/zhuangfei/android_timetableview/R.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/NonViewAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleEnable.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/listener/OnDateBuildAapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/adapter/NonViewAdapter.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/operater/AbsOperater.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/generated/source/r/com/chinasoft/ohos/ResourceTable.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/spinner/Utils.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbility.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/utils/package-info.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/ItemStyleSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/model/MySubject.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ShellMyApplication.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/MyApplication.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/BaseFucAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleConfig.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/SlideSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/ExtrasSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/ColorPoolSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/ElasticAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/dialog/ToastViewDialog.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/timetable/src/main/java/com/zhuangfei/timetable/model/Schedule.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/LocalConfigSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/slice/NonViewSlice.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/build/intermediates/shell/debug/src/main/java/com/chinasoft/ohos/ability/DateAbilityShellActivity.java -E:/HarmonyWorkSpace/SOW-33/Harmony-TimetableView/entry/src/main/java/com/chinasoft/ohos/ability/SimpleAbility.java diff --git a/.idea/code-check/java/output.xml b/.idea/code-check/java/output.xml deleted file mode 100644 index 6d36928b9e4af9409d768b13b678e02b696043e5..0000000000000000000000000000000000000000 --- a/.idea/code-check/java/output.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - -105 -10933 -2 -0 - diff --git a/.idea/code-check/java/ruleclasspath.txt b/.idea/code-check/java/ruleclasspath.txt deleted file mode 100644 index 1093eed492533c6bfde6b96293abbf0fd051ecf4..0000000000000000000000000000000000000000 --- a/.idea/code-check/java/ruleclasspath.txt +++ /dev/null @@ -1 +0,0 @@ -D:\DevEco Studio 2.1.0.301\plugins\codecheck\lib\CodeMars\engines\SecFinder-J\rule\ diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 61a9130cd9669c3843e6445dfe1fee2d493869bc..0000000000000000000000000000000000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 62126b0b8e573e37ff08fc19b6950d49df343388..0000000000000000000000000000000000000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index dc31bf4ca80f663480e9b93fd8eb75b471cdeb9a..0000000000000000000000000000000000000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 0efd3f926db1d49ca165852ce01fd626554d7ce5..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/previewer/phone/phoneSettingConfig_-1423674607.json b/.idea/previewer/phone/phoneSettingConfig_-1423674607.json deleted file mode 100644 index f505e6b9ca3d41faf1f0a39a496db58b117fbd60..0000000000000000000000000000000000000000 --- a/.idea/previewer/phone/phoneSettingConfig_-1423674607.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "setting": { - "1.0.1": { - "Language": { - "args": { - "Language": "zh-CN" - } - } - } - }, - "frontend": { - "1.0.0": { - "Resolution": { - "args": { - "Resolution": "360*780" - } - }, - "DeviceType": { - "args": { - "DeviceType": "phone" - } - } - } - } -} \ No newline at end of file diff --git a/.idea/previewer/phone/phoneSettingConfig_-290741184.json b/.idea/previewer/phone/phoneSettingConfig_-290741184.json deleted file mode 100644 index f505e6b9ca3d41faf1f0a39a496db58b117fbd60..0000000000000000000000000000000000000000 --- a/.idea/previewer/phone/phoneSettingConfig_-290741184.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "setting": { - "1.0.1": { - "Language": { - "args": { - "Language": "zh-CN" - } - } - } - }, - "frontend": { - "1.0.0": { - "Resolution": { - "args": { - "Resolution": "360*780" - } - }, - "DeviceType": { - "args": { - "DeviceType": "phone" - } - } - } - } -} \ No newline at end of file diff --git a/.idea/previewer/previewConfig.json b/.idea/previewer/previewConfig.json deleted file mode 100644 index 7aeeb183f1c01e4992d0ab80ade684b0087c4f8c..0000000000000000000000000000000000000000 --- a/.idea/previewer/previewConfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "1.0.0": { - "LastPreviewDevice": { - "E:\\HarmonyWorkSpace\\SOW-33\\Harmony-TimetableView\\entry": [ - "phone" - ], - "E:\\HarmonyWorkSpace\\SOW-33\\Harmony-TimetableView\\timetable": [ - "phone" - ] - } - } -} \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml deleted file mode 100644 index 3dfd21f3217524e575f32113c93bdd238a03c1bc..0000000000000000000000000000000000000000 --- a/.idea/qaplug_profiles.xml +++ /dev/null @@ -1,465 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 45cf85c200ef6f73a8727ea65ecddb01a2c8130d..0000000000000000000000000000000000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/entry/src/main/java/com/chinasoft/ohos/MainAbility.java b/entry/src/main/java/com/chinasoft/ohos/MainAbility.java index 099fac3503ec2c1c19d893822670537fa12503bd..ff3285b429946507b492e9cb1f0bb5369a386390 100644 --- a/entry/src/main/java/com/chinasoft/ohos/MainAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/MainAbility.java @@ -12,9 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chinasoft.ohos ; +package com.chinasoft.ohos; import com.chinasoft.ohos.slice.MainAbilitySlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/AttrAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/AttrAbility.java index 0c338a396db48be93a80bf890d16a1ebe95358ba..3350b282381efd55522e6792b75abd5bcdd66ad9 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/AttrAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/AttrAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.AttrSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; @@ -22,7 +23,6 @@ import ohos.aafwk.content.Intent; * AttrAbility * * @since 2021-03-29 - * */ public class AttrAbility extends Ability { @Override diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/BaseFucAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/BaseFucAbility.java index f65301ba7d6986f04ec281734cb5d7e6481244fa..eb1e245ed3cc2f3599eff95f262f780f4ab7a719 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/BaseFucAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/BaseFucAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.BaseFuncSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbility.java index c48f92962c3292996888c9ee178c01687ac62542..c41636f27edce605b023ded538a95e4b7da1c37a 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/ColorPoolAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.ColorPoolSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbility.java index aec39bf9aa9968d7e51ff579853376c55a6b0a0d..343bdf14f01d6715e47fb6e9f9b53c86f1495167 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/CustomWidthAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.CustomWidthSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/DateAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/DateAbility.java index dd2312659b0a559f7674e3fcdc24a60c8037e2ec..2b9701aa9417d4ff356e5db0d3f93d64dd263924 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/DateAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/DateAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.DateSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/DateDelayAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/DateDelayAbility.java index dd844b810ed0ba4fb1dedf0ca4efa4a090748576..e398e11157e6395220eaff28b0bed9d3a437e5f4 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/DateDelayAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/DateDelayAbility.java @@ -16,6 +16,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.DateDelaySlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/ElasticAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/ElasticAbility.java index 2690fddbf20ed8c04f6a12e09860e0f7d3b15658..c83e699a83886ca07fce3c28ec035a3a610e1cd4 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/ElasticAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/ElasticAbility.java @@ -16,6 +16,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.ElasticSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/ExtrasAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/ExtrasAbility.java index 0c549c73623464a32fc34810d9bd1b39f57ab474..2600e1b49334d96b40ea8d1b7e1223480fa95fb2 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/ExtrasAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/ExtrasAbility.java @@ -15,6 +15,7 @@ package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.ExtrasSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbility.java index 684cae1a7ef05a0df8bc52b1b72aade7bbcf78c8..62703a9c2c04da757e1ca44b94204347c24459b0 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/FlaglayoutAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.FlaglayoutSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbility.java index 077174e7df5ecf2d3edc8b14b6d4aa0e4005a691..c9cf282368c6d260664c63dfd0cf455be41597e5 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/ItemStyleAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.ItemStyleSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbility.java index 5717e65f091cf8c81214922c0e6334e75c650d37..702ec5c6fba931b953c5d1a5f1f58ea5da11619b 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/LocalConfigAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.LocalConfigSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/NonViewAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/NonViewAbility.java index 3bab63478876abb2c999cad44d1f6ea6866e8e7c..2c25b25a1c2e5ac6b851336e73603958ecc00581 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/NonViewAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/NonViewAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.NonViewSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/SimpleAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/SimpleAbility.java index 2bedd6692982787bcff4606dc1763643db4ff013..bb88a2107eb58623e4907996854caaa005eead85 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/SimpleAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/SimpleAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.SimpleSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/ability/SlideAbility.java b/entry/src/main/java/com/chinasoft/ohos/ability/SlideAbility.java index fc3785aa1d06434d8da5385215b7d42e8da6bb29..7c0e2c7921a977b0c3cdba4a01cf6626a9e070b4 100644 --- a/entry/src/main/java/com/chinasoft/ohos/ability/SlideAbility.java +++ b/entry/src/main/java/com/chinasoft/ohos/ability/SlideAbility.java @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.ability; import com.chinasoft.ohos.slice.SlideSlice; + import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Intent; diff --git a/entry/src/main/java/com/chinasoft/ohos/adapter/ChooseAdapter.java b/entry/src/main/java/com/chinasoft/ohos/adapter/ChooseAdapter.java index 04eccf6ec0ba1fcaaacf551aba4bd42d16510839..60e68f6f6889c5f12a2ac88e99908bcc94f316d8 100644 --- a/entry/src/main/java/com/chinasoft/ohos/adapter/ChooseAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/adapter/ChooseAdapter.java @@ -12,35 +12,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chinasoft.ohos.adapter; +package com.chinasoft.ohos.adapter; import com.chinasoft.ohos.ResourceTable; import com.chinasoft.ohos.bean.WeekChooseBean; -import com.chinasoft.ohos.slice.CustomWidthSlice; -import com.zhuangfei.timetable.model.Schedule; -import com.zhuangfei.timetable.model.ScheduleColorPool; -import ohos.agp.colors.RgbColor; + import ohos.agp.components.*; -import ohos.agp.components.element.PixelMapElement; -import ohos.agp.components.element.ShapeElement; import ohos.app.Context; -import ohos.global.resource.Element; -import ohos.media.image.PixelMap; import java.util.ArrayList; -import java.util.List; /** * Created by Liu ZhuangFei on 2018/6/18. BaseAdapter + * + * @since 2021-03-29 */ public class ChooseAdapter extends BaseItemProvider { - ArrayList datas; Context context; LayoutScatter inflater; private CheckListen checkListen; + /** + * 鏋勯犳柟娉 + * + * @param context + * @param data + */ public ChooseAdapter(Context context, ArrayList data) { this.context = context; this.datas = data; @@ -100,7 +99,17 @@ public class ChooseAdapter extends BaseItemProvider { this.checkListen = listen; } + /** + * CheckListen + * + * @since 2021-04-22 + */ public interface CheckListen { + /** + * 鍥炶皟鍙傛暟 + * + * @param index + */ void check(int index); } } diff --git a/entry/src/main/java/com/chinasoft/ohos/adapter/NonViewAdapter.java b/entry/src/main/java/com/chinasoft/ohos/adapter/NonViewAdapter.java index cbef109ddd5dce3fbcb00cf2c4ec20a6f6c6ef42..a1cf6a64608cf426cd245a87792b06506651f2a3 100644 --- a/entry/src/main/java/com/chinasoft/ohos/adapter/NonViewAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/adapter/NonViewAdapter.java @@ -12,12 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chinasoft.ohos.adapter; +package com.chinasoft.ohos.adapter; import com.chinasoft.ohos.ResourceTable; import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.model.ScheduleColorPool; + import ohos.agp.colors.RgbColor; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; @@ -30,11 +31,16 @@ import java.util.List; * */ public class NonViewAdapter extends BaseItemProvider { - List schedules; Context context; LayoutScatter inflater; + /** + * NonViewAdapter + * + * @param context + * @param schedules + */ public NonViewAdapter(Context context, List schedules) { this.context = context; this.schedules = schedules; @@ -60,7 +66,7 @@ public class NonViewAdapter extends BaseItemProvider { public Component getComponent(int i, Component convertView, ComponentContainer viewGroup) { Component mView = null; ViewHolder holder; - if (null == convertView) { + if (convertView == null) { holder = new ViewHolder(); convertView = inflater.parse(ResourceTable.Layout_item_nonview,null,false); holder.nameTextView = (Text) convertView.findComponentById(ResourceTable.Id_id_nonview_name); diff --git a/entry/src/main/java/com/chinasoft/ohos/adapter/OnDateDelayAdapter.java b/entry/src/main/java/com/chinasoft/ohos/adapter/OnDateDelayAdapter.java index db6837b9ea72bba48323cb50a84f66a9ee353fdd..bee2a79ee00ccfec7330d517eb516f7b9735954c 100644 --- a/entry/src/main/java/com/chinasoft/ohos/adapter/OnDateDelayAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/adapter/OnDateDelayAdapter.java @@ -2,7 +2,9 @@ package com.chinasoft.ohos.adapter; import com.zhuangfei.timetable.listener.OnDateBuildAapter; import com.zhuangfei.timetable.model.ScheduleSupport; + import ohos.agp.components.DirectionalLayout; + import java.text.SimpleDateFormat; import java.util.List; @@ -11,7 +13,6 @@ import java.util.List; * Created by Liu ZhuangFei on 2018/8/24. */ public class OnDateDelayAdapter extends OnDateBuildAapter { - /** * 闃堝硷紝鍗宠秴杩囪繖涓椂闂存埑鍚庡紑濮嬫洿鏂版棩鏈 * 鍚﹀垯灏嗕竴鐩存樉绀篿nitDates涓殑鏃ユ湡 @@ -26,6 +27,9 @@ public class OnDateDelayAdapter extends OnDateBuildAapter { */ List initDates = null; + /** + * OnDateDelayAdapter + */ public OnDateDelayAdapter() { sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); } @@ -41,6 +45,11 @@ public class OnDateDelayAdapter extends OnDateBuildAapter { } } + /** + * 璁剧疆鍒濆鍙傛暟 + * + * @param startTime + */ public void setStartTime(long startTime) { this.startTime = startTime; this.startTimeStr = sdf.format(startTime); diff --git a/entry/src/main/java/com/chinasoft/ohos/base/BaseAbilitySlice.java b/entry/src/main/java/com/chinasoft/ohos/base/BaseAbilitySlice.java index e39f8be194ab0b9abc103b0ccf204545810e3b06..ec9a9a48d403f543112b6015f8f5338828d0f4e2 100644 --- a/entry/src/main/java/com/chinasoft/ohos/base/BaseAbilitySlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/base/BaseAbilitySlice.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.chinasoft.ohos.base; import ohos.aafwk.ability.AbilitySlice; @@ -10,9 +25,10 @@ import ohos.agp.window.service.WindowManager; * date : 2021/4/15 9:55 * package锛歝om.chinasoft.ohos * description : + * + * @since 2021-04-22 */ public class BaseAbilitySlice extends AbilitySlice { - @Override protected void onStart(Intent intent) { super.onStart(intent); diff --git a/entry/src/main/java/com/chinasoft/ohos/bean/WeekChooseBean.java b/entry/src/main/java/com/chinasoft/ohos/bean/WeekChooseBean.java index d210163e53cc6b07409fe9b51fa96724fdcd16e1..e2a3794a2eedfc4b5bfd7beba86174259738ac7c 100644 --- a/entry/src/main/java/com/chinasoft/ohos/bean/WeekChooseBean.java +++ b/entry/src/main/java/com/chinasoft/ohos/bean/WeekChooseBean.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.chinasoft.ohos.bean; import ohos.agp.components.RadioButton; @@ -7,6 +22,8 @@ import ohos.agp.components.RadioButton; * date : 2021/4/19 14:32 * package锛歝om.chinasoft.ohos.bean * description : + * + * @since 2021-04-22 */ public class WeekChooseBean { private String week; diff --git a/entry/src/main/java/com/chinasoft/ohos/config/OnMyConfigHandleAdapter.java b/entry/src/main/java/com/chinasoft/ohos/config/OnMyConfigHandleAdapter.java index 9c165f65dc484fa7cc1951869985eaf6e0d9c95a..93e87d2b580b6363bd45e4c71cc40719d7eb4528 100644 --- a/entry/src/main/java/com/chinasoft/ohos/config/OnMyConfigHandleAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/config/OnMyConfigHandleAdapter.java @@ -2,18 +2,32 @@ package com.chinasoft.ohos.config; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; + import ohos.agp.colors.RgbColor; /** * Created by Liu ZhuangFei on 2018/12/22. */ public class OnMyConfigHandleAdapter implements ISchedule.OnConfigHandleListener { - + /** + * CONFIG_SHOW_WEEKENDS + */ public static final String CONFIG_SHOW_WEEKENDS = "config_show_weekends"; + /** + * CONFIG_SHOW_NOT_CUR_WEEK + */ public static final String CONFIG_SHOW_NOT_CUR_WEEK = "config_show_not_this_week"; + /** + * CONFIG_USERLESSS_COLOR + */ public static final String CONFIG_USERLESSS_COLOR = "config_useless_color"; - + /** + * VALUE_TRUE + */ public static final String VALUE_TRUE = "config_value_true"; + /** + * VALUE_FALSE + */ public static final String VALUE_FALSE = "config_value_false"; @Override diff --git a/entry/src/main/java/com/chinasoft/ohos/custom/CustomOperater.java b/entry/src/main/java/com/chinasoft/ohos/custom/CustomOperater.java index 369a6227423ec034c1b65902a3f20fef568cd722..328be70f5d52125395d606d47f624e7c470bd625 100644 --- a/entry/src/main/java/com/chinasoft/ohos/custom/CustomOperater.java +++ b/entry/src/main/java/com/chinasoft/ohos/custom/CustomOperater.java @@ -1,7 +1,22 @@ -package com.chinasoft.ohos.custom; +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.chinasoft.ohos.custom; import com.zhuangfei.timetable.operater.SimpleOperater; + import ohos.agp.components.DirectionalLayout; /** @@ -10,13 +25,15 @@ import ohos.agp.components.DirectionalLayout; * @version 2.0.6 * Created by Liu ZhuangFei on 2018/9/1. */ -public class CustomOperater extends SimpleOperater -{ +public class CustomOperater extends SimpleOperater { /** * 瀹藉害鏉冮噸 */ private float[] weights; + /** + * CustomOperater + */ public CustomOperater() { weights = new float[7]; for (int i = 0;i < weights.length;i++) { @@ -31,12 +48,19 @@ public class CustomOperater extends SimpleOperater return; } for (int i = 0;i < panels.length;i++) { - DirectionalLayout.LayoutConfig lp = new DirectionalLayout.LayoutConfig(0, DirectionalLayout.LayoutConfig.MATCH_PARENT, DirectionalLayout.LayoutConfig.UNSPECIFIED_ALIGNMENT,weights[i]); + DirectionalLayout.LayoutConfig lp = new DirectionalLayout.LayoutConfig(0, + DirectionalLayout.LayoutConfig.MATCH_PARENT, + DirectionalLayout.LayoutConfig.UNSPECIFIED_ALIGNMENT,weights[i]); panels[i].setLayoutConfig(lp); } } + /** + * 璁剧疆瀹藉害 + * + * @param weight + */ public void setWidthWeights(float[] weight) { if (weight == null || weight.length < 7) { return; diff --git a/entry/src/main/java/com/chinasoft/ohos/dialog/ChooseWeekDialog.java b/entry/src/main/java/com/chinasoft/ohos/dialog/ChooseWeekDialog.java index b830d69f3f368ec5dbe44e458b2a153de661d5d4..33a4e1578e8a7e2c47e70108477941999c8ba338 100644 --- a/entry/src/main/java/com/chinasoft/ohos/dialog/ChooseWeekDialog.java +++ b/entry/src/main/java/com/chinasoft/ohos/dialog/ChooseWeekDialog.java @@ -12,15 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.dialog; import com.chinasoft.ohos.ResourceTable; import com.chinasoft.ohos.adapter.ChooseAdapter; import com.chinasoft.ohos.bean.WeekChooseBean; import com.zhuangfei.timetable.utils.ScreenUtils; + import ohos.agp.components.*; import ohos.agp.utils.LayoutAlignment; -import ohos.agp.window.dialog.PopupDialog; +import ohos.agp.window.dialog.CommonDialog; import ohos.app.Context; import java.util.ArrayList; @@ -30,8 +32,7 @@ import java.util.ArrayList; * * @since 2021-03-29 */ -public class ChooseWeekDialog{ - +public class ChooseWeekDialog { private final int target; private Context context; private String title = null; @@ -40,6 +41,12 @@ public class ChooseWeekDialog{ private ConfimClickListen mConfimClickListen; private int mIndex; + /** + * 鏋勯犳柟娉 + * + * @param context + * @param target + */ public ChooseWeekDialog(Context context, int target) { this.target = target; this.context = context; @@ -57,12 +64,21 @@ public class ChooseWeekDialog{ this.mCancleClickListen = cancleClickListen; } + /** + * 璁剧疆纭鐐瑰嚮浜嬩欢 + * + * @param confimClickListen + */ public void setmConfimClickListen(ConfimClickListen confimClickListen) { this.mConfimClickListen = confimClickListen; } + /** + * 鏄剧ず鏂规硶 + */ public void show() { - ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context).parse(ResourceTable.Layout_choose_dialog_layout, null, false); + ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context) + .parse(ResourceTable.Layout_choose_dialog_layout, null, false); Text mTitle = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_title); ListContainer listContainer = (ListContainer) customToastLayout.findComponentById(ResourceTable.Id_lv_choose); Text mBtCancle = (Text) customToastLayout.findComponentById(ResourceTable.Id_bt_cancle); @@ -75,12 +91,13 @@ public class ChooseWeekDialog{ setAdapter(listContainer); } - DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_PARENT,ScreenUtils.getDisplayHeight(context) / 7 * 6); + DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig( + DirectionalLayout.LayoutConfig.MATCH_PARENT, ScreenUtils.getDisplayHeight(context) / 7 * 6); customToastLayout.setLayoutConfig(layoutConfig); - PopupDialog toastDialog = new PopupDialog(context, null); - toastDialog.setCustomComponent(customToastLayout); + CommonDialog toastDialog = new CommonDialog(context); + toastDialog.setContentCustomComponent(customToastLayout); toastDialog.setAutoClosable(false); toastDialog.setSize(ScreenUtils.getDisplayWidth(context) / 6 * 5, DirectionalLayout.LayoutConfig.MATCH_CONTENT); toastDialog.setAlignment(LayoutAlignment.CENTER); @@ -121,11 +138,29 @@ public class ChooseWeekDialog{ adapter.notifyDataChanged(); } + /** + * CancleClickListen + * + * @since 2021-04-22 + */ public interface CancleClickListen { + /** + * onCancleClick + */ void onCancleClick(); } + /** + * ConfimClickListen + * + * @since 2021-04-22 + */ public interface ConfimClickListen { + /** + * onCancleClick + * + * @param index + */ void onConfimClick(int index); } } diff --git a/entry/src/main/java/com/chinasoft/ohos/dialog/DialogUtil.java b/entry/src/main/java/com/chinasoft/ohos/dialog/DialogUtil.java index 99416001c8ae13f1caeafc41565063c1e64d3c79..5232ec66a039dd0f95f6db3e408e983979b54cfd 100644 --- a/entry/src/main/java/com/chinasoft/ohos/dialog/DialogUtil.java +++ b/entry/src/main/java/com/chinasoft/ohos/dialog/DialogUtil.java @@ -1,16 +1,26 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.chinasoft.ohos.dialog; import com.chinasoft.ohos.ResourceTable; import com.zhuangfei.timetable.utils.ScreenUtils; -import ohos.agp.colors.RgbColor; + import ohos.agp.components.*; -import ohos.agp.components.element.ShapeElement; -import ohos.agp.utils.Color; import ohos.agp.utils.LayoutAlignment; -import ohos.agp.window.dialog.IDialog; -import ohos.agp.window.dialog.ListDialog; -import ohos.agp.window.dialog.PopupDialog; -import ohos.agp.window.dialog.ToastDialog; +import ohos.agp.window.dialog.CommonDialog; import ohos.app.Context; /** @@ -21,16 +31,26 @@ import ohos.app.Context; public class DialogUtil { Context context; - + /** + * DialogUtil + * + * @param context + */ public DialogUtil(Context context) { this.context = context; } + /** + * 鏄剧ず鏂规硶 + * + * @param context + * @param title + * @param content + */ + public static void show(Context context, String title, String content) { - public static void show(Context context, String title, String content, Component mBgComponent) { - mBgComponent.setVisibility(Component.VISIBLE); - - ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context).parse(ResourceTable.Layout_dialog_layout, null, false); + ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter + .getInstance(context).parse(ResourceTable.Layout_dialog_layout, null, false); Text mTitle = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_title); Text mContent = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_content); Text mBtConfim = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_confim); @@ -38,12 +58,13 @@ public class DialogUtil { mTitle.setText(title); mContent.setText(content); - ComponentContainer.LayoutConfig layoutConfig = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT); + ComponentContainer.LayoutConfig layoutConfig = new ComponentContainer.LayoutConfig( + ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT); customToastLayout.setLayoutConfig(layoutConfig); - PopupDialog toastDialog = new PopupDialog(context, null); - toastDialog.setCustomComponent(customToastLayout); + CommonDialog toastDialog = new CommonDialog(context); + toastDialog.setContentCustomComponent(customToastLayout); toastDialog.setAutoClosable(false); toastDialog.setSize(ScreenUtils.getDisplayWidth(context) / 7 * 6, DirectionalLayout.LayoutConfig.MATCH_CONTENT); toastDialog.setAlignment(LayoutAlignment.CENTER); @@ -54,7 +75,6 @@ public class DialogUtil { @Override public void onClick(Component component) { toastDialog.hide(); - mBgComponent.setVisibility(Component.HIDE); } }); } diff --git a/entry/src/main/java/com/chinasoft/ohos/dialog/TipsDialogUtil.java b/entry/src/main/java/com/chinasoft/ohos/dialog/TipsDialogUtil.java index 7c1014db7a2bce7d66012e45255c69131de5ab95..264ddf337bb484f022b57184a0d8f5cf810b3a1e 100644 --- a/entry/src/main/java/com/chinasoft/ohos/dialog/TipsDialogUtil.java +++ b/entry/src/main/java/com/chinasoft/ohos/dialog/TipsDialogUtil.java @@ -1,14 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.chinasoft.ohos.dialog; import com.chinasoft.ohos.ResourceTable; import com.zhuangfei.timetable.utils.ScreenUtils; -import ohos.agp.colors.RgbColor; -import ohos.agp.components.*; -import ohos.agp.components.element.ShapeElement; -import ohos.agp.utils.Color; + +import ohos.agp.components.ComponentContainer; +import ohos.agp.components.DirectionalLayout; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.Text; import ohos.agp.utils.LayoutAlignment; -import ohos.agp.window.dialog.BaseDialog; -import ohos.agp.window.dialog.PopupDialog; +import ohos.agp.window.dialog.CommonDialog; import ohos.app.Context; /** @@ -17,31 +32,35 @@ import ohos.app.Context; * @since 2021-03-29 */ public class TipsDialogUtil { - private PopupDialog toastDialog; - Context context; - + private CommonDialog toastDialog; + private Context context; + /** + * 鍒濆鍖 + * + * @param context + */ public TipsDialogUtil(Context context) { this.context = context; - toastDialog = new PopupDialog(context, null); + toastDialog = new CommonDialog(context); } /** + * 鏄剧ず鏂规硶 * - * @param context * @param title * @param content */ - public void show(Context context, String title, String content) { - ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context).parse(ResourceTable.Layout_tips_dialog_layout, null, false); + public void show(String title, String content) { + ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context) + .parse(ResourceTable.Layout_tips_dialog_layout, null, false); Text mTitle = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_title); Text mContent = (Text) customToastLayout.findComponentById(ResourceTable.Id_tv_content); mTitle.setText(title); mContent.setText(content); - - toastDialog.setCustomComponent(customToastLayout); + toastDialog.setContentCustomComponent(customToastLayout); toastDialog.setAutoClosable(false); toastDialog.setTransparent(true); toastDialog.setSize(ScreenUtils.getDisplayWidth(context) / 7 * 6, DirectionalLayout.LayoutConfig.MATCH_CONTENT); @@ -49,6 +68,9 @@ public class TipsDialogUtil { toastDialog.show(); } + /** + * 娑堝け鏂规硶 + */ public void dismiss() { toastDialog.hide(); } diff --git a/entry/src/main/java/com/chinasoft/ohos/dialog/ToastUtil.java b/entry/src/main/java/com/chinasoft/ohos/dialog/ToastUtil.java index 619e6d943f22290adce37852aec1b9a98b06ff65..e84d4e611e49aa7316387b6aa110fa8cb614570a 100644 --- a/entry/src/main/java/com/chinasoft/ohos/dialog/ToastUtil.java +++ b/entry/src/main/java/com/chinasoft/ohos/dialog/ToastUtil.java @@ -1,7 +1,22 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.chinasoft.ohos.dialog; import com.chinasoft.ohos.ResourceTable; -import com.zhuangfei.timetable.utils.ScreenUtils; + import ohos.agp.components.*; import ohos.agp.utils.LayoutAlignment; import ohos.agp.window.dialog.ToastDialog; @@ -11,28 +26,44 @@ import ohos.app.Context; * ToastUtil * * @since 2021-03-29 - * */ public class ToastUtil { - Context context; private static int radius = 58; + /** + * ToastUtil + * + * @param context + */ public ToastUtil(Context context) { this.context = context; } + /** + * toastCtx + * + * @param ctx + * @param text + */ public static void toastCtx(Context ctx, String text) { new ToastDialog(ctx) .setText(text) - .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_CONTENT) + .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT) .setAutoClosable(true) .setDuration(5000) .setCornerRadius(radius) .show(); } + + /** + * toastCtx + * + * @param ctx + * @param layout + */ public static void toastCtx(Context ctx, Component layout) { Component customToastLayout = (Component) LayoutScatter.getInstance(ctx).parse(layout.getId(), null, false); ToastDialog toastDialog = new ToastDialog(ctx); @@ -43,29 +74,49 @@ public class ToastUtil { toastDialog.show(); } + /** + * toast + * + * @param text + */ public void toast(String text) { new ToastDialog(context) .setText(text) - .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_CONTENT) + .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT) .setAutoClosable(true) .setDuration(5000) .setCornerRadius(radius) .show(); } + /** + * toast + * + * @param text + * @param duration + */ public void toast(String text, int duration) { new ToastDialog(context) .setText(text) - .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_CONTENT) + .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT) .setDuration(duration) .setCornerRadius(radius) .show(); } + /** + * toast + * + * @param text + * @param duration + * @param offsetX + * @param offsetY + * @param gravity + */ public void toast(String text, int duration, int offsetX, int offsetY, int gravity) { new ToastDialog(context) .setText(text) - .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_CONTENT) + .setSize(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT) .setAlignment(gravity) .setDuration(duration) .setCornerRadius(radius) @@ -73,14 +124,22 @@ public class ToastUtil { .show(); } + /** + * toast + * + * @param context + * @param text + */ public static void toast(Context context, String text) { - ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context).parse(ResourceTable.Layout_toast_dialog_layout, null, false); + ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context) + .parse(ResourceTable.Layout_toast_dialog_layout, null, false); Text textView = (Text) customToastLayout.findComponentById(ResourceTable.Id_toast_text); textView.setText(text); - DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_PARENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); + DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig( + DirectionalLayout.LayoutConfig.MATCH_PARENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); layoutConfig.setMarginBottom(50); customToastLayout.setLayoutConfig(layoutConfig); @@ -88,8 +147,9 @@ public class ToastUtil { toastDialog.setComponent(customToastLayout); toastDialog.setCornerRadius(radius); toastDialog.setDuration(5000); - toastDialog.setSize(ComponentContainer.LayoutConfig.MATCH_CONTENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); - toastDialog.setAlignment(LayoutAlignment.BOTTOM|LayoutAlignment.HORIZONTAL_CENTER); + toastDialog.setSize(ComponentContainer.LayoutConfig.MATCH_CONTENT, + DirectionalLayout.LayoutConfig.MATCH_CONTENT); + toastDialog.setAlignment(LayoutAlignment.BOTTOM | LayoutAlignment.HORIZONTAL_CENTER); toastDialog.show(); } diff --git a/entry/src/main/java/com/chinasoft/ohos/dialog/ToastViewDialog.java b/entry/src/main/java/com/chinasoft/ohos/dialog/ToastViewDialog.java index 72a68f188a9b797d92782c3252188a54d0c063e7..5180af08b06c645bb5711da5decf2c6ce13f7b1f 100644 --- a/entry/src/main/java/com/chinasoft/ohos/dialog/ToastViewDialog.java +++ b/entry/src/main/java/com/chinasoft/ohos/dialog/ToastViewDialog.java @@ -28,7 +28,11 @@ import ohos.app.Context; * */ public class ToastViewDialog { - + /** + * toast + * + * @param context + */ public static void toast(Context context) { new ToastDialog(context) .setText("杩欐槸涓涓畝鍗曠殑寮圭獥") @@ -36,10 +40,22 @@ public class ToastViewDialog { .show(); } + /** + * toast + * + * @param context + * @param text + */ public static void toast(Context context, String text) { ToastUtil.toast(context,"" + text); } + /** + * toast + * + * @param context + * @param layout + */ public static void toast(Context context, Component layout) { Component customToastLayout = (Component) LayoutScatter.getInstance(context).parse(layout.getId(), null, false); ToastDialog toastDialog = new ToastDialog(context); diff --git a/entry/src/main/java/com/chinasoft/ohos/model/MySubject.java b/entry/src/main/java/com/chinasoft/ohos/model/MySubject.java index 1c872d5392e6460e5b14ccb8df2c188d21092af5..743faa2c87ea4ab063b35d7a23b8f4dd163840cb 100644 --- a/entry/src/main/java/com/chinasoft/ohos/model/MySubject.java +++ b/entry/src/main/java/com/chinasoft/ohos/model/MySubject.java @@ -11,184 +11,206 @@ import java.util.List; * @see ScheduleEnable#getSchedule() */ public class MySubject implements ScheduleEnable { - - public static final String EXTRAS_ID = "extras_id"; - public static final String EXTRAS_AD_URL = "extras_ad_url"; - private int id = 0; + /** + * EXTRAS_ID + */ + public static final String EXTRAS_ID = "extras_id"; + /** + * EXTRAS_AD_URL + */ + public static final String EXTRAS_AD_URL = "extras_ad_url"; + + private int id = 0; + + /** + * 璇剧▼鍚 + */ + private String name; + + private String time; + /** + * 鏁欏 + */ + private String room; + + /** + * 鏁欏笀 + */ + private String teacher; + + /** + * 绗嚑鍛ㄨ嚦绗嚑鍛ㄤ笂 + */ + private List weekList; + + /** + * 寮濮嬩笂璇剧殑鑺傛 + */ + private int start; + + /** + * 涓婅鑺傛暟 + */ + private int step; + + /** + * 鍛ㄥ嚑涓 + */ + private int day; + + private String term; + + /** + * 涓涓殢鏈烘暟锛岀敤浜庡搴旇绋嬬殑棰滆壊 + */ + private int colorRandom = 0; + + private String url; + + public void setUrl(String url) { + this.url = url; + } + + public String getUrl() { + return url; + } /** - * 璇剧▼鍚 + * MySubject */ - private String name; + public MySubject() { + } - private String time; - /** - * 鏁欏 - */ - private String room; - - /** - * 鏁欏笀 - */ - private String teacher; - - /** - * 绗嚑鍛ㄨ嚦绗嚑鍛ㄤ笂 - */ - private List weekList; - - /** - * 寮濮嬩笂璇剧殑鑺傛 - */ - private int start; - - /** - * 涓婅鑺傛暟 - */ - private int step; - - /** - * 鍛ㄥ嚑涓 - */ - private int day; - - private String term; + public void setTime(String time) { + this.time = time; + } + + public String getTime() { + return time; + } + + public void setTerm(String term) { + this.term = term; + } + + public String getTerm() { + return term; + } /** - * 涓涓殢鏈烘暟锛岀敤浜庡搴旇绋嬬殑棰滆壊 + * MySubject + * + * @param term + * @param name + * @param room + * @param teacher + * @param weekList + * @param start + * @param step + * @param day + * @param colorRandom + * @param time */ - private int colorRandom = 0; - - private String url; - - public void setUrl(String url) { - this.url = url; - } - - public String getUrl() { - return url; - } - - public MySubject() { - - } - - public void setTime(String time) { - this.time = time; - } - - public String getTime() { - return time; - } - - public void setTerm(String term) { - this.term = term; - } - - public String getTerm() { - return term; - } - - public MySubject(String term,String name, String room, String teacher, List weekList - , int start, int step, int day, int colorRandom, String time) { - super(); - this.term = term; - this.name = name; - this.room = room; - this.teacher = teacher; - this.weekList = weekList; - this.start = start; - this.step = step; - this.day = day; - this.colorRandom = colorRandom; - this.time = time; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRoom() { - return room; - } - - public void setRoom(String room) { - this.room = room; - } - - public String getTeacher() { - return teacher; - } - - public void setTeacher(String teacher) { - this.teacher = teacher; - } - - public void setWeekList(List weekList) { - this.weekList = weekList; - } - - public List getWeekList() { - return weekList; - } - - public int getStart() { - return start; - } - - public void setStart(int start) { - this.start = start; - } - - public int getStep() { - return step; - } - - public void setStep(int step) { - this.step = step; - } - - public int getDay() { - return day; - } - - public void setDay(int day) { - this.day = day; - } - - public int getColorRandom() { - return colorRandom; - } - - public void setColorRandom(int colorRandom) { - this.colorRandom = colorRandom; - } - - @Override - public Schedule getSchedule() { - Schedule schedule = new Schedule(); - schedule.setDay(getDay()); - schedule.setName(getName()); - schedule.setRoom(getRoom()); - schedule.setStart(getStart()); - schedule.setStep(getStep()); - schedule.setTeacher(getTeacher()); - schedule.setWeekList(getWeekList()); - schedule.setColorRandom(2); - schedule.putExtras(EXTRAS_ID,getId()); - schedule.putExtras(EXTRAS_AD_URL,getUrl()); - return schedule; - } - - public void setId(int id) { - this.id = id; - } - - public int getId() { - return id; - } + public MySubject(String term, String name, String room, String teacher, List weekList, + int start, int step, int day, int colorRandom, String time) { + super(); + this.term = term; + this.name = name; + this.room = room; + this.teacher = teacher; + this.weekList = weekList; + this.start = start; + this.step = step; + this.day = day; + this.colorRandom = colorRandom; + this.time = time; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public String getTeacher() { + return teacher; + } + + public void setTeacher(String teacher) { + this.teacher = teacher; + } + + public void setWeekList(List weekList) { + this.weekList = weekList; + } + + public List getWeekList() { + return weekList; + } + + public int getStart() { + return start; + } + + public void setStart(int start) { + this.start = start; + } + + public int getStep() { + return step; + } + + public void setStep(int step) { + this.step = step; + } + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public int getColorRandom() { + return colorRandom; + } + + public void setColorRandom(int colorRandom) { + this.colorRandom = colorRandom; + } + + @Override + public Schedule getSchedule() { + Schedule schedule = new Schedule(); + schedule.setDay(getDay()); + schedule.setName(getName()); + schedule.setRoom(getRoom()); + schedule.setStart(getStart()); + schedule.setStep(getStep()); + schedule.setTeacher(getTeacher()); + schedule.setWeekList(getWeekList()); + schedule.setColorRandom(2); + schedule.putExtras(EXTRAS_ID, getId()); + schedule.putExtras(EXTRAS_AD_URL, getUrl()); + return schedule; + } + + public void setId(int id) { + this.id = id; + } + + public int getId() { + return id; + } } diff --git a/entry/src/main/java/com/chinasoft/ohos/model/SubjectRepertory.java b/entry/src/main/java/com/chinasoft/ohos/model/SubjectRepertory.java index f28f3ec6ca0cc954decc9c445f4ad307c0a864b1..f56c3aef024b09e9a7f50b63b05b07598c11a16d 100644 --- a/entry/src/main/java/com/chinasoft/ohos/model/SubjectRepertory.java +++ b/entry/src/main/java/com/chinasoft/ohos/model/SubjectRepertory.java @@ -12,7 +12,11 @@ import java.util.List; * @author zf */ public class SubjectRepertory { - + /** + * loadDefaultSubjects + * + * @return json鏁版嵁 + */ public static List loadDefaultSubjects() { /** * json杞箟 @@ -24,6 +28,11 @@ public class SubjectRepertory { return parse(json); } + /** + * json鏁版嵁 + * + * @return json鏁版嵁 + */ public static List loadDefaultSubjects2() { /** * json杞箟 @@ -70,15 +79,22 @@ public class SubjectRepertory { day = -1; start = -1; step = -1; + String exception = e.toString(); } courses.add(new MySubject(term, name, room, teacher, getWeekList(weeks), start, step, day, -1, null)); } } catch (JSONException e) { - + String exception = e.toString(); } return courses; } + /** + * getWeekList + * + * @param weeksstring + * @return weeksstring + */ public static List getWeekList(String weeksstring) { List weekList = new ArrayList<>(); if (weeksstring == null || weeksstring.length() == 0) { @@ -97,12 +113,19 @@ public class SubjectRepertory { return weekList; } + /** + * getWeekList2 + * + * @param weeksString + * @return getWeekList2 + */ public static List getWeekList2(String weeksString) { List weekList = new ArrayList<>(); int first = -1; int end = -1; int index = -1; - if ((index = weeksString.indexOf("-")) != -1) { + index = weeksString.indexOf("-"); + if (index != -1) { first = Integer.parseInt(weeksString.substring(0, index)); end = Integer.parseInt(weeksString.substring(index + 1)); } else { diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/AttrSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/AttrSlice.java index a0f945b6acfb30a786ff7757d548ef09e671483c..8ff9b0311edd060705696a2620ceff251a495b29 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/AttrSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/AttrSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -22,7 +23,7 @@ import com.chinasoft.ohos.model.SubjectRepertory; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.model.Schedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; @@ -34,9 +35,7 @@ import java.util.List; * @since 2021-03-29 */ public class AttrSlice extends BaseAbilitySlice { - TimetableView mTimetableView; - List mySubjects; @Override diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/BaseFuncSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/BaseFuncSlice.java index 8b17bc27619f34cccf3f65b51130594fa1e07422..182071300a48c73cb206ba9706398e9e5f0b5b41 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/BaseFuncSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/BaseFuncSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -28,14 +29,12 @@ import com.zhuangfei.timetable.listener.IWeekView; import com.zhuangfei.timetable.listener.OnSlideBuildAdapter; import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.view.WeekView; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; import ohos.agp.components.DirectionalLayout; import ohos.agp.components.Text; import ohos.agp.utils.Color; -import ohos.multimodalinput.event.KeyEvent; -import ohos.utils.IntentConstants; import java.security.SecureRandom; import java.util.ArrayList; @@ -55,7 +54,6 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked DirectionalLayout layout; Text titleTextView; List mySubjects; - Component mBgComponent; /** * 璁板綍鍒囨崲鐨勫懆娆★紝涓嶄竴瀹氭槸褰撳墠鍛 @@ -76,7 +74,6 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked titleTextView = (Text) findComponentById(ResourceTable.Id_id_title); layout = (DirectionalLayout) findComponentById(ResourceTable.Id_id_layout); MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - mBgComponent = findComponentById(ResourceTable.Id_bg_component); mySubjects = SubjectRepertory.loadDefaultSubjects2(); mySubjects.addAll(SubjectRepertory.loadDefaultSubjects()); @@ -123,7 +120,6 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked */ mWeekView = (WeekView) findComponentById(ResourceTable.Id_id_weekview); mTimetableView = (TimetableView) findComponentById(ResourceTable.Id_id_timetableView); - /** * 璁剧疆鍛ㄦ閫夋嫨灞炴 */ @@ -193,7 +189,6 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked * 瀵硅瘽妗嗕慨鏀瑰綋鍓嶅懆娆 */ protected void onWeekLeftLayoutClicked() { - mBgComponent.setVisibility(Component.VISIBLE); final ArrayList items = new ArrayList<>(); int itemCount = mWeekView.itemCount(); for (int i = 0; i < itemCount; i++) { @@ -201,14 +196,14 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked bean.setWeek("绗" + (i + 1) + "鍛"); if (i == 0) { bean.setSelect(true); - }else { + } else { bean.setSelect(false); } items.add(bean); } target = -1; - ChooseWeekDialog chooseWeekDialog = new ChooseWeekDialog(this,mTimetableView.curWeek() - 1); + ChooseWeekDialog chooseWeekDialog = new ChooseWeekDialog(this, mTimetableView.curWeek() - 1); chooseWeekDialog.setTitle("璁剧疆褰撳墠鍛"); chooseWeekDialog.setData(items); chooseWeekDialog.setmConfimClickListen(new ChooseWeekDialog.ConfimClickListen() { @@ -218,14 +213,12 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked if (target != -1) { mWeekView.curWeek(target + 1).updateView(); mTimetableView.changeWeekForce(target + 1); - mBgComponent.setVisibility(Component.HIDE); } } }); chooseWeekDialog.setCancleButton(new ChooseWeekDialog.CancleClickListen() { @Override public void onCancleClick() { - mBgComponent.setVisibility(Component.HIDE); } }); chooseWeekDialog.show(); @@ -239,12 +232,15 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked protected void display(List beans) { String str = ""; for (Schedule bean : beans) { - str += bean.getName() + "," + bean.getWeekList().toString() + "," + bean.getStart() + "," + bean.getStep() + "\n"; + str += bean.getName() + "," + bean.getWeekList().toString() + "," + + bean.getStart() + "," + bean.getStep() + "\n"; } ToastViewDialog.toast(this, str); } - private static final String[] SPIN_MUNE = {"鏈堜唤瀹藉害澧炲ぇ", "鏈堜唤瀹藉害鎭㈠", "闅愯棌鍛ㄦ湯", "鏄剧ず鍛ㄦ湯", "娣诲姞涓闂ㄨ绋", "鍒犻櫎涓闂ㄨ绋", "闅愯棌闈炴湰鍛ㄨ绋", "鏄剧ず闈炴湰鍛ㄨ绋", "鏈澶ц妭娆8鑺", "鏈澶ц妭娆10鑺", "鏈澶ц妭娆12鑺", "鏄剧ず鑺傛鏃堕棿", "闅愯棌鑺傛鏃堕棿", "鏄剧ず鍛ㄦ閫夋嫨", "闅愯棌鍛ㄦ閫夋嫨"}; + private static final String[] SPIN_MUNE = {"鏈堜唤瀹藉害澧炲ぇ", "鏈堜唤瀹藉害鎭㈠", "闅愯棌鍛ㄦ湯", "鏄剧ず鍛ㄦ湯", + "娣诲姞涓闂ㄨ绋", "鍒犻櫎涓闂ㄨ绋", "闅愯棌闈炴湰鍛ㄨ绋", "鏄剧ず闈炴湰鍛ㄨ绋", "鏈澶ц妭娆8鑺", + "鏈澶ц妭娆10鑺", "鏈澶ц妭娆12鑺", "鏄剧ず鑺傛鏃堕棿", "闅愯棌鑺傛鏃堕棿", "鏄剧ず鍛ㄦ閫夋嫨", "闅愯棌鍛ㄦ閫夋嫨"}; private void selectLayout(int position) { @@ -309,7 +305,7 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked */ if (mWeekView.isShowing()) { mWeekView.isShow(false); - titleTextView.setTextColor(new Color(Color.rgb(19,176,241))); + titleTextView.setTextColor(new Color(Color.rgb(19, 176, 241))); int cur = mTimetableView.curWeek(); mTimetableView.onDateBuildListener() .onUpdateDate(cur, cur); @@ -387,7 +383,8 @@ public class BaseFuncSlice extends BaseAbilitySlice implements Component.Clicked * 璁剧疆渚ц竟鏍忔瀯寤虹洃鍚紝TimeSlideAdapter鏄帶浠跺疄鐜扮殑鍙樉绀烘椂闂寸殑渚ц竟鏍 */ protected void showTime() { - String[] times = new String[]{"8:00", "9:00", "10:10", "11:00", "15:00", "16:00", "17:00", "18:00", "19:30", "20:30", "21:30", "22:30"}; + String[] times = new String[]{"8:00", "9:00", "10:10", "11:00", "15:00", "16:00", + "17:00", "18:00", "19:30", "20:30", "21:30", "22:30"}; OnSlideBuildAdapter listener = (OnSlideBuildAdapter) mTimetableView.onSlideBuildListener(); listener.setTimes(times) .setTimeTextColor(Color.BLACK.getValue()); diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/ColorPoolSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/ColorPoolSlice.java index d31c7f31ecc7b6029730ed3e224591f379e13007..1d2ef0a6e80dba4350bb44242650a8e36930909c 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/ColorPoolSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/ColorPoolSlice.java @@ -20,10 +20,9 @@ import com.chinasoft.ohos.model.MySubject; import com.chinasoft.ohos.model.SubjectRepertory; import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; -import ohos.agp.utils.Color; import java.util.HashMap; import java.util.List; diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/CustomWidthSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/CustomWidthSlice.java index 38f94ceec29fc8855d94dbbf34089b678f87a29d..aaf239a4151e807e690e5dc0ca995a72667860fb 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/CustomWidthSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/CustomWidthSlice.java @@ -24,7 +24,7 @@ import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.listener.OnDateBuildAapter; import com.zhuangfei.timetable.listener.OnSpaceItemClickAdapter; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; import ohos.agp.components.LayoutScatter; @@ -75,7 +75,8 @@ public class CustomWidthSlice extends BaseAbilitySlice { }) .callback(new OnDateBuildAapter() { @Override - public Component[] getDateViews(LayoutScatter scatter, float monthWidth, float perWidth, int height) { + public Component[] getDateViews(LayoutScatter scatter, float monthWidth, + float perWidth, int height) { Component[] views = new Component[8]; views[0] = onBuildMonthLayout(scatter, (int) monthWidth, height); float[] weights = operater.getWeights(); @@ -109,8 +110,10 @@ public class CustomWidthSlice extends BaseAbilitySlice { for (int i = 0; i < day; i++) { newMarLeft += super.itemWidth * 7 * weights[i] / sum; } - StackLayout.LayoutConfig lp = new StackLayout.LayoutConfig(newItemWidth - marLeft * 2, itemHeight); - lp.setMargins(monthWidth + (int) newMarLeft + marLeft, (start - 1) * (itemHeight + marTop) + marTop, 0, 0); + StackLayout.LayoutConfig lp = new StackLayout.LayoutConfig( + newItemWidth - marLeft * 2, itemHeight); + lp.setMargins(monthWidth + (int) newMarLeft + marLeft, (start - 1) * ( + itemHeight + marTop) + marTop, 0, 0); flagLayout.setLayoutConfig(lp); } }) diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/DateDelaySlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/DateDelaySlice.java index 06ea5aea6732d7f168b342c5a255dc69682c895f..f224a642127e7b386a8db1a85420a3a2d59dd92d 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/DateDelaySlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/DateDelaySlice.java @@ -22,7 +22,7 @@ import com.chinasoft.ohos.model.SubjectRepertory; import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Text; import ohos.global.icu.text.SimpleDateFormat; @@ -100,6 +100,8 @@ public class DateDelaySlice extends BaseAbilitySlice { /** * 閰嶇疆OnDateDelayAdapter + * + * @return OnDateDelayAdapter */ public OnDateDelayAdapter getDateDelayAdapter() { OnDateDelayAdapter onDateDelayAdapter = new OnDateDelayAdapter(); @@ -112,7 +114,7 @@ public class DateDelaySlice extends BaseAbilitySlice { try { startTime = sdf.parse("2022-09-03 00:00").getTime(); } catch (ParseException e) { - e.printStackTrace(); + String ex = e.toString(); } /** diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/DateSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/DateSlice.java index 07c36bac1ec05bfd5b7f876bc9f93efb166a6507..3d1adfdccb7d58f666a1865cd15ce2a96db04d15 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/DateSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/DateSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -22,7 +23,7 @@ import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.listener.OnDateBuildAapter; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; import ohos.agp.components.DirectionalLayout; @@ -47,11 +48,12 @@ public class DateSlice extends BaseAbilitySlice { showPopmenu(); } - private static final String[] SPIN_MUNE = {"闅愯棌鏃ユ湡鏍","鏄剧ず鏃ユ湡鏍","鑷畾涔夋棩鏈熸爮","鎭㈠榛樿鏃ユ湡鏍"}; + private static final String[] SPIN_MUNE = {"闅愯棌鏃ユ湡鏍", "鏄剧ず鏃ユ湡鏍", "鑷畾涔夋棩鏈熸爮", "鎭㈠榛樿鏃ユ湡鏍"}; private void showPopmenu() { MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) (view, position, id, item) -> { + spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) ( + view, position, id, item) -> { selectLayout(position); spinner.setShowFalse(); }); @@ -73,7 +75,8 @@ public class DateSlice extends BaseAbilitySlice { case 3: cancelCustomDateView(); break; - default:break; + default: + break; } } diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/ElasticSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/ElasticSlice.java index e2f59ef25726c69cdcb17613d90975546a9909cd..51f02550215a331c92bfd71a1939262985adec7b 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/ElasticSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/ElasticSlice.java @@ -20,7 +20,7 @@ import com.chinasoft.ohos.model.MySubject; import com.chinasoft.ohos.model.SubjectRepertory; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; import ohos.agp.components.LayoutScatter; @@ -58,7 +58,7 @@ public class ElasticSlice extends BaseAbilitySlice { .callback(new ISchedule.OnScrollViewBuildListener() { @Override public Component getScrollView(LayoutScatter scatter) { - + scatter.parse(ResourceTable.Layout_custom_myscrollview, null, true); return scatter.parse(ResourceTable.Layout_custom_myscrollview, null, true); } }) diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/ExtrasSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/ExtrasSlice.java index 958354466d4d3c284de08f9e2346397f94c1be9f..9d76bd0b40e423c55198a12f9d00b52144808e2d 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/ExtrasSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/ExtrasSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -23,7 +24,7 @@ import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.model.Schedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.Component; @@ -66,6 +67,11 @@ public class ExtrasSlice extends BaseAbilitySlice { .showView(); } + /** + * display + * + * @param beans + */ protected void display(List beans) { String str = ""; for (Schedule bean : beans) { diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/FlaglayoutSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/FlaglayoutSlice.java index a53efe9f103482e1fc272aa940ea153420937756..293f22cfc345a1882544116871b7fa7cbe38d6b9 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/FlaglayoutSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/FlaglayoutSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -23,7 +24,7 @@ import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.model.Schedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; import ohos.agp.components.Component; @@ -49,9 +50,13 @@ public class FlaglayoutSlice extends BaseAbilitySlice { private static final String[] SPIN_MUNE = {"鐐瑰嚮绌虹櫧鏍煎瓙璇曡瘯~","淇敼鏃楁爣甯冨眬鑳屾櫙","閲嶇疆鏃楁爣甯冨眬鑳屾櫙","鍙栨秷鏃楁爣甯冨眬","鎭㈠鏃楁爣甯冨眬"}; + /** + * showPopmenu + */ public void showPopmenu() { MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) (view, position, id, item) -> { + spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) ( + view, position, id, item) -> { selectLayout(position - 1); spinner.setShowFalse(); }); diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/ItemStyleSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/ItemStyleSlice.java index 7cffddd82373b85cedfa2355d591d299c929c61a..59b73293e252c7bafb6fad2f89d853719c295a48 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/ItemStyleSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/ItemStyleSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -25,7 +26,7 @@ import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.listener.OnItemBuildAdapter; import com.zhuangfei.timetable.model.Schedule; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; import ohos.agp.components.Component; @@ -38,7 +39,6 @@ import java.util.List; /** * ItemStyleSlice * - * @noinspection checkstyle:LineLength * @since 2021-03-29 */ public class ItemStyleSlice extends BaseAbilitySlice { @@ -98,7 +98,8 @@ public class ItemStyleSlice extends BaseAbilitySlice { } - private static final String[] SPIN_MUNE = {"鍒囨崲鑻辨枃", "鍒囨崲涓枃", "闅愯棌闈炴湰鍛ㄨ绋", "鏄剧ず闈炴湰鍛ㄨ绋", "杈硅窛涓庡姬搴﹁缃", "璇剧▼椤规枃鏈", "鍗曚釜瑙掑姬搴﹁缃", "闈炴湰鍛ㄨ儗鏅缃", "淇敼璇剧▼閲嶅彔鐨勬牱寮"}; + private static final String[] SPIN_MUNE = {"鍒囨崲鑻辨枃", "鍒囨崲涓枃", "闅愯棌闈炴湰鍛ㄨ绋", "鏄剧ず闈炴湰鍛ㄨ绋", + "杈硅窛涓庡姬搴﹁缃", "璇剧▼椤规枃鏈", "鍗曚釜瑙掑姬搴﹁缃", "闈炴湰鍛ㄨ儗鏅缃", "淇敼璇剧▼閲嶅彔鐨勬牱寮"}; /** * 鏄剧ず寮瑰嚭鑿滃崟 @@ -146,7 +147,7 @@ public class ItemStyleSlice extends BaseAbilitySlice { setCorner(0, 10, 0, 0); break; case 7: - setNonThisWeekBgcolor(new RgbColor(255,255,0)); + setNonThisWeekBgcolor(new RgbColor(255, 255, 0)); break; case 8: modifyOverlayStyle(); @@ -196,13 +197,15 @@ public class ItemStyleSlice extends BaseAbilitySlice { public void setCorner(final int leftTop, final int rightTop, final int rightBottom, final int leftBottom) { mTimetableView.callback(new OnItemBuildAdapter() { @Override - public void onItemUpdate(StackLayout layout, Text textView, Text countTextView, Schedule schedule, ShapeElement gd) { + public void onItemUpdate(StackLayout layout, Text textView, + Text countTextView, Schedule schedule, ShapeElement gd) { super.onItemUpdate(layout, textView, countTextView, schedule, gd); /** * 鏁扮粍8涓厓绱狅紝鍥涗釜鏂瑰悜渚濇涓哄乏涓娿佸彸涓娿佸彸涓嬨佸乏涓嬶紝 * 姣忎釜鏂瑰悜鍦ㄦ暟缁勪腑鍗犱袱涓厓绱狅紝鍊肩浉鍚 */ - gd.setCornerRadiiArray(new float[]{leftTop, leftTop, rightTop, rightTop, rightBottom, rightBottom, leftBottom, leftBottom}); + gd.setCornerRadiiArray(new float[]{leftTop, leftTop, rightTop, rightTop, rightBottom, + rightBottom, leftBottom, leftBottom}); } }); mTimetableView.updateView(); @@ -241,7 +244,8 @@ public class ItemStyleSlice extends BaseAbilitySlice { protected void modifyOverlayStyle() { mTimetableView.callback(new OnItemBuildAdapter() { @Override - public void onItemUpdate(StackLayout layout, Text textView, Text countTextView, Schedule schedule, ShapeElement gd) { + public void onItemUpdate(StackLayout layout, Text textView, + Text countTextView, Schedule schedule, ShapeElement gd) { super.onItemUpdate(layout, textView, countTextView, schedule, gd); /** * 鍙璇存槑閲嶅彔锛屽彇娑堣鏍囷紝娣诲姞瑙掑害 diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/LocalConfigSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/LocalConfigSlice.java index 048098884fec11d84a7380479d3a229132eda8db..1a5510b9b9c19ac587650991c5617cc5b58cea45 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/LocalConfigSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/LocalConfigSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -24,8 +25,8 @@ import com.chinasoft.ohos.model.SubjectRepertory; import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.model.ScheduleConfig; + import ohos.aafwk.content.Intent; -import ohos.agp.components.Component; import ohos.agp.components.Text; import java.util.List; @@ -37,19 +38,22 @@ import java.util.Set; * @since 2021-03-29 */ public class LocalConfigSlice extends BaseAbilitySlice { - TimetableView timetableView; MaterialSpinner moreButton; Text titleTextView; - private Component mBgComponent; List mySubjects; int target = -1; boolean initFinish = false; ScheduleConfig mScheduleConfig; Set configSet; + /** + * CONFIG_NAME + */ public static final String CONFIG_NAME = "local_config_name"; - + /** + * SPIN_MUNE + */ private static final String[] SPIN_MUNE = {"鍔犺浇鏈湴閰嶇疆", "娓呴櫎鏈湴閰嶇疆", "瀵煎嚭閰嶇疆鑷虫枃鏈", "鍔犺浇閰嶇疆鏂囨湰"}; @@ -64,7 +68,6 @@ public class LocalConfigSlice extends BaseAbilitySlice { timetableView = (TimetableView) findComponentById(ResourceTable.Id_id_timetableView); moreButton = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); titleTextView = (Text) findComponentById(ResourceTable.Id_id_title); - mBgComponent = findComponentById(ResourceTable.Id_bg_component); mySubjects = SubjectRepertory.loadDefaultSubjects2(); mySubjects.addAll(SubjectRepertory.loadDefaultSubjects()); @@ -161,10 +164,10 @@ public class LocalConfigSlice extends BaseAbilitySlice { Set set = mScheduleConfig.export(); configSet = set; String content = ""; - for (String s : set){ + for (String s : set) { content += s + "\n"; } - DialogUtil.show(this, "閰嶇疆瀵煎嚭", content,mBgComponent); + DialogUtil.show(this, "閰嶇疆瀵煎嚭", content); } @@ -174,7 +177,7 @@ public class LocalConfigSlice extends BaseAbilitySlice { */ private void loadLocalConfigSet() { if (configSet == null) { - DialogUtil.show(this, "閰嶇疆瀵煎叆", "杩樻病鏈夊鍑猴紝鍏堝鍑哄啀鏉ヨ瘯璇曞惂", mBgComponent); + DialogUtil.show(this, "閰嶇疆瀵煎叆", "杩樻病鏈夊鍑猴紝鍏堝鍑哄啀鏉ヨ瘯璇曞惂"); } else { mScheduleConfig.load(configSet); ToastViewDialog.toast(this, "閰嶇疆宸茬敓鏁"); diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/MainAbilitySlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/MainAbilitySlice.java index b767d6f3296b4ab861586d23ff76fe120967da64..dc2e13fcc2bb4fc3ffba448bbe4398781ee92721 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/MainAbilitySlice.java @@ -12,20 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; import com.chinasoft.ohos.ability.*; import com.chinasoft.ohos.base.BaseAbilitySlice; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.aafwk.content.Operation; import ohos.agp.components.Button; import ohos.agp.components.Component; -import ohos.agp.utils.Color; -import ohos.agp.window.service.WindowManager; -import ohos.utils.IntentConstants; -import ohos.utils.net.Uri; /** * MainAbilitySlice diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/NonViewSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/NonViewSlice.java index 9857fef7468b60be45b53872fddd49b609b95ea5..d5f97f1d614c8a4e603f996b8d9a7c069ea656c7 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/NonViewSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/NonViewSlice.java @@ -12,17 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; import com.chinasoft.ohos.adapter.NonViewAdapter; import com.chinasoft.ohos.base.BaseAbilitySlice; -import com.chinasoft.ohos.model.MySubject; import com.chinasoft.ohos.model.SubjectRepertory; import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.model.ScheduleSupport; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.components.ListContainer; import ohos.eventhandler.EventHandler; @@ -61,9 +61,13 @@ public class NonViewSlice extends BaseAbilitySlice { requestData(); } + /** + * showPopmenu + */ public void showPopmenu() { MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) (view, position, id, item) -> { + spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) ( + view, position, id, item) -> { selectLayout(position); spinner.setShowFalse(); }); @@ -135,6 +139,11 @@ public class NonViewSlice extends BaseAbilitySlice { adapter.notifyDataChanged(); } + /** + * getData + * + * @return 鏁版嵁闆 + */ public List getData() { List list = ScheduleSupport.transform(SubjectRepertory.loadDefaultSubjects()); list = ScheduleSupport.getColorReflect(list); diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/SimpleSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/SimpleSlice.java index e38e0188599f647c40508c75124a3b58b513294d..14dfe560bde3d6b4030db3673b9c1a878afdcd63 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/SimpleSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/SimpleSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -29,6 +30,7 @@ import com.zhuangfei.timetable.listener.IWeekView; import com.zhuangfei.timetable.listener.OnItemBuildAdapter; import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.view.WeekView; + import ohos.aafwk.content.Intent; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; @@ -40,8 +42,10 @@ import ohos.media.image.ImageSource; import ohos.media.image.PixelMap; import ohos.media.image.common.PixelFormat; +import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; @@ -53,7 +57,13 @@ import java.util.List; * @since 2021-03-29 */ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedListener { - public static final String AD_URL = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1545749786636&di=fd5483be8b08b2e1f0485e772dadace4&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F5f9fae85770bb289f790e08d778516d128f0492a114a8-TNyOSi_fw658"; + /** + * 骞垮憡閾炬帴 + */ + public static final String AD_URL = + "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1545749786636&di=fd5483be8b08b" + + "2e1f0485e772dadace4&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F5f9fae85770bb289f790e08d" + + "778516d128f0492a114a8-TNyOSi_fw658"; /** * 鎺т欢 @@ -64,7 +74,6 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi DirectionalLayout layout; Text titleTextView; List mySubjects; - private Component mBgComponent; /** @@ -86,7 +95,6 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi titleTextView = (Text) findComponentById(ResourceTable.Id_id_title); layout = (DirectionalLayout) findComponentById(ResourceTable.Id_id_layout); MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - mBgComponent = findComponentById(ResourceTable.Id_bg_component); layout.setClickedListener(this); @@ -124,7 +132,6 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi mWeekView.source(mySubjects).showView(); mTimetableView.source(mySubjects).showView(); tipsDialogUtil.dismiss(); - mBgComponent.setVisibility(Component.HIDE); }); } @@ -139,9 +146,8 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi public void run() { try { SimpleSlice.this.getUITaskDispatcher().asyncDispatch(() -> { - mBgComponent.setVisibility(Component.VISIBLE); tipsDialogUtil = new TipsDialogUtil(SimpleSlice.this); - tipsDialogUtil.show(SimpleSlice.this, "Tips", "妯℃嫙璇锋眰缃戠粶涓.."); + tipsDialogUtil.show("Tips", "妯℃嫙璇锋眰缃戠粶涓.."); }); Thread.sleep(2000); @@ -234,7 +240,8 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi }) .callback(new OnItemBuildAdapter() { @Override - public void onItemUpdate(StackLayout stackLayout, Text textView, Text countTextView, Schedule schedule, ShapeElement gd) { + public void onItemUpdate(StackLayout stackLayout, Text textView, Text countTextView, + Schedule schedule, ShapeElement gd) { super.onItemUpdate(stackLayout, textView, countTextView, schedule, gd); if (schedule.getName().equals("銆愬箍鍛娿")) { stackLayout.removeAllComponents(); @@ -278,7 +285,6 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi * 瀵硅瘽妗嗕慨鏀瑰綋鍓嶅懆娆 */ protected void onWeekLeftLayoutClicked() { - mBgComponent.setVisibility(Component.VISIBLE); final ArrayList items = new ArrayList(); int itemCount = mWeekView.itemCount(); for (int i = 0; i < itemCount; i++) { @@ -286,13 +292,13 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi bean.setWeek("绗" + (i + 1) + "鍛"); if (i == 0) { bean.setSelect(true); - }else { + } else { bean.setSelect(false); } items.add(bean); } - ChooseWeekDialog chooseWeekDialog = new ChooseWeekDialog(this,mTimetableView.curWeek() - 1); + ChooseWeekDialog chooseWeekDialog = new ChooseWeekDialog(this, mTimetableView.curWeek() - 1); chooseWeekDialog.setTitle("璁剧疆褰撳墠鍛"); chooseWeekDialog.setData(items); chooseWeekDialog.setmConfimClickListen(new ChooseWeekDialog.ConfimClickListen() { @@ -302,14 +308,12 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi if (target != -1) { mWeekView.curWeek(target + 1).updateView(); mTimetableView.changeWeekForce(target + 1); - mBgComponent.setVisibility(Component.HIDE); } } }); chooseWeekDialog.setCancleButton(new ChooseWeekDialog.CancleClickListen() { @Override public void onCancleClick() { - mBgComponent.setVisibility(Component.HIDE); } }); chooseWeekDialog.show(); @@ -334,19 +338,28 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi public void hideWeekView() { mWeekView.isShow(false); mTimetableView.setShowWeekView(false); - titleTextView.setTextColor(new Color(Color.rgb(19,176,241))); + titleTextView.setTextColor(new Color(Color.rgb(19, 176, 241))); int cur = mTimetableView.curWeek(); mTimetableView.onDateBuildListener() .onUpdateDate(cur, cur); mTimetableView.changeWeekOnly(cur); } + /** + * showWeekView + */ public void showWeekView() { mWeekView.isShow(true); mTimetableView.setShowWeekView(true); titleTextView.setTextColor(Color.RED); } + /** + * loadImage + * + * @param urlImage + * @return PixelMap + */ public PixelMap loadImage(String urlImage) { PixelMap pixelMap = null; HttpURLConnection connection = null; @@ -372,8 +385,11 @@ public class SimpleSlice extends BaseAbilitySlice implements Component.ClickedLi pixelMap = imageSource.createPixelmap(decodingOptions); } - } catch (Exception e) { - e.printStackTrace(); + + } catch (MalformedURLException e) { + String ex = e.toString(); + } catch (IOException e) { + String ex = e.toString(); } return pixelMap; } diff --git a/entry/src/main/java/com/chinasoft/ohos/slice/SlideSlice.java b/entry/src/main/java/com/chinasoft/ohos/slice/SlideSlice.java index 18dec906671a1f6fc2e616b3c2c665ff2ff1f24e..f73e1ca28689c1a3fc8a67e441bca0677fb0fedf 100644 --- a/entry/src/main/java/com/chinasoft/ohos/slice/SlideSlice.java +++ b/entry/src/main/java/com/chinasoft/ohos/slice/SlideSlice.java @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.slice; import com.chinasoft.ohos.ResourceTable; @@ -22,7 +23,7 @@ import com.chinasoft.ohos.spinner.MaterialSpinner; import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.listener.ISchedule; import com.zhuangfei.timetable.listener.OnSlideBuildAdapter; -import ohos.aafwk.ability.AbilitySlice; + import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; import ohos.agp.components.*; @@ -47,11 +48,13 @@ public class SlideSlice extends BaseAbilitySlice { showPopmenu(); } - private static final String[] SPIN_MUNE = {"鏄剧ず鑺傛鏃堕棿","闅愯棌鑺傛鏃堕棿","淇敼渚ц竟鏍忚儗鏅","淇敼鑺傛鏂囨湰棰滆壊","淇敼鏃堕棿鏂囨湰棰滆壊","鑷畾涔変晶杈规爮","鍙栨秷鑷畾涔変晶杈规爮"}; + private static final String[] SPIN_MUNE = {"鏄剧ず鑺傛鏃堕棿", "闅愯棌鑺傛鏃堕棿", "淇敼渚ц竟鏍忚儗鏅", + "淇敼鑺傛鏂囨湰棰滆壊", "淇敼鏃堕棿鏂囨湰棰滆壊", "鑷畾涔変晶杈规爮", "鍙栨秷鑷畾涔変晶杈规爮"}; private void showPopmenu() { MaterialSpinner spinner = (MaterialSpinner) findComponentById(ResourceTable.Id_id_more); - spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) (view, position, id, item) -> { + spinner.setOnItemSelectedListener((MaterialSpinner.OnItemSelectedListener) ( + view, position, id, item) -> { selectLayout(position); spinner.setShowFalse(); }); @@ -82,7 +85,8 @@ public class SlideSlice extends BaseAbilitySlice { case 6: cancelCustomSlideView(); break; - default:break; + default: + break; } } @@ -113,7 +117,8 @@ public class SlideSlice extends BaseAbilitySlice { * @see OnSlideBuildAdapter */ protected void showTime() { - String[] times = new String[]{"8:00", "9:00", "10:10", "11:00","15:00", "16:00", "17:00", "18:00","19:30", "20:30", "21:30", "22:30"}; + String[] times = new String[]{"8:00", "9:00", "10:10", "11:00", "15:00", + "16:00", "17:00", "18:00", "19:30", "20:30", "21:30", "22:30"}; OnSlideBuildAdapter slideAdapter = new OnSlideBuildAdapter(); slideAdapter.setTimes(times); mTimetableView.callback(slideAdapter); @@ -159,7 +164,8 @@ public class SlideSlice extends BaseAbilitySlice { * @param color */ protected void modifyItemTimeColor(int color) { - String[] times = new String[]{"8:00", "9:00", "10:10", "11:00", "15:00", "16:00", "17:00", "18:00", "19:30", "20:30", "21:30", "22:30"}; + String[] times = new String[]{"8:00", "9:00", "10:10", "11:00", "15:00", "16:00", + "17:00", "18:00", "19:30", "20:30", "21:30", "22:30"}; OnSlideBuildAdapter listener = (OnSlideBuildAdapter) mTimetableView.onSlideBuildListener(); listener.setTimes(times) .setTimeTextColor(color); @@ -180,7 +186,8 @@ public class SlideSlice extends BaseAbilitySlice { */ Component v = inflater.parse(ResourceTable.Layout_item_custom_slide, null, false); Text tv = (Text) v.findComponentById(ResourceTable.Id_item_slide_textview); - DirectionalLayout.LayoutConfig lp = new DirectionalLayout.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, + DirectionalLayout.LayoutConfig lp = new DirectionalLayout.LayoutConfig( + ComponentContainer.LayoutConfig.MATCH_PARENT, itemHeight); lp.setMargins(0, marTop, 0, 0); tv.setLayoutConfig(lp); diff --git a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinner.java b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinner.java index 24f058d2cfe615cdca7eae2a24e997ee2ca95768..8ecb00f5c69ad535539dc887cc5ce9e195166b9b 100644 --- a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinner.java +++ b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinner.java @@ -29,10 +29,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.spinner; import com.chinasoft.ohos.ResourceTable; import com.zhuangfei.timetable.utils.ScreenUtils; + import ohos.aafwk.ability.Ability; import ohos.agp.colors.RgbColor; import ohos.agp.components.*; @@ -65,11 +67,11 @@ import java.util.List; * @since 2021-03-29 */ public class MaterialSpinner extends Text implements Component.TouchEventListener { - + /** + * HiLogLabel + */ static final HiLogLabel LABEL = new HiLogLabel(HiLog.LOG_APP, 0x00201, "MaterialSpinner"); - - private OnNothingSelectedListener onNothingSelectedListener; private OnItemSelectedListener onItemSelectedListener; private com.chinasoft.ohos.spinner.MaterialSpinnerBaseAdapter adapter; @@ -97,23 +99,40 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene private String hintText; private com.chinasoft.ohos.spinner.MaterialSpinnerBaseAdapter mAdapter; + /** + * MaterialSpinner + * + * @param context + */ public MaterialSpinner(Context context) { super(context); init(context, null); } - + /** + * 鏋勯犳柟娉 + * + * @param context + * @param attrs + */ public MaterialSpinner(Context context, AttrSet attrs) { super(context, attrs); init(context, attrs); } + /** + * MaterialSpinner + * + * @param context + * @param attrs + * @param styleName + */ public MaterialSpinner(Context context, AttrSet attrs, String styleName) { super(context, attrs, styleName); init(context, attrs); } - boolean rtl; + private boolean rtl; private void init(Context context, AttrSet attrs) { HiLog.info(LABEL, "init() "); @@ -147,32 +166,47 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene defaultPaddingLeft = (int) resourceManager.getElement(ResourceTable.Float_ms__padding_left).getFloat(); } defaultPopupPaddingLeft = (int) resourceManager.getElement(ResourceTable.Float_ms__padding_left).getFloat(); - defaultPopupPaddingRight = (int) resourceManager.getElement(ResourceTable.Float_ms__padding_left).getFloat(); + defaultPopupPaddingRight = (int) resourceManager.getElement( + ResourceTable.Float_ms__padding_left).getFloat(); defaultPopupPaddingTop = (int) resourceManager.getElement(ResourceTable.Float_ms__padding_top).getFloat(); - defaultPopupPaddingBottom = (int) resourceManager.getElement(ResourceTable.Float_ms__padding_top).getFloat(); + defaultPopupPaddingBottom = (int) resourceManager.getElement( + ResourceTable.Float_ms__padding_top).getFloat(); - backgroundColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_background_color", Color.WHITE.getValue()); + backgroundColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, + "ms_background_color", Color.WHITE.getValue()); backgroundSelector = attrs.getAttr("ms_background_selector").get().getElement(); HiLog.info(LABEL, "backgroundSelector = " + backgroundSelector); - textColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_text_color", defaultColor.getValue()); - textColorButton = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_text_color_button", defaultColor.getValue()); - hintColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_hint_color", defaultColor.getValue()); + textColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_text_color", + defaultColor.getValue()); + textColorButton = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, + "ms_text_color_button", defaultColor.getValue()); + hintColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, + "ms_hint_color", defaultColor.getValue()); arrowColor = com.chinasoft.ohos.spinner.TypedAttrUtils.getIntColor(attrs, "ms_arrow_tint", textColor); hideArrow = com.chinasoft.ohos.spinner.TypedAttrUtils.getBoolean(attrs, "ms_hide_arrow", false); hintText = com.chinasoft.ohos.spinner.TypedAttrUtils.getString(attrs, "ms_hint", ""); - popupWindowMaxHeight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_dropdown_max_height", 1680); - popupWindowHeight = com.chinasoft.ohos.spinner.TypedAttrUtils.getLayoutDimension(attrs, "ms_dropdown_height", - ComponentContainer.LayoutConfig.MATCH_CONTENT); - paddingTop = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_padding_top", defaultPaddingTop); - paddingLeft = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_padding_left", defaultPaddingLeft); - paddingBottom = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_padding_bottom", defaultPaddingBottom); - paddingRight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_padding_right", defaultPaddingRight); - popupPaddingTop = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_popup_padding_top", defaultPopupPaddingTop); - popupPaddingLeft = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_popup_padding_left", defaultPopupPaddingLeft); - popupPaddingBottom = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_popup_padding_bottom", defaultPopupPaddingBottom); - popupPaddingRight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, "ms_popup_padding_right", defaultPopupPaddingRight); + popupWindowMaxHeight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_dropdown_max_height", 1680); + popupWindowHeight = com.chinasoft.ohos.spinner.TypedAttrUtils.getLayoutDimension(attrs, + "ms_dropdown_height", ComponentContainer.LayoutConfig.MATCH_CONTENT); + paddingTop = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_padding_top", defaultPaddingTop); + paddingLeft = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_padding_left", defaultPaddingLeft); + paddingBottom = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_padding_bottom", defaultPaddingBottom); + paddingRight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_padding_right", defaultPaddingRight); + popupPaddingTop = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_popup_padding_top", defaultPopupPaddingTop); + popupPaddingLeft = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_popup_padding_left", defaultPopupPaddingLeft); + popupPaddingBottom = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_popup_padding_bottom", defaultPopupPaddingBottom); + popupPaddingRight = com.chinasoft.ohos.spinner.TypedAttrUtils.getDimensionPixelSize(attrs, + "ms_popup_padding_right", defaultPopupPaddingRight); arrowColorDisabled = com.chinasoft.ohos.spinner.Utils.lighter(arrowColor, 0.8f); HiLog.info(LABEL, "arrowColorDisabled = " + arrowColorDisabled); @@ -220,10 +254,11 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene } private void initPopupWindow(Context context) { - ComponentContainer customToastLayout = (ComponentContainer) LayoutScatter.getInstance(context).parse(ResourceTable.Layout_list_spinner, null, false); + ComponentContainer customToastLayout = (ComponentContainer) + LayoutScatter.getInstance(context).parse(ResourceTable.Layout_list_spinner, null, false); listView = (ListContainer) customToastLayout.findComponentById(ResourceTable.Id_lv_spinner); - DirectionalLayout.LayoutConfig layoutConfig = - new DirectionalLayout.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT); + DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig( + ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_CONTENT); listView.setLayoutConfig(layoutConfig); listView.setId(getId()); listView.setLayoutManager(new DirectionalLayoutManager()); @@ -261,7 +296,8 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene popupWindow.setDialogListener(new BaseDialog.DialogListener() { @Override public boolean isTouchOutside() { - HiLog.info(LABEL, "setDialogListener isTouchOutside " + nothingSelected + ", " + onNothingSelectedListener); + HiLog.info(LABEL, "setDialogListener isTouchOutside " + + nothingSelected + ", " + onNothingSelectedListener); if (popupWindow != null) { popupWindow.destroy(); popupWindow = null; @@ -296,7 +332,10 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene HiLog.info(LABEL, "setLayoutConfig setLayoutConfig setLayoutConfig " + spinnerWidth); } - public boolean isShow = false; + /** + * isShow + */ + private boolean isShow = false; @Override public boolean onTouchEvent(Component component, TouchEvent touchEvent) { @@ -311,10 +350,18 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene return false; } + /** + * setShowFalse + */ public void setShowFalse() { isShow = false; } + /** + * setShowFalse + * + * @param isShows + */ public void setShowFalse(Boolean isShows) { isShow = isShows; } @@ -340,6 +387,11 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene super.setTextColor(new Color(textColorButton)); } + /** + * setHintColor + * + * @param color + */ public void setHintColor(Color color) { hintColor = color.getValue(); super.setTextColor(color); @@ -359,23 +411,6 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene return selectedIndex; } - /** - * Set the default spinner item using its index - * - * @param position the item's position - */ - public void setSelectedIndex(int position) { - if (adapter != null) { - if (position >= 0 && position <= adapter.getCount()) { - adapter.notifyItemSelected(position); - selectedIndex = position; - setText(adapter.get(position).toString()); - } else { - throw new IllegalArgumentException("Position must be lower than adapter count!"); - } - } - } - /** * Register a callback to be invoked when an item in the dropdown is selected * @@ -456,20 +491,6 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene } } - /** - * Get the list of items in the adapter - * - * @param The item type - * @return A list of items or {@code null} if no items are set. - */ - public List getItems() { - if (adapter == null) { - return null; - } else { - return adapter.getItems(); - } - } - /** * 鏈夋洿鏀 : 璋冩暣寮圭獥鏄剧ず浣嶇疆 * Show the dropdown menu @@ -483,12 +504,15 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene nothingSelected = true; initPopupWindow(mContext); - popupWindow.setSize(ScreenUtils.getDisplayWidth(mContext) / 5 * 2, adapter.getCount() * ScreenUtils.pxToFp(mContext,36) + 10); - listView.setComponentSize(ScreenUtils.getDisplayWidth(mContext) / 5 * 2, adapter.getCount() * ScreenUtils.pxToFp(mContext,36) + 10); - // popupWindow.setSize(ScreenUtils.getDisplayWidth(mContext) / 5 * 2, calculatePopupWindowHeight()); + popupWindow.setSize(ScreenUtils.getDisplayWidth(mContext) / 5 * 2, + adapter.getCount() * ScreenUtils.pxToFp(mContext,36) + 10); + listView.setComponentSize(ScreenUtils.getDisplayWidth(mContext) / 5 * 2, + adapter.getCount() * ScreenUtils.pxToFp(mContext,36) + 10); int[] locationOnScreen = this.getLocationOnScreen(); - HiLog.info(LABEL, "locationOnScreen[1] = " + locationOnScreen[1] + ", " + spinnerWidth + ",locationOnScreen[1]" + locationOnScreen[1]); - popupWindow.showOnCertainPosition(LayoutAlignment.LEFT | LayoutAlignment.TOP, locationOnScreen[0] + 60, locationOnScreen[1] + this.getComponentSize().getSizeYToInt() + 10); + HiLog.info(LABEL, "locationOnScreen[1] = " + locationOnScreen[1] + ", " + + spinnerWidth + ",locationOnScreen[1]" + locationOnScreen[1]); + popupWindow.showOnCertainPosition(LayoutAlignment.LEFT | LayoutAlignment.TOP, + locationOnScreen[0] + 60, locationOnScreen[1] + this.getComponentSize().getSizeYToInt() + 10); isShow = true; } } @@ -600,7 +624,9 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene HiLog.info(LABEL, e.toString()); } float listViewHeight = adapter.getCount() * itemHeight; - HiLog.info(LABEL, "itemHeight = " + itemHeight + ", listViewHeight = " + listViewHeight + ", popupWindowMaxHeight = " + popupWindowMaxHeight + ", popupWindowHeight = " + popupWindowHeight); + HiLog.info(LABEL, "itemHeight = " + itemHeight + ", listViewHeight = " + + listViewHeight + ", popupWindowMaxHeight = " + popupWindowMaxHeight + + ", popupWindowHeight = " + popupWindowHeight); if (popupWindowMaxHeight > 0 && listViewHeight > popupWindowMaxHeight) { HiLog.info(LABEL, "if = "); return popupWindowMaxHeight; @@ -653,12 +679,14 @@ public class MaterialSpinner extends Text implements Component.TouchEventListene *

* OnItemSelectedListener * + * @param OnItemSelectedListener * @since 2021-03-29 */ public interface OnItemSelectedListener { /** - *

Callback method to be invoked when an item in this view has been selected. This callback is invoked only when + *

Callback method to be invoked when an item in this view has been selected. + * This callback is invoked only when * the newly selected position is different from the previously selected position or if there was no selected * item.

* diff --git a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerAdapter.java b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerAdapter.java index bd675d252046fd205a38bbc1d9221dec8b6770bc..0f270d2fc9f45bdcbf0fdbb45eda00835df0711e 100644 --- a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerAdapter.java @@ -29,6 +29,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.spinner; import ohos.app.Context; @@ -38,12 +39,19 @@ import java.util.List; /** * MaterialSpinnerAdapter * + * @param MaterialSpinnerAdapter * @since 2021-03-29 */ public class MaterialSpinnerAdapter extends MaterialSpinnerBaseAdapter { private final List items; + /** + * MaterialSpinnerAdapter + * + * @param context + * @param items + */ public MaterialSpinnerAdapter(Context context, List items) { super(context); this.items = items; diff --git a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerBaseAdapter.java b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerBaseAdapter.java index 6691f9fef024114a42df1f442142b0b500d2dd41..f45c212b035d9bac23455dec770a2c476db07174 100644 --- a/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerBaseAdapter.java +++ b/entry/src/main/java/com/chinasoft/ohos/spinner/MaterialSpinnerBaseAdapter.java @@ -1,20 +1,3 @@ -/* - * Copyright (C) 2016 Jared Rummler - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - /* * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.spinner; import com.chinasoft.ohos.ResourceTable; + import ohos.agp.colors.RgbColor; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; @@ -46,6 +31,7 @@ import java.util.List; /** * CameraAbilitySlice * + * @param MaterialSpinnerBaseAdapter * @since 2021-03-29 */ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider { @@ -62,6 +48,11 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider private int popupPaddingRight; private boolean isHintEnabled; + /** + * MaterialSpinnerBaseAdapter + * + * @param context + */ public MaterialSpinnerBaseAdapter(Context context) { this.context = context; } @@ -75,7 +66,8 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider textView = (Text) convertView.findComponentById(ResourceTable.Id_tv_tinted_spinner); textView.setTextColor(new Color(textColor)); textView.setTextSize(textSize); - HiLog.info(LOG_LABEL, "getComponent popupPaddingLeft = " + popupPaddingLeft + ", popupPaddingTop = " + popupPaddingTop); + HiLog.info(LOG_LABEL, "getComponent popupPaddingLeft = " + popupPaddingLeft + + ", popupPaddingTop = " + popupPaddingTop); textView.setMarginsLeftAndRight(popupPaddingLeft, popupPaddingRight); textView.setMarginsTopAndBottom(popupPaddingTop, popupPaddingBottom); @@ -97,6 +89,12 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider return convertView; } + /** + * getItemText + * + * @param position + * @return ItemText + */ public String getItemText(int position) { return getItem(position).toString(); } @@ -106,8 +104,10 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider } /** - * @javadoc notifyItemSelected + * notifyItemSelected + * * @param index + * @javadoc notifyItemSelected */ public void notifyItemSelected(int index) { selectedIndex = index; @@ -124,8 +124,19 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider @Override public abstract int getCount(); + /** + * get + * + * @param position + * @return T + */ public abstract T get(int position); + /** + * getItems + * + * @return List + */ public abstract List getItems(); public void setHintEnabled(boolean ishintenabled) { @@ -136,23 +147,51 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider return this.isHintEnabled; } + /** + * setTextColor + * + * @param textColor + * @return MaterialSpinnerBaseAdapter + */ public MaterialSpinnerBaseAdapter setTextColor(int textColor) { this.textColor = textColor; return this; } + /** + * setTextSize + * + * @param textSize + * @return MaterialSpinnerBaseAdapter + */ public MaterialSpinnerBaseAdapter setTextSize(int textSize) { this.textSize = textSize; return this; } + /** + * setBackgroundSelector + * + * @param backgroundSelector + * @return MaterialSpinnerBaseAdapter + */ public MaterialSpinnerBaseAdapter setBackgroundSelector(int backgroundSelector) { this.backgroundSelector = backgroundSelector; return this; } + /** + * setPopupPadding + * + * @param left + * @param top + * @param right + * @param bottom + * @return MaterialSpinnerBaseAdapter + */ public MaterialSpinnerBaseAdapter setPopupPadding(int left, int top, int right, int bottom) { - HiLog.info(LOG_LABEL, "setPopupPadding popupPaddingLeft = " + popupPaddingLeft + ", popupPaddingTop = " + popupPaddingTop); + HiLog.info(LOG_LABEL, "setPopupPadding popupPaddingLeft = " + + popupPaddingLeft + ", popupPaddingTop = " + popupPaddingTop); this.popupPaddingLeft = left; this.popupPaddingTop = top; this.popupPaddingRight = right; @@ -160,8 +199,14 @@ public abstract class MaterialSpinnerBaseAdapter extends RecycleItemProvider return this; } + /** + * ViewHolder + * + * @since 2021-04-22 + */ private static class ViewHolder { private Text textView; + private ViewHolder(Text textView) { this.textView = textView; } diff --git a/entry/src/main/java/com/chinasoft/ohos/spinner/TypedAttrUtils.java b/entry/src/main/java/com/chinasoft/ohos/spinner/TypedAttrUtils.java index c5287e4e590ca0125c542d5fc373278028a92275..c14f1fcf0d13c99a82e49a0fb4048304c82b8f05 100644 --- a/entry/src/main/java/com/chinasoft/ohos/spinner/TypedAttrUtils.java +++ b/entry/src/main/java/com/chinasoft/ohos/spinner/TypedAttrUtils.java @@ -1,20 +1,3 @@ -/* - * Copyright (C) 2016 Jared Rummler - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - /* * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.chinasoft.ohos.spinner; @@ -48,6 +32,14 @@ import java.util.NoSuchElementException; public class TypedAttrUtils { static final HiLogLabel LOG_LABEL = new HiLogLabel(HiLog.LOG_APP, 0x00201, "TypedAttrUtils"); + /** + * getIntColor + * + * @param attrs + * @param attrName + * @param defValue + * @return int + */ public static int getIntColor(AttrSet attrs, String attrName, int defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -57,6 +49,14 @@ public class TypedAttrUtils { } } + /** + * getColor + * + * @param attrs + * @param attrName + * @param defValue + * @return Color + */ public static Color getColor(AttrSet attrs, String attrName, Color defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -66,6 +66,14 @@ public class TypedAttrUtils { } } + /** + * getBoolean + * + * @param attrs + * @param attrName + * @param defValue + * @return boolean + */ public static boolean getBoolean(AttrSet attrs, String attrName, boolean defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -75,6 +83,14 @@ public class TypedAttrUtils { } } + /** + * getString + * + * @param attrs + * @param attrName + * @param defValue + * @return String + */ public static String getString(AttrSet attrs, String attrName, String defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -84,6 +100,14 @@ public class TypedAttrUtils { } } + /** + * getFloat + * + * @param attrs + * @param attrName + * @param defValue + * @return float + */ public static float getFloat(AttrSet attrs, String attrName, float defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -93,6 +117,14 @@ public class TypedAttrUtils { } } + /** + * getInteger + * + * @param attrs + * @param attrName + * @param defValue + * @return getInteger + */ public static int getInteger(AttrSet attrs, String attrName, int defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -102,6 +134,14 @@ public class TypedAttrUtils { } } + /** + * getDimensionPixelSize + * + * @param attrs + * @param attrName + * @param defValue + * @return int + */ public static int getDimensionPixelSize(AttrSet attrs, String attrName, int defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { @@ -111,6 +151,14 @@ public class TypedAttrUtils { } } + /** + * getLayoutDimension + * + * @param attrs + * @param attrName + * @param defValue + * @return int + */ public static int getLayoutDimension(AttrSet attrs, String attrName, int defValue) { Attr attr = attrNoSuchElement(attrs, attrName); if (attr == null) { diff --git a/entry/src/main/java/com/chinasoft/ohos/spinner/Utils.java b/entry/src/main/java/com/chinasoft/ohos/spinner/Utils.java index 31ee746b233576ac5f39baa2fe7b2402ae7da6af..080a57d42ac9bb2c80a08b53bb3aaa5068c917a0 100644 --- a/entry/src/main/java/com/chinasoft/ohos/spinner/Utils.java +++ b/entry/src/main/java/com/chinasoft/ohos/spinner/Utils.java @@ -15,20 +15,6 @@ * */ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package com.chinasoft.ohos.spinner; diff --git a/entry/src/main/java/com/chinasoft/ohos/views/ElasticScrollView.java b/entry/src/main/java/com/chinasoft/ohos/views/ElasticScrollView.java index 4440fe439c1110fd75f99f6f4619d40846d274a2..e9679889d18ee610d141e766ff480bc65a531f98 100644 --- a/entry/src/main/java/com/chinasoft/ohos/views/ElasticScrollView.java +++ b/entry/src/main/java/com/chinasoft/ohos/views/ElasticScrollView.java @@ -23,14 +23,30 @@ public class ElasticScrollView extends ScrollView implements Component.TouchEven private Rect normal = new Rect(); private boolean animationFinish = true; + /** + * ElasticScrollView + * + * @param context + */ public ElasticScrollView(Context context) { super(context); } + /** + * ElasticScrollView + * + * @param context + * @param attrs + */ public ElasticScrollView(Context context, AttrSet attrs) { super(context, attrs); } + /** + * commOnTouchEvent + * + * @param ev + */ public void commOnTouchEvent(TouchEvent ev) { if (animationFinish) { int action = ev.getAction(); diff --git a/entry/src/main/resources/base/layout/ability_base_func.xml b/entry/src/main/resources/base/layout/ability_base_func.xml index 9642ffc438d9f0689d49c12fcbace6df32b42bc9..e2d4ba397bba58fcc01ef560272e00d1d99e2947 100644 --- a/entry/src/main/resources/base/layout/ability_base_func.xml +++ b/entry/src/main/resources/base/layout/ability_base_func.xml @@ -1,36 +1,24 @@ - + ohos:height="match_parent" + ohos:orientation="vertical"> - + + - - + ohos:height="match_content"/> - - - + - - - + diff --git a/entry/src/main/resources/base/layout/ability_color_pool.xml b/entry/src/main/resources/base/layout/ability_color_pool.xml index c5b43b50d912283ee89a77653299fe6c8cfe566d..d8a53b0a4e9d07caa9487053106966943aab095a 100644 --- a/entry/src/main/resources/base/layout/ability_color_pool.xml +++ b/entry/src/main/resources/base/layout/ability_color_pool.xml @@ -7,8 +7,7 @@ + ohos:height="50vp"/> - - - - - - - - + - - + ohos:height="match_parent" + ohos:background_element="$color:app_white" + > + + + diff --git a/entry/src/main/resources/base/layout/custom_myscrollview.xml b/entry/src/main/resources/base/layout/custom_myscrollview.xml index e884b78e3cd27e4d9927950714e2868f84619bb7..56a84280cfa0cc5235e0102bf995262ab71024b7 100644 --- a/entry/src/main/resources/base/layout/custom_myscrollview.xml +++ b/entry/src/main/resources/base/layout/custom_myscrollview.xml @@ -2,6 +2,7 @@ diff --git a/timetable/src/main/java/com/zhuangfei/timetable/TimetableView.java b/timetable/src/main/java/com/zhuangfei/timetable/TimetableView.java index 09b3f2024e0c8e0390e314cb8951c6434f93e0bf..62fbe7dfbe8b6677071e77e1ea9eb11f89a4fbb7 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/TimetableView.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/TimetableView.java @@ -8,6 +8,7 @@ import com.zhuangfei.timetable.model.ScheduleEnable; import com.zhuangfei.timetable.model.ScheduleSupport; import com.zhuangfei.timetable.operater.AbsOperater; import com.zhuangfei.timetable.operater.SimpleOperater; + import ohos.agp.colors.RgbColor; import ohos.agp.components.AttrSet; import ohos.agp.components.DirectionalLayout; @@ -138,7 +139,12 @@ public class TimetableView extends DirectionalLayout { private ISchedule.OnConfigHandleListener onConfigHandleListener; private boolean isShow; - + /** + * callback + * + * @param onConfigHandleListener + * @return + */ public TimetableView callback(ISchedule.OnConfigHandleListener onConfigHandleListener) { this.onConfigHandleListener = onConfigHandleListener; return this; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/ISchedule.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/ISchedule.java index d8147c205e1ecfeb33048f924429ed03040cb358..ccc0787d216c9f962b0aaf816609afed0f59b836 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/ISchedule.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/ISchedule.java @@ -1,8 +1,8 @@ package com.zhuangfei.timetable.listener; - import com.zhuangfei.timetable.TimetableView; import com.zhuangfei.timetable.model.Schedule; + import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java index 57b8a7983f1022d8698f5d8211b720acaf5c653f..67d3d5159a35ffe1c4eb6a8a6a1a09ae9ec29a27 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java @@ -3,7 +3,6 @@ package com.zhuangfei.timetable.listener; /** * Created by Liu ZhuangFei on 2018/8/3. */ - public class OnFlaglayoutClickAdapter implements ISchedule.OnFlaglayoutClickListener { @Override public void onFlaglayoutClick(int day, int start) { diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java index 9e4114dc77af4a13ec4c00848c8dc49872b8ed4c..e02c671658b8d62d1ddfc107adddf9118ec2135b 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java @@ -1,7 +1,7 @@ package com.zhuangfei.timetable.listener; - import com.zhuangfei.timetable.model.Schedule; + import ohos.agp.components.StackLayout; import ohos.agp.components.Text; import ohos.agp.components.element.ShapeElement; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemClickAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemClickAdapter.java index 175a3c0210a105122a1c047074b2148d94410ee1..bd2bdeda5516da1e62428740aaccc46d21198945 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemClickAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnItemClickAdapter.java @@ -1,8 +1,7 @@ package com.zhuangfei.timetable.listener; - - import com.zhuangfei.timetable.model.Schedule; + import ohos.agp.components.Component; import java.util.List; @@ -10,11 +9,9 @@ import java.util.List; /** * Item鐐瑰嚮鐨勯粯璁ゅ疄鐜. */ - public class OnItemClickAdapter implements ISchedule.OnItemClickListener { private static final String TAG = "OnItemClickAdapter"; @Override public void onItemClick(Component component, List scheduleList) { - } } diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java index e0e5b4ac767b95cf757b651714420d556d4b6bb2..7095e694821380d4c3fc8b49c18cd0d67e7036c1 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java @@ -2,6 +2,7 @@ package com.zhuangfei.timetable.listener; import com.zhuangfei.ResourceTable; + import ohos.agp.components.Component; import ohos.agp.components.LayoutScatter; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java index d757954d98d6f5f58922e006f43aa0276bd2b53d..fd08230caea0339ab6fa7ad3a7179760d6e7ad5f 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java @@ -1,7 +1,7 @@ package com.zhuangfei.timetable.listener; - import com.zhuangfei.ResourceTable; + import ohos.agp.colors.RgbColor; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.java index 4cd631f06ed5cb2d50d86a1377a094bfe4181828..25d96202ba9991fd42dbea1ee27c92747720e805 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.java @@ -1,15 +1,11 @@ package com.zhuangfei.timetable.listener; - import ohos.agp.components.DirectionalLayout; /** * Created by Liu ZhuangFei on 2018/8/3. */ public class OnSpaceItemClickAdapter implements ISchedule.OnSpaceItemClickListener { - - private static final String TAG = "OnSpaceItemClickAdapter"; - protected DirectionalLayout flagLayout; protected int itemHeight; protected int itemWidth; @@ -34,7 +30,8 @@ public class OnSpaceItemClickAdapter implements ISchedule.OnSpaceItemClickListen } @Override - public void onInit(DirectionalLayout directionalLayout, int MonthWidth, int itemWidth, int itemHeight, int marTop, int marLeft) { + public void onInit(DirectionalLayout directionalLayout, int MonthWidth, int itemWidth, + int itemHeight, int marTop, int marLeft) { this.flagLayout = directionalLayout; this.itemHeight = itemHeight; this.itemWidth = itemWidth; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekChangedAdapter.java b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekChangedAdapter.java index 053da84021b1a8c96c8d9a7da4401bf831bbb0ef..0965e4ed938e290b761776e5e66093ebbecf18d8 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekChangedAdapter.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/listener/OnWeekChangedAdapter.java @@ -1,8 +1,5 @@ package com.zhuangfei.timetable.listener; -/** - * - */ public class OnWeekChangedAdapter implements ISchedule.OnWeekChangedListener { @Override public void onWeekChanged(int curWeek) { diff --git a/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleColorPool.java b/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleColorPool.java index 70944e0b2e69c49a28a79fb21a901895910fc89a..eac4a5ab0164a70dbdfdfce2662d985eaa5892d2 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleColorPool.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/model/ScheduleColorPool.java @@ -1,7 +1,5 @@ package com.zhuangfei.timetable.model; - -import com.zhuangfei.ResourceTable; import ohos.agp.colors.RgbColor; import ohos.app.Context; diff --git a/timetable/src/main/java/com/zhuangfei/timetable/operater/AbsOperater.java b/timetable/src/main/java/com/zhuangfei/timetable/operater/AbsOperater.java index d608a917ca59957d997fba0f271560bf925e2a49..40a265683c4bb2248945e0d15dd2b53c58dc58d1 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/operater/AbsOperater.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/operater/AbsOperater.java @@ -1,6 +1,7 @@ package com.zhuangfei.timetable.operater; import com.zhuangfei.timetable.TimetableView; + import ohos.agp.components.AttrSet; import ohos.agp.components.DirectionalLayout; import ohos.app.Context; @@ -10,20 +11,41 @@ import ohos.app.Context; * Created by Liu ZhuangFei on 2018/9/2. */ public abstract class AbsOperater { + /** + * init + * + * @param context + * @param attrs + * @param view + */ public void init(Context context, AttrSet attrs, TimetableView view) { } + /** + * showView + */ public void showView() { } - + /** + * updateDateView + */ public void updateDateView() { } + /** + * updateSlideView + */ public void updateSlideView() { } + /** + * changeWeek + * + * @param week + * @param isCurWeek + */ public void changeWeek(int week, boolean isCurWeek) { } @@ -35,6 +57,11 @@ public abstract class AbsOperater { return null; } + /** + * setWeekendsVisiable + * + * @param isShow + */ public void setWeekendsVisiable(boolean isShow) { } } diff --git a/timetable/src/main/java/com/zhuangfei/timetable/operater/SimpleOperater.java b/timetable/src/main/java/com/zhuangfei/timetable/operater/SimpleOperater.java index a0de5808351f5497dd1d0dd320b0e223441dac4c..eee987108ebb3d3e8554b2de424876370a23bddb 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/operater/SimpleOperater.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/operater/SimpleOperater.java @@ -9,6 +9,7 @@ import com.zhuangfei.timetable.model.ScheduleConfig; import com.zhuangfei.timetable.model.ScheduleSupport; import com.zhuangfei.timetable.utils.AttrUtils; import com.zhuangfei.timetable.utils.ScreenUtils; + import ohos.agp.colors.RgbColor; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; @@ -23,8 +24,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import static ohos.agp.components.Component.AXIS_Y; - /** * 璇捐〃涓氬姟鎿嶄綔鑰咃紝TimetableView涓彧娑夊強灞炴х殑璁剧疆锛屾柟娉曠殑鍏蜂綋瀹炵幇鍦ㄨ繖閲. * 甯哥敤鐨勬柟娉曚篃灏卞洓涓紝濡備笅 @@ -81,10 +80,6 @@ public class SimpleOperater extends AbsOperater { * 鍒濆鏈堜唤闀垮害 */ protected final static int MONTH_WIDTH = 80; - /** - * 甯冨眬婊戝姩楂樺害 - */ - private float scrollY; @Override public void init(Context context, AttrSet attrs, TimetableView view) { @@ -382,7 +377,7 @@ public class SimpleOperater extends AbsOperater { */ final int start; if (mView.isShowWeekView()) { - start = (int) Math.ceil((y + scrollY) / (mView.itemHeight() + mView.marTop())); + start = (int) Math.ceil(y / (mView.itemHeight() + mView.marTop())); } else { start = (int) Math.ceil(y / (mView.itemHeight() + mView.marTop())); } @@ -585,6 +580,11 @@ public class SimpleOperater extends AbsOperater { } } + /** + * getPerWidth + * + * @return + */ protected float getPerWidth() { float perWidth = 0; if (mView.isShowWeekends()) { diff --git a/timetable/src/main/java/com/zhuangfei/timetable/utils/AttrUtils.java b/timetable/src/main/java/com/zhuangfei/timetable/utils/AttrUtils.java index a7b5dcec92b45cf4bd7df0d36195e14e0b804108..3b553fdd9fcf8b830fc45922641f9579f296589d 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/utils/AttrUtils.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/utils/AttrUtils.java @@ -24,6 +24,7 @@ import ohos.agp.utils.Color; import ohos.hiviewdfx.HiLog; import ohos.hiviewdfx.HiLogLabel; +import java.util.Locale; import java.util.NoSuchElementException; /** @@ -198,7 +199,7 @@ public class AttrUtils { return defValue; } else { String stringBool = attr.getStringValue(); - return stringBool.toLowerCase().equals("true"); + return stringBool.toLowerCase(Locale.ENGLISH).equals("true"); } } } diff --git a/timetable/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java b/timetable/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java index 015b986dfc8dd7e24ab1548ce0df5b5581c52421..adcd5dc0143a42cbaacddc8c2d4ddf48692eb54a 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java @@ -4,6 +4,7 @@ import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.model.ScheduleEnable; import com.zhuangfei.timetable.model.ScheduleSupport; import com.zhuangfei.timetable.utils.AttrUtils; + import ohos.agp.components.AttrSet; import ohos.agp.components.Component; import ohos.agp.render.Canvas; @@ -101,6 +102,7 @@ public class PerWeekView extends Component { public PerWeekView setLightColor(int lightColor) { this.lightColor = lightColor; invalidate(); + return this; } diff --git a/timetable/src/main/java/com/zhuangfei/timetable/view/WeekView.java b/timetable/src/main/java/com/zhuangfei/timetable/view/WeekView.java index b1b71254f5b59dbc68268f5632baf3e9ace26a41..d17cadd8b93936da028d3c1de172660d8733a0eb 100644 --- a/timetable/src/main/java/com/zhuangfei/timetable/view/WeekView.java +++ b/timetable/src/main/java/com/zhuangfei/timetable/view/WeekView.java @@ -8,6 +8,7 @@ import com.zhuangfei.timetable.model.Schedule; import com.zhuangfei.timetable.model.ScheduleEnable; import com.zhuangfei.timetable.model.ScheduleSupport; import com.zhuangfei.timetable.model.WeekViewEnable; + import ohos.agp.colors.RgbColor; import ohos.agp.components.*; import ohos.agp.components.element.ShapeElement; @@ -70,6 +71,11 @@ public class WeekView extends DirectionalLayout implements WeekViewEnable