package com.joanzapata.pdfview;

import android.content.Context;
import android.util.AttributeSet;

public class SingleRenderPDFView extends PDFView {

    /**
     * Construct the initial view
     *
     * @param context
     * @param set
     */
    public SingleRenderPDFView(Context context, AttributeSet set) {
        super(context, set);
    }

    /**
     * Overload the loadPage method to keep zoom level at 1f.
     * This dramatically improves performance for loading pages and
     * prevents pages from being blurred out when zooming in.
     *
     * @param userPage          The user page to load.
     * @param nbOfPartsLoadable Maximum number of parts it can load.
     * @param zoom              Zoom level which is used to calculate block size.
     */
    @Override
    protected int loadPage(final int userPage, final int nbOfPartsLoadable, final float zoom) {
        return super.loadPage(userPage, nbOfPartsLoadable, 1f);
    }
}
