title: How to set padding in custom view?
body: <p>In my application I have a custom <code>TextView</code> that has some arrow on the left in <code>onDraw</code> method on <code>Canvas</code>. The problem I have is with gravity of the text, as I want it to be centered.</p>
  
  <p>The only way I have found to solve this problem is to set custom left padding, so that text will be centered only in the area that it should be. In order to find out this padding I need to calculate size of the view first. </p>
  
  <p>The problem is that if I put it into <code>onMeasure</code> or <code>onLayout</code> then I get stuck into the loop, so that padding is increasing until maximum value. This is happening, because <code>setPadding</code> is causing those methods to execute again.</p>
  
  <p>How to solve this problem?</p>