View.setPadding accepts only in px, is there anyway to setPadding in dp?
If you define the dimension (in dp or whatever) in an XML file (which is better anyway, at least in most cases), you can get the pixel value of it using this code:
context.getResources().getDimensionPixelSize(R.dimen.your_dimension_name)
Straight to code
int padding_in_dp = 6; // 6 dps
final float scale = getResources().getDisplayMetrics().density;
int padding_in_px = (int) (padding_in_dp * scale + 0.5f);