Q: getting leftMargin of imageView after Gravity.CENTER I have been trying with TextView and drawableLeft images.
but, drawableLeft tend to stick to left everytime(unless TextView.WRAP_CONTENT) .
I have TextViews arranged in my vertical Layout one below another(everything has a drawableLeft too)
I changed one of the  TextView+drawableLeft to RelativeLayout+(TextView and ImageView .
Applied gravity to center 
I was trying to get the left margin of ImageView ,so that I can apply it to later TextView as padding using 
setPadding(IMAGE_PADDING,0,0,0)
how can I get the left margin from code . 
I tried 
imageView.getPaddingLeft();

its returning 0;
Am I doing it wrong ? is there a way to get it?
Help and Advises needed

A: Set margin like this :
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(left, top, right, bottom);
imageView.setLayoutParams(lp);

Note : This sets margin size in PIXELS, is not the same as the dpi.
check this link
