com.likethesalad.placeholder.models.StringResourceModel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of string-reference Show documentation
Show all versions of string-reference Show documentation
This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.
package com.likethesalad.placeholder.models
data class StringResourceModel(
val attributes: Map,
val content: String
) : Comparable {
companion object {
const val ATTR_NAME = "name"
const val ATTR_TRANSLATABLE = "translatable"
}
constructor(name: String, content: String) : this(mapOf(ATTR_NAME to name), content)
val name = attributes.getValue(ATTR_NAME)
val translatable: Boolean = attributes.getOrDefault(ATTR_TRANSLATABLE, "true").toBoolean()
override fun compareTo(other: StringResourceModel): Int {
return name.compareTo(other.name)
}
}