Now able to infinitely scroll bibles!

Tons of issues outstanding, but this is a huge accomplishment.
This commit is contained in:
Bradlee Speice
2014-09-16 23:37:08 -04:00
parent ef7b8f82fa
commit 918f7688ba
4 changed files with 41 additions and 9223 deletions

View File

@ -6,6 +6,8 @@ import android.webkit.WebViewClient
import android.webkit.JavascriptInterface
import org.crosswire.jsword.book.Book
import org.crosswire.jsword.versification.getVersification
import java.util.ArrayList
import android.util.Log
/**
* Created by bspeice on 9/14/14.
@ -20,4 +22,13 @@ class BibleViewClient(b: Book, lookup: VerseLookupService) : WebViewClient() {
val v = Verse(b.getVersification(), ordinal)
return lookup.getJsonVerse(v) as String
}
JavascriptInterface fun getVerses(first: Int, count: Int): String {
Log.e("getVerses", "First: " + first + " count: " + count)
val verses: MutableList<String> = ArrayList<String>()
for (i in first..first + count - 1) {
verses.add(getVerse(i))
}
return verses.toString()
}
}