postOnAnimation: add minimum delay of 1/60 s

This fixes smooth animations like kinetic scrolling
This commit is contained in:
Julian Winkler
2024-02-25 17:57:02 +01:00
parent c61e8b8f53
commit ddc36f5ccc

View File

@@ -1494,10 +1494,12 @@ public class View extends Object {
public boolean isLaidOut() {return true;}
public void postOnAnimation(Runnable action) {
post(action);
postDelayed(action, 1000 / 60);
}
public void postOnAnimationDelayed(Runnable action, long delayMillis) {
if (delayMillis < 1000 / 60)
delayMillis = 1000 / 60;
postDelayed(action, delayMillis);
}