forked from github/szkolny
remove duplicated string extension
This commit is contained in:
parent
2a93cd5ebd
commit
40ea700e0b
@ -38,7 +38,7 @@ class VulcanHebeGrades(
|
||||
val column = grade.getJsonObject("Column")
|
||||
val category = column.getJsonObject("Category")
|
||||
val categoryText = category.getString("Name")
|
||||
val code = column.getString("Code").orNullIfEmpty()
|
||||
val code = column.getString("Code").takeValue()
|
||||
|
||||
val teacherId = getTeacherId(grade, "Creator") ?: -1
|
||||
val subjectId = getSubjectId(column, "Subject") ?: -1
|
||||
|
@ -141,8 +141,6 @@ fun String.fixWhiteSpaces() = buildString(length) {
|
||||
}
|
||||
}.trimEnd()
|
||||
|
||||
fun String?.orNullIfEmpty(): String? = if (this.isNullOrEmpty()) null else this
|
||||
|
||||
fun CharSequence?.asColoredSpannable(colorInt: Int): Spannable {
|
||||
val spannable = SpannableString(this)
|
||||
spannable.setSpan(ForegroundColorSpan(colorInt), 0, spannable.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user