修改开服,新增开服(未完善)

This commit is contained in:
kehaoyuan
2018-05-29 19:43:34 +08:00
parent 67d6cc6f05
commit 08e8846af8
20 changed files with 553 additions and 9 deletions

View File

@ -3,6 +3,8 @@ package com.gh.common.util;
import android.content.Context;
import android.content.res.Resources;
import com.halo.assistant.HaloApp;
public class DisplayUtils {
/**
@ -21,6 +23,15 @@ public class DisplayUtils {
return (int) (pxValue / scale + 0.5f);
}
/**
* 根据手机的分辨率从 dip(像素) 的单位 转成为 px
*/
public static int dip2px(float dpValue) {
final float scale = HaloApp.getInstance().getApplication().getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
/**
* 将px值转换为sp值保证文字大小不变
*