package com.gdt.dev.gdtevaluationAdmin.util


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

class DimensionUtil {

    companion object {
        fun dpToPx(dp: Float): Int {
            return (dp * Resources.getSystem().displayMetrics.density).toInt()
        }

        fun pxToDp(px: Float): Int {
            return (px / Resources.getSystem().displayMetrics.density).toInt()
        }
        fun spToPx( spValue: Float): Int {
            val fontScale = Resources.getSystem().displayMetrics.scaledDensity
            return (spValue * fontScale + 0.5f).toInt()
        }
    }



}