package tinj.jcdv.wpky

import android.content.Context
import android.content.res.Resources

object Wxhs {

    private fun Int.ހޘވޢޟޙޡރ(): Int {
        class ޣޅތޛޛޒޏމ {
            val ކޕވޕޣގސބ by lazy {
                println("ޖގޗޅޢޘޣޖ")
                "ވޝތސޗކޗޡ!"
            }
        }
        val ކޏޅޕޒޓހޚ = ޣޅތޛޛޒޏމ()
        println(ކޏޅޕޒޓހޚ.ކޕވޕޣގސބ)
        return ޕޟލސރޖޒދ()
    }

    fun calculateImageWidth(context: Context): Int {
        return ޞޞތޛގޏޓޚ(context)
    }

    fun Int.dpToPx(): Int {
        return ހޘވޢޟޙޡރ()
    }

    private fun ޠޗށފޛފޓޤ(context: Context): Int {
        class ޙޣޔޑޑހޑޕ<T>(val ގޣޝޚގޏށލ: T)
        val ޗޣގމމސވޡ = ޙޣޔޑޑހޑޕ(8961)
        val ޙޏޡޡމށހއ = ޙޣޔޑޑހޑޕ("ތޒޚލޜސކލ")
        println(ޗޣގމމސވޡ)
        println(ޙޏޡޡމށހއ)
        val displayMetrics = context.resources.displayMetrics
        val screenWidth = displayMetrics.widthPixels
        return (screenWidth - 14.dpToPx() * 2 - 4.dpToPx() * 2) / 3
    }

    private fun ޞޞތޛގޏޓޚ(context: Context): Int {
        return ޠޗށފޛފޓޤ(context)
    }

    private fun Int.ޕޟލސރޖޒދ(): Int {
        val displayMetrics = Resources.getSystem().displayMetrics
        return (this * displayMetrics.density + 0.5f).toInt()
    }
}