title: Could be done this static button with java code?
body: <pre><code>&lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:drawableTop="@drawable/randomImage"
      android:gravity="center_horizontal|bottom"
      /&gt;
  </code></pre>
  
  <p>Especially I'm asking about those two properties:</p>
  
  <pre><code>android:drawableTop="@drawable/randomImage"
  android:gravity="center_horizontal|bottom"
  </code></pre>
  
  <p>This is how the buttons look:</p>
  
  <p><img src="https://i.stack.imgur.com/5kVA0.png" alt="enter image description here"></p>
  
  <p>The buttons are done with static xml.</p>
  
  <p>Finally I have to answer my question:</p>
  
  <pre><code>android:gravity="center_horizontal|bottom"
  </code></pre>
  
  <p>correspondents to:</p>
  
  <pre><code>setGravity(Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>android:drawableTop="@drawable/randomImage"
  </code></pre>
  
  <p>correspondents to:</p>
  
  <pre><code>setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom);
  </code></pre>