1
0
Fork 0
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:
Nikolay Pultsin 2013-01-15 05:59:08 +04:00
parent 42a38f3ab9
commit e8b6c001ff
7 changed files with 101 additions and 65 deletions

View file

@ -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();
}

View file

@ -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);

View 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));
}