公告板
版本库
filestore
活动
搜索
登录
陈嘉乐
/
HDL_APP_Project
派生自
~wxr/HDL_APP_Project
概况
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
2020-06-22-1
陈嘉乐
2020-06-22
9d15f7a2c309cb859d5ed0f61e4eb2cac57e3507
[~cjl/HDL_APP_Project.git]
/
MyJar
/
src
/
MyJar
/
DensityUtil.java
1
2
3
4
5
6
7
8
9
10
11
package MyJar;
import android.content.Context;
public class DensityUtil {
public static float dip2px(Context context, float dpValue) {
float scale = context.getResources().getDisplayMetrics().density;
return dpValue * scale;
}
}