1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

added ZLTextView.getProgress() method

This commit is contained in:
Nikolay Pultsin 2013-10-08 00:07:51 +01:00
parent 02c0c0f54e
commit e9fa03ed9b

View file

@ -23,6 +23,7 @@ import java.util.*;
import org.geometerplus.zlibrary.core.application.ZLApplication;
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
import org.geometerplus.zlibrary.core.util.RationalNumber;
import org.geometerplus.zlibrary.core.util.ZLColor;
import org.geometerplus.zlibrary.core.view.ZLPaintContext;
@ -767,6 +768,11 @@ public abstract class ZLTextView extends ZLTextViewBase {
return new PagePosition(current, total);
}
public final RationalNumber getProgress() {
final PagePosition position = pagePosition();
return RationalNumber.create(position.Current, position.Total);
}
public final synchronized void gotoPage(int page) {
if (myModel == null || myModel.getParagraphsNumber() == 0) {
return;