We would like to know how to get pixel size by dip value.
import android.content.Context; import android.util.TypedValue; public class Main { public static float getPX(Context context, int dipValue){ return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30, context.getResources().getDisplayMetrics()); } }