package com.qimai.android.tools

import android.content.res.Resources
import android.util.TypedValue

//float值转为sp像素
val Float.sp
get() = TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_DIP,
        this,
        Resources.getSystem().displayMetrics
)

//float像素值转为dp
val Float.dp
get() = TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_SP,
        this,
        Resources.getSystem().displayMetrics
)

