mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-12-22 14:48:23 -05:00
More skeleton updates to make things look nice
This commit is contained in:
parent
302ae9d6f4
commit
1df6a13735
@ -72,7 +72,7 @@ public class BookFragment extends BaseFragment {
|
||||
false);
|
||||
((Injector)getActivity()).inject(this);
|
||||
// TODO: Defer lookup until after webview created? When exactly is WebView created?
|
||||
this.lookupService = new VerseLookupService(mBook.get(), this.getActivity());
|
||||
this.lookupService = new VerseLookupService(mBook.get());
|
||||
ButterKnife.inject(this, rootView);
|
||||
mainContent.getSettings().setJavaScriptEnabled(true);
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
package org.bspeice.minimalbible.service.book;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v4.util.LruCache;
|
||||
|
||||
import org.crosswire.common.xml.SAXEventProvider;
|
||||
import org.crosswire.jsword.book.Book;
|
||||
import org.crosswire.jsword.book.BookData;
|
||||
import org.crosswire.jsword.book.BookException;
|
||||
import org.crosswire.jsword.passage.Verse;
|
||||
|
||||
import rx.functions.Action1;
|
||||
@ -33,7 +35,7 @@ public class VerseLookupService implements Action1<Verse> {
|
||||
*/
|
||||
private PublishSubject<Verse> listener = PublishSubject.create();
|
||||
|
||||
public VerseLookupService(Book b, Context ctx) {
|
||||
public VerseLookupService(Book b) {
|
||||
listener.subscribeOn(Schedulers.io())
|
||||
.subscribe(this);
|
||||
this.book = b;
|
||||
@ -66,9 +68,14 @@ public class VerseLookupService implements Action1<Verse> {
|
||||
* @return
|
||||
*/
|
||||
public String doVerseLookup(Verse v) {
|
||||
//BookData bookData = new BookData(book, v);
|
||||
|
||||
return "Not yet implemented!";
|
||||
BookData bookData = new BookData(book, v);
|
||||
try {
|
||||
SAXEventProvider provider = bookData.getSAXEventProvider();
|
||||
return provider.toString();
|
||||
} catch (BookException e) {
|
||||
e.printStackTrace();
|
||||
return "Unable to locate " + v.toString() + "!";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user