package com.bokecc.livemodule.view;

import android.content.Context;

/**
 * Copyright (C), 20105-2021, 创盛视联数码科技（北京）有限公司
 * FileName:
 * Author:
 * Date: 2023/1/9
 * Description:
 */
public class SizeUtils {

    public static int dp2px(Context context,float dp){
        float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dp * scale + 0.5f);
    }

    public static int px2dp(Context context,int dp){
        float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dp / scale + 0.5f);
    }


}
