Comments (5)
@zhanyongsheng any idea what could be the reason for this?
from brokenview.
I'm seeing the same issue on Android 8. Doesn't happen on Android 6.
from brokenview.
The problem seems to be in BrokenAnimator here:
if (fraction > 0.8 && bPressed) {
canReverse = false;
setRepeatCount(1);
}
Not exactly sure what the problem is, but I think this is where the repeated animation is set up.
from brokenview.
Here's a hack that gets around the repeating animation. It's probably not the best solution, but it works so I'll use it for now. In BrokenAnimator.draw change:
public boolean draw(Canvas canvas) {
if (!isStarted()) {
return false;
}
float fraction = getAnimatedFraction();
To this:
private HashMap<Integer,Float> stageToPercentageMap = new HashMap<>();
public boolean draw(Canvas canvas) {
if (!isStarted()) {
return false;
}
float whatAndroidThinksThePercentageIs = getAnimatedFraction();
if (stageToPercentageMap.get(getStage()) == null ||
stageToPercentageMap.get(getStage()) < whatAndroidThinksThePercentageIs)
{
stageToPercentageMap.put(getStage(),whatAndroidThinksThePercentageIs);
}
float fraction = stageToPercentageMap.get(getStage());
Android 8 seems to be running the animation too quickly and we end up getting a repeated FALLING state. Basically, this just makes sure that the percentage completion for each state is always going UP, not down.
from brokenview.
@metaphyze thx. How about a Pull Request, so the owner of this project will hopefully review and merge it.
from brokenview.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brokenview.