title: Android - Kotlin - How to overcome a minimal width limit of a button?
body: <p>I am trying to manipulate a width of an android button with Kotlin using minSdkVersion 19 or higher (test phone has Android 8.0.0, API 26). When I try to make a button smaller I see that it's width couldn't pass some threshold approximately above 200px.</p>
  
  <p>That's how I create and manipulate a button:</p>
  
  <pre><code>val button = Button(this)
  button.width = btn_side // btn_side = 175
  constraintLayout.addView(button)
  </code></pre>
  
  <p><strong>What I've already tryed</strong>. Different layouts: TableLayout, ConstraintLayout. I've tryed to set textSize to zero in case if it interfered with button width. Or to replace any button text with null string. I've tryed to apply zero or 10px minWidth to a button. I've played with setPadding button method. I've tryed to assign width via layoutParams property. None of which helped.</p>
  
  <p>What am I missing?</p>
  
  <p>Here is my xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".GameFieldActivity"
          android:id="@+id/constraintLayout"
  &gt;
  </code></pre>
  
  <p><strong>* UPD *</strong>
  Someone deleted an answer with possibly useful hint: there might be a way to use different <a href="https://developer.android.com/reference/android/widget/Button" rel="nofollow noreferrer">button constructors</a>. Might be there is a way to pass desired button width through <a href="https://developer.android.com/reference/android/util/AttributeSet" rel="nofollow noreferrer">AttributeSet</a>.</p>