All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.likethesalad.placeholder.models.StringResourceModel.kt Maven / Gradle / Ivy

Go to download

This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.

There is a newer version: 1.3.0
Show newest version
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)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy