diff --git a/WaterFlowSample/README.md b/WaterFlowSample/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d8f32c0a85ac0c7f69006d297b15ee375afa10d2 --- /dev/null +++ b/WaterFlowSample/README.md @@ -0,0 +1,19 @@ +# 常见瀑布流操作 + +### 简介 + +本示例基于WaterFlow组件的特性,整理了瀑布流常见操作的示例代码。 + +### 相关权限 + +不涉及 + +### 约束与限制 + +1.本示例仅支持标准系统上运行,支持设备:华为手机。 + +2.HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 + +3.DevEco Studio版本:DevEco Studio 5.0.5 Release及以上。 + +4.HarmonyOS SDK版本:HarmonyOS 5.0.5 Release SDK及以上。 \ No newline at end of file diff --git a/WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets b/WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets index a6ba20f2f665a02fa9ff25f7c8d24ca331a3b894..5de6c0e929c97be47221b4434a7c09e517bcfc9e 100644 --- a/WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 diff --git a/WaterFlowSample/entry/src/main/ets/entryability/EntryAbility.ets b/WaterFlowSample/entry/src/main/ets/entryability/EntryAbility.ets index a1b9d910217b8eb04b87a1ec2d9dd34edac9a616..eac0299848ad088c65ad2557135a9f5358eaf9a4 100644 --- a/WaterFlowSample/entry/src/main/ets/entryability/EntryAbility.ets +++ b/WaterFlowSample/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { window } from '@kit.ArkUI'; diff --git a/WaterFlowSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/WaterFlowSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets index fae19f9dd53d2857e2843539cbedf5bee4a34b5a..1fca37ecc34e1079aaf6557f1272cd694aa0068c 100644 --- a/WaterFlowSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ b/WaterFlowSample/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + import { hilog } from '@kit.PerformanceAnalysisKit'; import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; diff --git a/WaterFlowSample/entry/src/main/ets/model/MyDataSource.ets b/WaterFlowSample/entry/src/main/ets/model/MyDataSource.ets index 540edfc0bd36a13a89c4e7ef4c74eafd27f00ae7..ceef0cc51a841364b359e808f2a3db393394ddda 100644 --- a/WaterFlowSample/entry/src/main/ets/model/MyDataSource.ets +++ b/WaterFlowSample/entry/src/main/ets/model/MyDataSource.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { BasicDataSource } from "./BasicDataSource"; export class MyDataSource extends BasicDataSource { diff --git a/WaterFlowSample/entry/src/main/ets/pages/CustomItemHeightPage.ets b/WaterFlowSample/entry/src/main/ets/pages/CustomItemHeightPage.ets index 95b6dd02c6779460c2103db821be935f72637611..bf51f3f07f24d433fb2673b7e2d35cd601d3eced 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/CustomItemHeightPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/CustomItemHeightPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; // [StartExclude flow_item_layout] diff --git a/WaterFlowSample/entry/src/main/ets/pages/DataLoadMorePage.ets b/WaterFlowSample/entry/src/main/ets/pages/DataLoadMorePage.ets index a57960564289adbec073a538bc2715a27fed1ea3..63b36a2c5e34520c1ec34aa9a66ef0ab16f67c9d 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/DataLoadMorePage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/DataLoadMorePage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from "../common/constants/CommonConstants"; import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; diff --git a/WaterFlowSample/entry/src/main/ets/pages/DataUpadteAndAnimationPage.ets b/WaterFlowSample/entry/src/main/ets/pages/DataUpadteAndAnimationPage.ets index 577a7a7e3b9931f22fe6e24de698abe7966f1417..89e5fcaaa9c6a9fbdb6de955a66f55ff4ade6b1a 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/DataUpadteAndAnimationPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/DataUpadteAndAnimationPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from "../common/constants/CommonConstants"; import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; diff --git a/WaterFlowSample/entry/src/main/ets/pages/ElementByOrderPage.ets b/WaterFlowSample/entry/src/main/ets/pages/ElementByOrderPage.ets index 2cabc98ac2587f4bb44efd248146287b16b2992c..06f953b96ece5f35ea6c19c16ac809a130ea1668 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/ElementByOrderPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/ElementByOrderPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + import { CommonConstants } from '../common/constants/CommonConstants'; @Entry diff --git a/WaterFlowSample/entry/src/main/ets/pages/FadingEdgePage.ets b/WaterFlowSample/entry/src/main/ets/pages/FadingEdgePage.ets index 6826eed28022d40f46a9e14e984ed7b2f6373324..66ae7e2c3f9cc0665cf217fa0c6f6e878082ccbf 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/FadingEdgePage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/FadingEdgePage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from "../common/constants/CommonConstants"; import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; diff --git a/WaterFlowSample/entry/src/main/ets/pages/FlowItemAutoPlayPage.ets b/WaterFlowSample/entry/src/main/ets/pages/FlowItemAutoPlayPage.ets index 6606e901a55fbe196c5c84ccfc6e087ad0e10937..a109868f0d363062dd652bb1d51e3321f485271b 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/FlowItemAutoPlayPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/FlowItemAutoPlayPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { hilog } from '@kit.PerformanceAnalysisKit'; import { CommonConstants } from '../common/constants/CommonConstants'; diff --git a/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmoveAnimationPage.ets b/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmoveAnimationPage.ets index a38c698caf28360c310c52d10c3d7af734aab796..de35272657c028c5694a66b1e9e792436e020658 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmoveAnimationPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmoveAnimationPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from "../common/constants/CommonConstants"; import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; diff --git a/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmovePage.ets b/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmovePage.ets index 870d96ac3ccd58e056f0f8642d07a0d81a9578e9..39fd451396830cc3cb3f03ee9639e6caf09e8f4e 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmovePage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/FlowItemRmovePage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; // [StartExclude flow_item_layout] diff --git a/WaterFlowSample/entry/src/main/ets/pages/ForceShowOnTopLeftPage.ets b/WaterFlowSample/entry/src/main/ets/pages/ForceShowOnTopLeftPage.ets index a711b3684a3eda7ea6419f13ee5dc3fd4bfbd6b7..24ad635da88791f8fdcf12f3b05b62ce0b8304a2 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/ForceShowOnTopLeftPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/ForceShowOnTopLeftPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from '../common/constants/CommonConstants'; import { MyDataSource } from '../model/MyDataSource' diff --git a/WaterFlowSample/entry/src/main/ets/pages/Index.ets b/WaterFlowSample/entry/src/main/ets/pages/Index.ets index 05cb67b498c78deec8fc9cdb72f675b40cb43ec5..e92c93015bfa71c6557aad7bba0649971aecbfa7 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/Index.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/Index.ets @@ -13,7 +13,6 @@ * limitations under the License. */ - @Entry @Component struct Index { diff --git a/WaterFlowSample/entry/src/main/ets/pages/MergeDoubleWaterFlowPage.ets b/WaterFlowSample/entry/src/main/ets/pages/MergeDoubleWaterFlowPage.ets index 54cb0e868ace2c6bc8e8eaab34a577304ea197c7..9e259d3bddf27d96a802305c70d86bbbc9aac5d5 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/MergeDoubleWaterFlowPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/MergeDoubleWaterFlowPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from '../common/constants/CommonConstants'; import { MyDataSource } from '../model/MyDataSource' diff --git a/WaterFlowSample/entry/src/main/ets/pages/SectionOptionsUsePage.ets b/WaterFlowSample/entry/src/main/ets/pages/SectionOptionsUsePage.ets index 12137c6a9b0c6a03773193d7f7707497f049cfab..86f8ec47f77bd0a4fb4c3ffac587fc629059cef2 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/SectionOptionsUsePage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/SectionOptionsUsePage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { CommonConstants } from "../common/constants/CommonConstants"; import { SectionsWaterFlowDataSource } from "../model/SectionsWaterFlowDataSource"; diff --git a/WaterFlowSample/entry/src/main/ets/pages/StickOnTopPage.ets b/WaterFlowSample/entry/src/main/ets/pages/StickOnTopPage.ets index 929dc3ed021e6c46a994c83f774fde0ca501d89a..ff5b1cb60702e7f1b380c381adacc351196690c0 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/StickOnTopPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/StickOnTopPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { hilog } from '@kit.PerformanceAnalysisKit'; import { CommonConstants } from '../common/constants/CommonConstants'; diff --git a/WaterFlowSample/entry/src/main/ets/pages/ZoomChangeColumnPage.ets b/WaterFlowSample/entry/src/main/ets/pages/ZoomChangeColumnPage.ets index aef08e29a5960703e399e72674ee5a12ffbca878..f000305fb85e071b7eebb6382ba8c826ce7b68d5 100644 --- a/WaterFlowSample/entry/src/main/ets/pages/ZoomChangeColumnPage.ets +++ b/WaterFlowSample/entry/src/main/ets/pages/ZoomChangeColumnPage.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + // [Start quick_start] import { MyDataSource } from '../model/MyDataSource' import { image } from '@kit.ImageKit'; diff --git a/WaterFlowSample/entry/src/main/ets/utils/WindowUtil.ets b/WaterFlowSample/entry/src/main/ets/utils/WindowUtil.ets index f711a36ffc3fafdae96e1180d00f6e3939a568af..535ac13967e616bceead59016ce0e80251a022de 100644 --- a/WaterFlowSample/entry/src/main/ets/utils/WindowUtil.ets +++ b/WaterFlowSample/entry/src/main/ets/utils/WindowUtil.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 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