公告板
版本库
filestore
活动
搜索
登录
陈嘉乐
/
HDL_APP_Project
派生自
~wxr/HDL_APP_Project
概况
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
2020-06-23-1
陈嘉乐
2020-06-23
8dd022404b670ccb54f1741cb02b292b87b1a201
[~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
;
}
}