You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
postOnAnimation: add minimum delay of 1/60 s
This fixes smooth animations like kinetic scrolling
This commit is contained in:
@@ -1494,10 +1494,12 @@ public class View extends Object {
|
|||||||
public boolean isLaidOut() {return true;}
|
public boolean isLaidOut() {return true;}
|
||||||
|
|
||||||
public void postOnAnimation(Runnable action) {
|
public void postOnAnimation(Runnable action) {
|
||||||
post(action);
|
postDelayed(action, 1000 / 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postOnAnimationDelayed(Runnable action, long delayMillis) {
|
public void postOnAnimationDelayed(Runnable action, long delayMillis) {
|
||||||
|
if (delayMillis < 1000 / 60)
|
||||||
|
delayMillis = 1000 / 60;
|
||||||
postDelayed(action, delayMillis);
|
postDelayed(action, delayMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user