mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
library initialization
Conflicts: src/org/geometerplus/fbreader/book/BookCollection.java
This commit is contained in:
parent
42a38f3ab9
commit
e8b6c001ff
7 changed files with 101 additions and 65 deletions
|
@ -100,12 +100,23 @@ public class BookCollectionShadow extends AbstractBookCollection implements Serv
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized List<Book> books() {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return SerializerUtil.deserializeBookList(myInterface.books());
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized List<Book> books(String pattern) {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return SerializerUtil.deserializeBookList(myInterface.books(pattern));
|
||||
return SerializerUtil.deserializeBookList(myInterface.booksForPattern(pattern));
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ import org.geometerplus.android.fbreader.api.TextPosition;
|
|||
|
||||
interface LibraryInterface {
|
||||
int size();
|
||||
List<String> books(in String pattern);
|
||||
List<String> books();
|
||||
List<String> booksForPattern(in String pattern);
|
||||
List<String> recentBooks();
|
||||
List<String> favorites();
|
||||
String getBookByFile(in String file);
|
||||
|
|
|
@ -116,7 +116,11 @@ public class LibraryService extends Service {
|
|||
return myCollection.size();
|
||||
}
|
||||
|
||||
public List<String> books(String pattern) {
|
||||
public List<String> books() {
|
||||
return SerializerUtil.serializeBookList(myCollection.books());
|
||||
}
|
||||
|
||||
public List<String> booksForPattern(String pattern) {
|
||||
return SerializerUtil.serializeBookList(myCollection.books(pattern));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue