mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
intorduced vibility field in Bookmark
This commit is contained in:
parent
f7ef6cb250
commit
41eb07e7bf
9 changed files with 67 additions and 31 deletions
|
@ -4,6 +4,7 @@
|
||||||
* Scrolling speed improvement for large books
|
* Scrolling speed improvement for large books
|
||||||
* Vietnamese translation has been updated (by Phạm Văn Hùng)
|
* Vietnamese translation has been updated (by Phạm Văn Hùng)
|
||||||
* Czech translation has been updated (by Marek Pavelka)
|
* Czech translation has been updated (by Marek Pavelka)
|
||||||
|
* Cancel button preesing calls a menu of actions
|
||||||
|
|
||||||
===== 0.99.6 (Jan 22, 2011) =====
|
===== 0.99.6 (Jan 22, 2011) =====
|
||||||
* Wallpaper drawing speed-up
|
* Wallpaper drawing speed-up
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
android:id="@+id/cancel_item_title"
|
android:id="@+id/cancel_item_title"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
|
|
|
@ -223,7 +223,8 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte
|
||||||
final Bookmark bookmark = new Bookmark(
|
final Bookmark bookmark = new Bookmark(
|
||||||
fbreader.Model.Book,
|
fbreader.Model.Book,
|
||||||
textView.getModel().getId(),
|
textView.getModel().getId(),
|
||||||
cursor
|
cursor,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
myThisBookBookmarks.add(0, bookmark);
|
myThisBookBookmarks.add(0, bookmark);
|
||||||
AllBooksBookmarks.add(0, bookmark);
|
AllBooksBookmarks.add(0, bookmark);
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class CancelActivity extends ListActivity {
|
||||||
final ActionListAdapter adapter = new ActionListAdapter(getIntent());
|
final ActionListAdapter adapter = new ActionListAdapter(getIntent());
|
||||||
setListAdapter(adapter);
|
setListAdapter(adapter);
|
||||||
getListView().setOnItemClickListener(adapter);
|
getListView().setOnItemClickListener(adapter);
|
||||||
|
setResult(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ActionListAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
private class ActionListAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
||||||
|
@ -76,9 +77,14 @@ public class CancelActivity extends ListActivity {
|
||||||
if (summary != null) {
|
if (summary != null) {
|
||||||
summaryView.setVisibility(View.VISIBLE);
|
summaryView.setVisibility(View.VISIBLE);
|
||||||
summaryView.setText(summary);
|
summaryView.setText(summary);
|
||||||
|
titleView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
summaryView.setVisibility(View.GONE);
|
summaryView.setVisibility(View.GONE);
|
||||||
titleView.setGravity(Gravity.CENTER_VERTICAL);
|
titleView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT
|
||||||
|
));
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
|
|
||||||
private void migrate(Context context) {
|
private void migrate(Context context) {
|
||||||
final int version = myDatabase.getVersion();
|
final int version = myDatabase.getVersion();
|
||||||
final int currentVersion = 13;
|
final int currentVersion = 14;
|
||||||
if (version >= currentVersion) {
|
if (version >= currentVersion) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,8 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
updateTables11();
|
updateTables11();
|
||||||
case 12:
|
case 12:
|
||||||
updateTables12();
|
updateTables12();
|
||||||
|
case 13:
|
||||||
|
updateTables13();
|
||||||
}
|
}
|
||||||
myDatabase.setTransactionSuccessful();
|
myDatabase.setTransactionSuccessful();
|
||||||
myDatabase.endTransaction();
|
myDatabase.endTransaction();
|
||||||
|
@ -695,10 +697,11 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Bookmark> loadBookmarks(long bookId) {
|
@Override
|
||||||
|
protected List<Bookmark> loadBookmarks(long bookId, boolean visible) {
|
||||||
LinkedList<Bookmark> list = new LinkedList<Bookmark>();
|
LinkedList<Bookmark> list = new LinkedList<Bookmark>();
|
||||||
Cursor cursor = myDatabase.rawQuery(
|
Cursor cursor = myDatabase.rawQuery(
|
||||||
"SELECT Bookmarks.bookmark_id,Bookmarks.book_id,Books.title,Bookmarks.bookmark_text,Bookmarks.creation_time,Bookmarks.modification_time,Bookmarks.access_time,Bookmarks.access_counter,Bookmarks.model_id,Bookmarks.paragraph,Bookmarks.word,Bookmarks.char FROM Bookmarks INNER JOIN Books ON Books.book_id = Bookmarks.book_id WHERE book_id = ?", new String[] { "" + bookId }
|
"SELECT Bookmarks.bookmark_id,Bookmarks.book_id,Books.title,Bookmarks.bookmark_text,Bookmarks.creation_time,Bookmarks.modification_time,Bookmarks.access_time,Bookmarks.access_counter,Bookmarks.model_id,Bookmarks.paragraph,Bookmarks.word,Bookmarks.char FROM Bookmarks INNER JOIN Books ON Books.book_id = Bookmarks.book_id WHERE Bookmarks.book_id = ? AND Bookmarks.visible = ?", new String[] { "" + bookId, visible ? "1" : "0" }
|
||||||
);
|
);
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
list.add(createBookmark(
|
list.add(createBookmark(
|
||||||
|
@ -713,18 +716,20 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
cursor.getString(8),
|
cursor.getString(8),
|
||||||
(int)cursor.getLong(9),
|
(int)cursor.getLong(9),
|
||||||
(int)cursor.getLong(10),
|
(int)cursor.getLong(10),
|
||||||
(int)cursor.getLong(11)
|
(int)cursor.getLong(11),
|
||||||
|
visible
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Bookmark> loadAllBookmarks() {
|
@Override
|
||||||
|
protected List<Bookmark> loadAllVisibleBookmarks() {
|
||||||
LinkedList<Bookmark> list = new LinkedList<Bookmark>();
|
LinkedList<Bookmark> list = new LinkedList<Bookmark>();
|
||||||
myDatabase.execSQL("DELETE FROM Bookmarks WHERE book_id = -1");
|
myDatabase.execSQL("DELETE FROM Bookmarks WHERE book_id = -1");
|
||||||
Cursor cursor = myDatabase.rawQuery(
|
Cursor cursor = myDatabase.rawQuery(
|
||||||
"SELECT Bookmarks.bookmark_id,Bookmarks.book_id,Books.title,Bookmarks.bookmark_text,Bookmarks.creation_time,Bookmarks.modification_time,Bookmarks.access_time,Bookmarks.access_counter,Bookmarks.model_id,Bookmarks.paragraph,Bookmarks.word,Bookmarks.char FROM Bookmarks INNER JOIN Books ON Books.book_id = Bookmarks.book_id", null
|
"SELECT Bookmarks.bookmark_id,Bookmarks.book_id,Books.title,Bookmarks.bookmark_text,Bookmarks.creation_time,Bookmarks.modification_time,Bookmarks.access_time,Bookmarks.access_counter,Bookmarks.model_id,Bookmarks.paragraph,Bookmarks.word,Bookmarks.char FROM Bookmarks INNER JOIN Books ON Books.book_id = Bookmarks.book_id WHERE Bookmarks.visible = 1", null
|
||||||
);
|
);
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
list.add(createBookmark(
|
list.add(createBookmark(
|
||||||
|
@ -739,7 +744,8 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
cursor.getString(8),
|
cursor.getString(8),
|
||||||
(int)cursor.getLong(9),
|
(int)cursor.getLong(9),
|
||||||
(int)cursor.getLong(10),
|
(int)cursor.getLong(10),
|
||||||
(int)cursor.getLong(11)
|
(int)cursor.getLong(11),
|
||||||
|
true
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
@ -748,19 +754,20 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
|
|
||||||
private SQLiteStatement myInsertBookmarkStatement;
|
private SQLiteStatement myInsertBookmarkStatement;
|
||||||
private SQLiteStatement myUpdateBookmarkStatement;
|
private SQLiteStatement myUpdateBookmarkStatement;
|
||||||
|
@Override
|
||||||
protected long saveBookmark(Bookmark bookmark) {
|
protected long saveBookmark(Bookmark bookmark) {
|
||||||
SQLiteStatement statement;
|
SQLiteStatement statement;
|
||||||
if (bookmark.getId() == -1) {
|
if (bookmark.getId() == -1) {
|
||||||
if (myInsertBookmarkStatement == null) {
|
if (myInsertBookmarkStatement == null) {
|
||||||
myInsertBookmarkStatement = myDatabase.compileStatement(
|
myInsertBookmarkStatement = myDatabase.compileStatement(
|
||||||
"INSERT OR IGNORE INTO Bookmarks (book_id,bookmark_text,creation_time,modification_time,access_time,access_counter,model_id,paragraph,word,char) VALUES (?,?,?,?,?,?,?,?,?,?)"
|
"INSERT OR IGNORE INTO Bookmarks (book_id,bookmark_text,creation_time,modification_time,access_time,access_counter,model_id,paragraph,word,char,visible) VALUES (?,?,?,?,?,?,?,?,?,?,?)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
statement = myInsertBookmarkStatement;
|
statement = myInsertBookmarkStatement;
|
||||||
} else {
|
} else {
|
||||||
if (myUpdateBookmarkStatement == null) {
|
if (myUpdateBookmarkStatement == null) {
|
||||||
myUpdateBookmarkStatement = myDatabase.compileStatement(
|
myUpdateBookmarkStatement = myDatabase.compileStatement(
|
||||||
"UPDATE Bookmarks SET book_id = ?, bookmark_text = ?, creation_time =?, modification_time = ?,access_time = ?, access_counter = ?, model_id = ?, paragraph = ?, word = ?, char = ? WHERE bookmark_id = ?"
|
"UPDATE Bookmarks SET book_id = ?, bookmark_text = ?, creation_time =?, modification_time = ?,access_time = ?, access_counter = ?, model_id = ?, paragraph = ?, word = ?, char = ?, visible = ? WHERE bookmark_id = ?"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
statement = myUpdateBookmarkStatement;
|
statement = myUpdateBookmarkStatement;
|
||||||
|
@ -772,22 +779,24 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
bindDate(statement, 4, bookmark.getTime(Bookmark.MODIFICATION));
|
bindDate(statement, 4, bookmark.getTime(Bookmark.MODIFICATION));
|
||||||
bindDate(statement, 5, bookmark.getTime(Bookmark.ACCESS));
|
bindDate(statement, 5, bookmark.getTime(Bookmark.ACCESS));
|
||||||
statement.bindLong(6, bookmark.getAccessCount());
|
statement.bindLong(6, bookmark.getAccessCount());
|
||||||
bindString(statement, 7, bookmark.getModelId());
|
bindString(statement, 7, bookmark.ModelId);
|
||||||
statement.bindLong(8, bookmark.ParagraphIndex);
|
statement.bindLong(8, bookmark.ParagraphIndex);
|
||||||
statement.bindLong(9, bookmark.ElementIndex);
|
statement.bindLong(9, bookmark.ElementIndex);
|
||||||
statement.bindLong(10, bookmark.CharIndex);
|
statement.bindLong(10, bookmark.CharIndex);
|
||||||
|
statement.bindLong(11, bookmark.IsVisible ? 1 : 0);
|
||||||
|
|
||||||
if (statement == myInsertBookmarkStatement) {
|
if (statement == myInsertBookmarkStatement) {
|
||||||
return statement.executeInsert();
|
return statement.executeInsert();
|
||||||
} else {
|
} else {
|
||||||
final long id = bookmark.getId();
|
final long id = bookmark.getId();
|
||||||
statement.bindLong(11, id);
|
statement.bindLong(12, id);
|
||||||
statement.execute();
|
statement.execute();
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SQLiteStatement myDeleteBookmarkStatement;
|
private SQLiteStatement myDeleteBookmarkStatement;
|
||||||
|
@Override
|
||||||
protected void deleteBookmark(Bookmark bookmark) {
|
protected void deleteBookmark(Bookmark bookmark) {
|
||||||
if (myDeleteBookmarkStatement == null) {
|
if (myDeleteBookmarkStatement == null) {
|
||||||
myDeleteBookmarkStatement = myDatabase.compileStatement(
|
myDeleteBookmarkStatement = myDatabase.compileStatement(
|
||||||
|
@ -1134,4 +1143,10 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
||||||
private void updateTables12() {
|
private void updateTables12() {
|
||||||
myDatabase.execSQL("DELETE FROM Files WHERE parent_id IN (SELECT file_id FROM Files WHERE name LIKE '%.epub')");
|
myDatabase.execSQL("DELETE FROM Files WHERE parent_id IN (SELECT file_id FROM Files WHERE name LIKE '%.epub')");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateTables13() {
|
||||||
|
myDatabase.execSQL(
|
||||||
|
"ALTER TABLE Bookmarks ADD COLUMN visible INTEGER DEFAULT 1"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,9 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openBook(final Book book, final Bookmark bookmark) {
|
public void openBook(final Book book, final Bookmark bookmark) {
|
||||||
|
if (book == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Model != null) {
|
if (Model != null) {
|
||||||
if (bookmark == null & book.File.getPath().equals(Model.Book.File.getPath())) {
|
if (bookmark == null & book.File.getPath().equals(Model.Book.File.getPath())) {
|
||||||
return;
|
return;
|
||||||
|
@ -234,7 +237,7 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void gotoBookmark(Bookmark bookmark) {
|
public void gotoBookmark(Bookmark bookmark) {
|
||||||
final String modelId = bookmark.getModelId();
|
final String modelId = bookmark.ModelId;
|
||||||
if (modelId == null) {
|
if (modelId == null) {
|
||||||
BookTextView.gotoPosition(bookmark);
|
BookTextView.gotoPosition(bookmark);
|
||||||
setView(BookTextView);
|
setView(BookTextView);
|
||||||
|
@ -309,9 +312,12 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
|
|
||||||
public List<CancelActionDescription> getCancelActionsList() {
|
public List<CancelActionDescription> getCancelActionsList() {
|
||||||
myCancelActionsList.clear();
|
myCancelActionsList.clear();
|
||||||
|
final Book previousBook = Library.getPreviousBook();
|
||||||
|
if (previousBook != null) {
|
||||||
myCancelActionsList.add(new CancelActionDescription(
|
myCancelActionsList.add(new CancelActionDescription(
|
||||||
CancelActionType.previousBook, "this is a summary"
|
CancelActionType.previousBook, previousBook.getTitle()
|
||||||
));
|
));
|
||||||
|
}
|
||||||
myCancelActionsList.add(new CancelActionDescription(
|
myCancelActionsList.add(new CancelActionDescription(
|
||||||
CancelActionType.gotoPosition, "this is a summary"
|
CancelActionType.gotoPosition, "this is a summary"
|
||||||
));
|
));
|
||||||
|
@ -335,6 +341,7 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
final CancelActionDescription description = myCancelActionsList.get(index);
|
final CancelActionDescription description = myCancelActionsList.get(index);
|
||||||
switch (description.Type) {
|
switch (description.Type) {
|
||||||
case previousBook:
|
case previousBook:
|
||||||
|
openBook(Library.getPreviousBook(), null);
|
||||||
break;
|
break;
|
||||||
case gotoPosition:
|
case gotoPosition:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public final class Bookmark extends ZLTextFixedPosition {
|
||||||
public final static int LATEST = 3;
|
public final static int LATEST = 3;
|
||||||
|
|
||||||
public static List<Bookmark> bookmarks() {
|
public static List<Bookmark> bookmarks() {
|
||||||
return BooksDatabase.Instance().loadAllBookmarks();
|
return BooksDatabase.Instance().loadAllVisibleBookmarks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private long myId;
|
private long myId;
|
||||||
|
@ -42,11 +42,13 @@ public final class Bookmark extends ZLTextFixedPosition {
|
||||||
private Date myAccessDate;
|
private Date myAccessDate;
|
||||||
private int myAccessCount;
|
private int myAccessCount;
|
||||||
private Date myLatestDate;
|
private Date myLatestDate;
|
||||||
private final String myModelId;
|
|
||||||
|
public final String ModelId;
|
||||||
|
public final boolean IsVisible;
|
||||||
|
|
||||||
private boolean myIsChanged;
|
private boolean myIsChanged;
|
||||||
|
|
||||||
Bookmark(long id, long bookId, String bookTitle, String text, Date creationDate, Date modificationDate, Date accessDate, int accessCount, String modelId, int paragraphIndex, int elementIndex, int charIndex) {
|
Bookmark(long id, long bookId, String bookTitle, String text, Date creationDate, Date modificationDate, Date accessDate, int accessCount, String modelId, int paragraphIndex, int elementIndex, int charIndex, boolean isVisible) {
|
||||||
super(paragraphIndex, elementIndex, charIndex);
|
super(paragraphIndex, elementIndex, charIndex);
|
||||||
|
|
||||||
myId = id;
|
myId = id;
|
||||||
|
@ -63,11 +65,12 @@ public final class Bookmark extends ZLTextFixedPosition {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myAccessCount = accessCount;
|
myAccessCount = accessCount;
|
||||||
myModelId = modelId;
|
ModelId = modelId;
|
||||||
|
IsVisible = isVisible;
|
||||||
myIsChanged = false;
|
myIsChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bookmark(Book book, String modelId, ZLTextWordCursor cursor) {
|
public Bookmark(Book book, String modelId, ZLTextWordCursor cursor, boolean isVisible) {
|
||||||
super(cursor);
|
super(cursor);
|
||||||
|
|
||||||
myId = -1;
|
myId = -1;
|
||||||
|
@ -75,7 +78,8 @@ public final class Bookmark extends ZLTextFixedPosition {
|
||||||
myBookTitle = book.getTitle();
|
myBookTitle = book.getTitle();
|
||||||
myText = createBookmarkText(cursor, 20);
|
myText = createBookmarkText(cursor, 20);
|
||||||
myCreationDate = new Date();
|
myCreationDate = new Date();
|
||||||
myModelId = modelId;
|
ModelId = modelId;
|
||||||
|
IsVisible = isVisible;
|
||||||
myIsChanged = true;
|
myIsChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,10 +99,6 @@ public final class Bookmark extends ZLTextFixedPosition {
|
||||||
return myBookTitle;
|
return myBookTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModelId() {
|
|
||||||
return myModelId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getTime(int timeStamp) {
|
public Date getTime(int timeStamp) {
|
||||||
switch (timeStamp) {
|
switch (timeStamp) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -89,12 +89,12 @@ public abstract class BooksDatabase {
|
||||||
protected abstract void addToFavorites(long bookId);
|
protected abstract void addToFavorites(long bookId);
|
||||||
protected abstract void removeFromFavorites(long bookId);
|
protected abstract void removeFromFavorites(long bookId);
|
||||||
|
|
||||||
protected Bookmark createBookmark(long id, long bookId, String bookTitle, String text, Date creationDate, Date modificationDate, Date accessDate, int accessCounter, String modelId, int paragraphIndex, int wordIndex, int charIndex) {
|
protected Bookmark createBookmark(long id, long bookId, String bookTitle, String text, Date creationDate, Date modificationDate, Date accessDate, int accessCounter, String modelId, int paragraphIndex, int wordIndex, int charIndex, boolean isVisible) {
|
||||||
return new Bookmark(id, bookId, bookTitle, text, creationDate, modificationDate, accessDate, accessCounter, modelId, paragraphIndex, wordIndex, charIndex);
|
return new Bookmark(id, bookId, bookTitle, text, creationDate, modificationDate, accessDate, accessCounter, modelId, paragraphIndex, wordIndex, charIndex, isVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract List<Bookmark> loadBookmarks(long bookId);
|
protected abstract List<Bookmark> loadBookmarks(long bookId, boolean isVisible);
|
||||||
protected abstract List<Bookmark> loadAllBookmarks();
|
protected abstract List<Bookmark> loadAllVisibleBookmarks();
|
||||||
protected abstract long saveBookmark(Bookmark bookmark);
|
protected abstract long saveBookmark(Bookmark bookmark);
|
||||||
protected abstract void deleteBookmark(Bookmark bookmark);
|
protected abstract void deleteBookmark(Bookmark bookmark);
|
||||||
|
|
||||||
|
|
|
@ -378,6 +378,11 @@ public final class Library {
|
||||||
return (recentIds.size() > 0) ? Book.getById(recentIds.get(0)) : null;
|
return (recentIds.size() > 0) ? Book.getById(recentIds.get(0)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Book getPreviousBook() {
|
||||||
|
List<Long> recentIds = BooksDatabase.Instance().loadRecentBookIds();
|
||||||
|
return (recentIds.size() > 1) ? Book.getById(recentIds.get(1)) : null;
|
||||||
|
}
|
||||||
|
|
||||||
public LibraryTree favorites() {
|
public LibraryTree favorites() {
|
||||||
waitForState(STATE_FULLY_INITIALIZED);
|
waitForState(STATE_FULLY_INITIALIZED);
|
||||||
return myFavorites;
|
return myFavorites;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue