47 lines
1.4 KiB
Kotlin
47 lines
1.4 KiB
Kotlin
package com.portaltv.capability
|
|
|
|
import android.content.Context
|
|
import android.graphics.Typeface
|
|
import android.widget.TextView
|
|
import androidx.core.content.res.ResourcesCompat
|
|
|
|
/** Lucide icon-font glyphs (codepoints from lucide-static `info.json`, same release as res/font/lucide.ttf). */
|
|
object LucideIcons {
|
|
const val CAMERA = "\uE064"
|
|
const val SPARKLES = "\uE412"
|
|
const val FOLDERS = "\uE33F"
|
|
const val USERS = "\uE1A4"
|
|
const val MAP_PIN = "\uE111"
|
|
const val LOCATE_FIXED = "\uE1DB"
|
|
const val SETTINGS = "\uE154"
|
|
const val SETTINGS_2 = "\uE245"
|
|
const val HOURGLASS = "\uE296"
|
|
const val MONITOR = "\uE11D"
|
|
const val LAPTOP = "\uE1CD"
|
|
const val VIDEO = "\uE1A5"
|
|
const val MIC = "\uE118"
|
|
const val UPLOAD = "\uE19E"
|
|
const val TRASH_2 = "\uE18E"
|
|
const val ELLIPSIS_VERTICAL = "\uE0B7"
|
|
const val CHECK = "\uE06C"
|
|
const val CIRCLE_CHECK = "\uE226"
|
|
const val ZOOM_IN = "\uE1B6"
|
|
const val ZOOM_OUT = "\uE1B7"
|
|
|
|
@Volatile private var typeface: Typeface? = null
|
|
|
|
fun typeface(context: Context): Typeface {
|
|
typeface?.let { return it }
|
|
val tf = ResourcesCompat.getFont(context, R.font.lucide)
|
|
?: error("Missing R.font.lucide")
|
|
typeface = tf
|
|
return tf
|
|
}
|
|
|
|
fun apply(view: TextView, glyph: String) {
|
|
view.typeface = typeface(view.context)
|
|
view.text = glyph
|
|
view.includeFontPadding = false
|
|
}
|
|
}
|