mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
API setPageStart metod saves text position
This commit is contained in:
parent
51ed7d79b5
commit
a4c380501f
3 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
===== 1.6.3 (Oct ??, 2012) =====
|
||||||
|
* FBReader stores text position after setPageStart API method (useful for TTS plugin, code by Greg Kochaniak)
|
||||||
|
|
||||||
===== 1.6.2 (Oct 13, 2012) =====
|
===== 1.6.2 (Oct 13, 2012) =====
|
||||||
* Optimized animation speed
|
* Optimized animation speed
|
||||||
* Fixes in database code
|
* Fixes in database code
|
||||||
|
|
|
@ -391,6 +391,7 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
||||||
public void setPageStart(TextPosition position) {
|
public void setPageStart(TextPosition position) {
|
||||||
myReader.getTextView().gotoPosition(position.ParagraphIndex, position.ElementIndex, position.CharIndex);
|
myReader.getTextView().gotoPosition(position.ParagraphIndex, position.ElementIndex, position.CharIndex);
|
||||||
myReader.getViewWidget().repaint();
|
myReader.getViewWidget().repaint();
|
||||||
|
myReader.storePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void highlightArea(TextPosition start, TextPosition end) {
|
public void highlightArea(TextPosition start, TextPosition end) {
|
||||||
|
|
|
@ -245,9 +245,7 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
if (book != null) {
|
if (book != null) {
|
||||||
onViewChanged();
|
onViewChanged();
|
||||||
|
|
||||||
if (Model != null) {
|
storePosition();
|
||||||
Model.Book.storePosition(BookTextView.getStartCursor());
|
|
||||||
}
|
|
||||||
BookTextView.setModel(null);
|
BookTextView.setModel(null);
|
||||||
FootnoteView.setModel(null);
|
FootnoteView.setModel(null);
|
||||||
clearTextCaches();
|
clearTextCaches();
|
||||||
|
@ -362,6 +360,10 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onWindowClosing() {
|
public void onWindowClosing() {
|
||||||
|
storePosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void storePosition() {
|
||||||
if (Model != null && BookTextView != null) {
|
if (Model != null && BookTextView != null) {
|
||||||
Model.Book.storePosition(BookTextView.getStartCursor());
|
Model.Book.storePosition(BookTextView.getStartCursor());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue