public class Utils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
dp2px(android.content.Context context,
float dp) |
static int |
fetchContextColor(android.content.Context context,
int androidAttribute)
This method can be extended to get all android attributes color, string, dimension ...etc
|
static int |
getScreenWidth(android.content.Context context) |
public static int getScreenWidth(android.content.Context context)
context - used to get system servicespublic static int fetchContextColor(android.content.Context context,
int androidAttribute)
context - used to fetch android attributeandroidAttribute - attribute codes like R.attr.colorAccentpublic static int dp2px(android.content.Context context,
float dp)
context - used to fetch display metricsdp - dp value