mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-06-30 21:36:10 -04:00
Now able to infinitely scroll bibles!
Tons of issues outstanding, but this is a huge accomplishment.
This commit is contained in:
@ -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()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user