Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_flowbox
Commits
abe1204a
Commit
abe1204a
authored
Jul 01, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决首页内存泄漏
parent
12f9ab31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
CircleProgress.java
...ain/java/com/mints/flowbox/ui/widgets/CircleProgress.java
+3
-1
CycleProgress.java
...main/java/com/mints/flowbox/ui/widgets/CycleProgress.java
+6
-7
No files found.
app/src/main/java/com/mints/flowbox/ui/widgets/CircleProgress.java
View file @
abe1204a
...
...
@@ -331,7 +331,9 @@ public class CircleProgress extends View {
}
private
void
startAnimator
(
float
start
,
float
end
,
long
animTime
)
{
mAnimator
=
ValueAnimator
.
ofFloat
(
start
,
end
);
if
(
mAnimator
==
null
)
{
mAnimator
=
ValueAnimator
.
ofFloat
(
start
,
end
);
}
mAnimator
.
setDuration
(
animTime
);
mAnimator
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
@Override
...
...
app/src/main/java/com/mints/flowbox/ui/widgets/CycleProgress.java
View file @
abe1204a
...
...
@@ -123,7 +123,9 @@ public class CycleProgress extends View {
delta
=
delta
==
0
?
1
:
delta
;
mProgressWidth
=
(
int
)
(
progress
*
mViewWidth
);
mAnimator
=
ValueAnimator
.
ofFloat
(
0
,
progress
).
setDuration
(
delta
*
DURATION
);
if
(
mAnimator
==
null
)
{
mAnimator
=
ValueAnimator
.
ofFloat
(
0
,
progress
).
setDuration
(
delta
*
DURATION
);
}
mAnimator
.
setRepeatCount
(
ValueAnimator
.
INFINITE
);
ValueAnimator
.
AnimatorUpdateListener
mUpdateListener
=
animation
->
{
...
...
@@ -136,16 +138,13 @@ public class CycleProgress extends View {
}
public
void
resumeAnim
()
{
if
(
mAnimator
!=
null
)
{
mAnimator
.
resume
();
}
else
{
startAnim
();
}
startAnim
();
}
public
void
pauseAnim
()
{
if
(
mAnimator
!=
null
)
{
mAnimator
.
pause
();
mAnimator
.
cancel
();
mAnimator
.
removeAllUpdateListeners
();
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment