Adding annimation effects to mobile PDFVIewCtrl when rendering is finished

Q:

I am using PDFTron Mobile SDK on Android (and letter on iOS & WinRT).

Other question is if it’s possible to set a translate animation when rendering is finished?

A:

The PDFViewCtrl does not have any animation implemented when rendering the pages, ie, once the page is rendered it will be displayed. Since PDFViewCtrl is a view, what you can try to do to achieve the animation is to use the Animation API that Android provides (http://developer.android.com/guide/topics/graphics/index.html). For example, you could extend the PDFViewCtrl.RenderingListener and override onRenderingFinished() with something like this (http://stackoverflow.com/questions/5090285/using-fade-in-animation-for-a-view):

@Override

public void onRenderingFinished() {

Animation fadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_fadein);

mPDFView.clearAnimation();

mPDFView.startAnimation(fadeInAnimation);

}

where anim.fadein.xml:

<?xml version="1.0" encoding="utf-8"?>

<alpha android:fromAlpha=“0.5” android:toAlpha=“1.0”

android:interpolator="@android:anim/accelerate_interpolator"

android:duration=“1000”/>

Keep in mind that this will apply the animation to the whole view. Also, it can be a little tricky since onRenderingFinished can be called several times.