mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
no Library.Instance() in FBReaderApp, IBookCollection is used instead
This commit is contained in:
parent
522d32a585
commit
be4bf6c174
8 changed files with 44 additions and 37 deletions
|
@ -143,6 +143,19 @@ public class BookCollectionShadow implements IBookCollection, ServiceConnection
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized List<Bookmark> invisibleBookmarks(Book book) {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return SerializerUtil.deserializeBookmarkList(
|
||||
myInterface.invisibleBookmarks(SerializerUtil.serialize(book))
|
||||
);
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized List<Bookmark> allBookmarks() {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
|
|
|
@ -18,6 +18,7 @@ interface LibraryInterface {
|
|||
void addBookToRecentList(in String book);
|
||||
void setBookFavorite(in String book, in boolean favorite);
|
||||
|
||||
List<String> invisibleBookmarks(in String book);
|
||||
List<String> allBookmarks();
|
||||
String saveBookmark(in String bookmark);
|
||||
void deleteBookmark(in String bookmark);
|
||||
|
|
|
@ -157,6 +157,12 @@ public class LibraryService extends Service {
|
|||
myCollection.setBookFavorite(SerializerUtil.deserializeBook(book), favorite);
|
||||
}
|
||||
|
||||
public List<String> invisibleBookmarks(String book) {
|
||||
return SerializerUtil.serializeBookmarkList(
|
||||
myCollection.invisibleBookmarks(SerializerUtil.deserializeBook(book))
|
||||
);
|
||||
}
|
||||
|
||||
public List<String> allBookmarks() {
|
||||
return SerializerUtil.serializeBookmarkList(myCollection.allBookmarks());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue