Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-08-22 15:27:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c86518cf53bd111aabcc2f387fbaf4cadc8b80f5
c86518cf
1 parent
2e892d18
feat:优化下拉刷新展示
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
sight_harmony/features/wdComponent/src/main/ets/components/refresh/RefreshLoadLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/refresh/RefreshLoadLayout.ets
View file @
c86518c
import lottie, { AnimationItem } from '@ohos/lottie';
import { RefreshConstants } from '../../utils/RefreshConstants';
import { LoadStatus, RefreshLayoutBean } from './RefreshLayoutBean';
/**
...
...
@@ -122,8 +123,7 @@ export default struct CustomLayout {
if (!this.refreshBean.isVisible) {
return
}
let maxH = CustomLayout.REFRESH_HEIGHT
let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset
if (this.refreshBean.loadStatus === LoadStatus.PRELOAD) {
// 下拉刷新
this.animate1(this.refreshBean.offset)
...
...
@@ -132,19 +132,16 @@ export default struct CustomLayout {
this.animate2()
}else if (this.refreshBean.loadStatus == LoadStatus.GOLOADED) {
this.textVisible = true
if (tmpHeight <= 0) {
setTimeout(() => {
// 延时设置0,让“已更新到最新”展示
this.textVisible = false
this.setHeight0WithAnimation()
}, 800)
}
} else {
// 刷新完成
!!this.animateItem && lottie.destroy(this.animateName)
!!this.animateItem2 && lottie.destroy(this.animateName2)
this.textVisible = false
this.setHeight0WithAnimation()
}
let maxH = CustomLayout.REFRESH_HEIGHT
let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset
if (this.refreshBean.loadStatus === LoadStatus.LOADED) {
} else {
...
...
@@ -159,7 +156,7 @@ export default struct CustomLayout {
setHeight0WithAnimation() {
// this.layoutHeight = 0
animateTo({
duration:
5
00, // 动画时长
duration:
3
00, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
...
...
Please
register
or
login
to post a comment