@@ -0,0 +1,936 @@
+package com.twotoasters.servos.util;%0A%0Aimport android.content.res.Resources;%0Aimport android.util.TypedValue;%0A%0Apublic final class DensityUtils %7B%0A%0A    private DensityUtils() %7B %7D%0A%0A    /**%0A     * Converts the given amount of pixels to a dp value.%0A     * @param pixels The pixel-based measurement%0A     * @return The measurement's value in dp, based on the device's screen density%0A     */%0A    public static float getDpFromPixels(int pixels) %7B%0A        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, pixels, Resources.getSystem().getDisplayMetrics());%0A    %7D%0A%0A    /**%0A     * Converts the given dp measurement to pixels.%0A     * @param dp The measurement, in dp%0A     * @return The corresponding amount of pixels based on the device's screen density%0A     */%0A    public static float getPixelsFromDp(int dp) %7B%0A        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics());%0A    %7D%0A%0A%7D%0A

Add DensityUtils