Refine MyNumberPicker

This commit is contained in:
Mygod
2016-10-05 22:58:18 +08:00
parent 2722b1aa78
commit abcbc98ce3
2 changed files with 9 additions and 19 deletions
@@ -78,7 +78,9 @@ object Utils {
}
def dpToPx(context: Context, dp: Int): Int =
Math.round(dp * (context.getResources.getDisplayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT))
Math.round(dp * context.getResources.getDisplayMetrics.density)
def spToPx(context: Context, sp: Int): Int =
Math.round(sp * context.getResources.getDisplayMetrics.scaledDensity)
/*
* round or floor depending on whether you are using offsets(floor) or