mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-22 07:58:20 -05:00
Slight change to the format of the Divine Name
This commit is contained in:
parent
caf2227555
commit
bb415d2d3d
@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.bspeice.minimalbible.service.format.osisparser
|
package org.bspeice.minimalbible.service.format.osisparser
|
||||||
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import org.crosswire.jsword.passage.Verse
|
import org.crosswire.jsword.passage.Verse
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
@ -15,13 +14,4 @@ data class VerseContent(val v: Verse,
|
|||||||
val verseNum: Int = v.getVerse(),
|
val verseNum: Int = v.getVerse(),
|
||||||
val chapterTitle: String = "",
|
val chapterTitle: String = "",
|
||||||
val paraTitle: String = "",
|
val paraTitle: String = "",
|
||||||
val references: MutableList<VerseReference> = ArrayList(),
|
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)
|
|
||||||
}
|
|
@ -14,6 +14,6 @@ class DivineHandler() : TagHandler {
|
|||||||
|
|
||||||
fun buildDivineName(chars: String) =
|
fun buildDivineName(chars: String) =
|
||||||
listOf(AppendArgs(chars take 1, null),
|
listOf(AppendArgs(chars take 1, null),
|
||||||
AppendArgs(chars drop 1, RelativeSizeSpan(.9f))
|
AppendArgs((chars drop 1).toUpperCase(), RelativeSizeSpan(.8f))
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -10,8 +10,6 @@ import android.text.style.CharacterStyle
|
|||||||
|
|
||||||
trait TagHandler {
|
trait TagHandler {
|
||||||
fun render(builder: SpannableStringBuilder, info: VerseContent, chars: String)
|
fun render(builder: SpannableStringBuilder, info: VerseContent, chars: String)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class AppendArgs(val text: String, val span: Any?) {
|
data class AppendArgs(val text: String, val span: Any?) {
|
||||||
|
@ -22,7 +22,7 @@ class VerseHandler() : TagHandler {
|
|||||||
fun buildVerseHeader(chapter: Int, verseNum: Int, verseStart: Boolean): AppendArgs =
|
fun buildVerseHeader(chapter: Int, verseNum: Int, verseStart: Boolean): AppendArgs =
|
||||||
when {
|
when {
|
||||||
!verseStart -> AppendArgs("", null)
|
!verseStart -> AppendArgs("", null)
|
||||||
verseNum == 1 -> AppendArgs("$chapter", StyleSpan(Typeface.BOLD))
|
verseNum == 1 -> AppendArgs("$chapter ", StyleSpan(Typeface.BOLD))
|
||||||
else -> AppendArgs("${verseNum}", listOf(SuperscriptSpan(), RelativeSizeSpan(.75f)))
|
else -> AppendArgs("${verseNum}", listOf(SuperscriptSpan(), RelativeSizeSpan(.75f)))
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user