Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class AnimationManager {

private boolean pageFlinging = false;

private long animationDuration = 400;

public AnimationManager(PDFView pdfView) {
this.pdfView = pdfView;
scroller = new OverScroller(pdfView.getContext());
Expand All @@ -55,7 +57,7 @@ public void startXAnimation(float xFrom, float xTo) {
animation.setInterpolator(new DecelerateInterpolator());
animation.addUpdateListener(xAnimation);
animation.addListener(xAnimation);
animation.setDuration(400);
animation.setDuration(animationDuration);
animation.start();
}

Expand All @@ -66,7 +68,7 @@ public void startYAnimation(float yFrom, float yTo) {
animation.setInterpolator(new DecelerateInterpolator());
animation.addUpdateListener(yAnimation);
animation.addListener(yAnimation);
animation.setDuration(400);
animation.setDuration(animationDuration);
animation.start();
}

Expand All @@ -77,7 +79,7 @@ public void startZoomAnimation(float centerX, float centerY, float zoomFrom, flo
ZoomAnimation zoomAnim = new ZoomAnimation(centerX, centerY);
animation.addUpdateListener(zoomAnim);
animation.addListener(zoomAnim);
animation.setDuration(400);
animation.setDuration(animationDuration);
animation.start();
}

Expand Down Expand Up @@ -125,6 +127,14 @@ public boolean isFlinging() {
return flinging || pageFlinging;
}

public void setAnimationDuration(long animationDuration) {
this.animationDuration = animationDuration;
}

public long getAnimationDuration() {
return animationDuration;
}

class XAnimation extends AnimatorListenerAdapter implements AnimatorUpdateListener {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,11 @@ public Configurator disableLongpress() {
return this;
}

public Configurator animationDuration(long duration){
animationManager.setAnimationDuration(duration);
return this;
}

public void load() {
if (!hasSize) {
waitingDocumentConfigurator = this;
Expand Down