Refactor AppConfig const

This commit is contained in:
2dust
2025-04-08 21:05:34 +08:00
parent a46d9d0d2a
commit 1ef80a3a96
10 changed files with 55 additions and 32 deletions
@@ -197,3 +197,16 @@ inline fun <reified T : Serializable> Intent.serializable(key: String): T? = whe
* @return True if the CharSequence is not null and not empty, false otherwise.
*/
fun CharSequence?.isNotNullEmpty(): Boolean = this != null && this.isNotEmpty()
fun String.concatUrl(vararg paths: String): String {
val builder = StringBuilder(this.trimEnd('/'))
paths.forEach { path ->
val trimmedPath = path.trim('/')
if (trimmedPath.isNotEmpty()) {
builder.append('/').append(trimmedPath)
}
}
return builder.toString()
}