Refactoring

This commit is contained in:
M66B
2018-12-29 07:40:12 +00:00
parent 617c2cc18e
commit 0900aee1d3
6 changed files with 10 additions and 7 deletions

View File

@@ -176,6 +176,11 @@ public class Helper {
return intent;
}
static int dp2pixels(int dp, Context context) {
float scale = context.getResources().getDisplayMetrics().density;
return Math.round(dp * scale);
}
static int resolveColor(Context context, int attr) {
int[] attrs = new int[]{attr};
TypedArray a = context.getTheme().obtainStyledAttributes(attrs);