mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-07-01 22:05:57 -04:00
Begin parsing OSIS on my own
Also add Kotlin, since I'd like to do what I can to get away from Java.
This commit is contained in:
@ -92,6 +92,12 @@ public class BibleViewerModules {
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BookManager bookManager() {
|
||||
return new BookManager();
|
||||
}
|
||||
|
||||
@Provides
|
||||
VersificationUtil provideVersificationUtil() {
|
||||
return new VersificationUtil();
|
||||
|
@ -114,8 +114,7 @@ public class BookFragment extends BaseFragment {
|
||||
Verse initial = new Verse(vUtil.getVersification(mBook.get()),
|
||||
BibleBook.GEN, 1, 1);
|
||||
super.onPageFinished(view, url);
|
||||
// invokeJavascript("appendVerse", lookupService.getHTMLVerse(initial));
|
||||
invokeJavascript("appendVerse", "Testing string...");
|
||||
invokeJavascript("appendVerse", lookupService.getHTMLVerse(initial));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,8 +4,7 @@ import android.support.v4.util.LruCache;
|
||||
import android.util.Log;
|
||||
|
||||
import org.bspeice.minimalbible.Injector;
|
||||
import org.bspeice.minimalbible.service.format.osistohtml.OsisToHtmlParameters;
|
||||
import org.bspeice.minimalbible.service.format.osistohtml.OsisToHtmlSaxHandler;
|
||||
import org.bspeice.minimalbible.service.osisparser.OsisParser;
|
||||
import org.crosswire.common.xml.SAXEventProvider;
|
||||
import org.crosswire.jsword.book.Book;
|
||||
import org.crosswire.jsword.book.BookData;
|
||||
@ -81,10 +80,11 @@ public class VerseLookupService implements Action1<Verse> {
|
||||
BookData bookData = new BookData(book, v);
|
||||
try {
|
||||
SAXEventProvider provider = bookData.getSAXEventProvider();
|
||||
OsisToHtmlSaxHandler handler = new OsisToHtmlSaxHandler(new OsisToHtmlParameters());
|
||||
// OsisToHtmlSaxHandler handler = new OsisToHtmlSaxHandler(new OsisToHtmlParameters());
|
||||
OsisParser handler = new OsisParser(v);
|
||||
provider.provideSAXEvents(handler);
|
||||
Log.e(this.getClass().getName(), handler.toString());
|
||||
return handler.toString();
|
||||
return handler.getContent().getContent();
|
||||
} catch (BookException e) {
|
||||
e.printStackTrace();
|
||||
return "Unable to locate " + v.toString() + "!";
|
||||
|
Reference in New Issue
Block a user