Slight change to the format of the Divine Name

This commit is contained in:
Bradlee Speice 2014-12-01 11:57:17 -05:00
parent caf2227555
commit bb415d2d3d
4 changed files with 3 additions and 15 deletions

View File

@ -3,7 +3,6 @@
*/
package org.bspeice.minimalbible.service.format.osisparser
import com.google.gson.Gson
import org.crosswire.jsword.passage.Verse
import java.util.ArrayList
@ -15,13 +14,4 @@ data class VerseContent(val v: Verse,
val verseNum: Int = v.getVerse(),
val chapterTitle: String = "",
val paraTitle: String = "",
val references: MutableList<VerseReference> = ArrayList(),
val content: String = "") {
// Gson is used mostly for serializing the verses
public val json: String
get() = Gson().toJson(this)
public fun appendContent(content: String): VerseContent =
this.copy(this.v, content = this.content + content)
}
val references: MutableList<VerseReference> = ArrayList()) {}

View File

@ -14,6 +14,6 @@ class DivineHandler() : TagHandler {
fun buildDivineName(chars: String) =
listOf(AppendArgs(chars take 1, null),
AppendArgs(chars drop 1, RelativeSizeSpan(.9f))
AppendArgs((chars drop 1).toUpperCase(), RelativeSizeSpan(.8f))
)
}

View File

@ -10,8 +10,6 @@ import android.text.style.CharacterStyle
trait TagHandler {
fun render(builder: SpannableStringBuilder, info: VerseContent, chars: String)
}
data class AppendArgs(val text: String, val span: Any?) {

View File

@ -22,7 +22,7 @@ class VerseHandler() : TagHandler {
fun buildVerseHeader(chapter: Int, verseNum: Int, verseStart: Boolean): AppendArgs =
when {
!verseStart -> AppendArgs("", null)
verseNum == 1 -> AppendArgs("$chapter", StyleSpan(Typeface.BOLD))
verseNum == 1 -> AppendArgs("$chapter ", StyleSpan(Typeface.BOLD))
else -> AppendArgs("${verseNum}", listOf(SuperscriptSpan(), RelativeSizeSpan(.75f)))
}
}