mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
fixed ANR
This commit is contained in:
parent
224cea97c1
commit
c2bafbed15
2 changed files with 17 additions and 15 deletions
|
@ -624,27 +624,29 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final ZLTextView textView = getTextView();
|
|
||||||
// textView.model will not be changed inside synchronised block
|
|
||||||
synchronized (textView) {
|
|
||||||
final BookModel model = Model;
|
|
||||||
final Book book = model != null ? model.Book : null;
|
|
||||||
if (book == null || textView != BookTextView || textView.getModel() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cursor = new ZLTextWordCursor(cursor);
|
cursor = new ZLTextWordCursor(cursor);
|
||||||
if (cursor.isNull()) {
|
if (cursor.isNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateInvisibleBookmarksList(new Bookmark(
|
final ZLTextView textView = getTextView();
|
||||||
Collection,
|
final ZLTextModel textModel;
|
||||||
book,
|
final Book book;
|
||||||
textView.getModel().getId(),
|
final AutoTextSnippet snippet;
|
||||||
new AutoTextSnippet(cursor, 30),
|
// textView.model will not be changed inside synchronised block
|
||||||
false
|
synchronized (textView) {
|
||||||
));
|
textModel = textView.getModel();
|
||||||
|
final BookModel model = Model;
|
||||||
|
book = model != null ? model.Book : null;
|
||||||
|
if (book == null || textView != BookTextView || textModel == null) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
snippet = new AutoTextSnippet(cursor, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateInvisibleBookmarksList(new Bookmark(
|
||||||
|
Collection, book, textModel.getId(), snippet, false
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addInvisibleBookmark() {
|
public void addInvisibleBookmark() {
|
||||||
|
|
|
@ -89,7 +89,7 @@ public abstract class ZLTextView extends ZLTextViewBase {
|
||||||
Application.getViewWidget().reset();
|
Application.getViewWidget().reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ZLTextModel getModel() {
|
public final ZLTextModel getModel() {
|
||||||
return myModel;
|
return myModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue