mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-06-30 21:36:10 -04:00
Bringing back Kotlin
I can do manual DI for testing, other Android classes can handle interfacing with Kotlin. From my testing, interop is quite smooth.
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Created by bspeice on 9/9/14.
|
||||
*/
|
||||
package org.bspeice.minimalbible.service.format.osisparser
|
||||
|
||||
import com.google.gson.Gson
|
||||
import org.crosswire.jsword.passage.Verse
|
||||
import java.util.ArrayList
|
||||
|
||||
class VerseContent(v: Verse?) {
|
||||
var id = v?.getOrdinal() ?: 0
|
||||
var bookName = v?.getName() ?: ""
|
||||
var chapter = v?.getChapter() ?: 0
|
||||
var verseNum = v?.getVerse() ?: 0
|
||||
var content = ""
|
||||
var chapterTitle = ""
|
||||
var paraTitle = ""
|
||||
var references: MutableList<VerseReference> = ArrayList()
|
||||
|
||||
public fun toJson(): String {
|
||||
// Lazy load Gson - not likely that we'll call this method multiple times, so
|
||||
// don't have to worry about a penalty there.
|
||||
return Gson().toJson(this) as String
|
||||
}
|
||||
|
||||
public fun appendContent(content: String) {
|
||||
this.content += content
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package org.bspeice.minimalbible.service.format.osisparser
|
||||
|
||||
import org.crosswire.jsword.passage.Verse
|
||||
|
||||
/**
|
||||
* Created by bspeice on 9/9/14.
|
||||
*/
|
||||
|
||||
class VerseReference(verse: Verse, index: Int) {
|
||||
val verse: Verse = verse
|
||||
val index: Int = index
|
||||
}
|
Reference in New Issue
Block a user