Is it possible to set the Margins of a LinearLayout, programmatically but not with pixels, but dp?
convert DP to Pixel value
int Whatever_valueInDP=10;//value in dp int Value_In_Pixel= (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, Whatever_valueInDP, getResources() .getDisplayMetrics());