public class Utils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_COLOR |
| Modifier and Type | Method and Description |
|---|---|
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 final int NO_COLOR
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