Hello I am setting padding to the ImageView
and each device is showing me different padding, somewhere it is less or somewhere it is more.
I am doing this
int padding = Util.dpFromPx(6, this);
thumbnailImageView.setPadding(padding, padding, padding, padding);
thumbnailImageView.setBackgroundColor(Color.WHITE);
// convert the px to dp
public static int dpFromPx(float px, Context context) {
return (int) (px / context.getResources().getDisplayMetrics().density);
}
I want to keep padding same to all device. Any idea to do that ?
Sony device
Samsung Dous