title: Create MaterialButtonToggleGroup including MaterialButton(s) with customized style programmatically in Android
body: <p>I'm trying to create a MaterialButtonToggleGroup with material buttons inside it and I wanna do that with custom styles.</p>
  
  <p>I was able to create that using xml, however, I need to achieve the same result programmatically </p>
  
  <p>here's what I did with xml (I'm using LinearLayout as a root view):</p>
  
  <pre><code>&lt;com.google.android.material.button.MaterialButtonToggleGroup
    android:id="@+id/group_item_size"
    style="@style/ButtonsToggleGroupStyle"
    &gt;
  
    &lt;com.google.android.material.button.MaterialButton
      style="@style/ButtonStyle"
      android:text="Small"
      /&gt;
  
    &lt;com.google.android.material.button.MaterialButton
      style="@style/ButtonStyle"
      android:text="Large"
      /&gt;
  
    &lt;com.google.android.material.button.MaterialButton
      style="@style/ButtonStyle"
      android:text="Family"
      /&gt;
  
  &lt;/com.google.android.material.button.MaterialButtonToggleGroup&gt;
  </code></pre>
  
  <p>and the code for the styles:</p>
  
  <pre><code>      &lt;style name="ButtonStyle" parent="Widget.MaterialComponents.Button.UnelevatedButton"&gt;
      &lt;item name="cornerRadius"&gt;@dimen/margin_20dp&lt;/item&gt;
      &lt;item name="android:padding"&gt;@dimen/margin_8dp&lt;/item&gt;
      &lt;item name="android:layout_width"&gt;match_parent&lt;/item&gt;
      &lt;item name="android:layout_height"&gt;match_parent&lt;/item&gt;
      &lt;item name="android:layout_weight"&gt;1&lt;/item&gt;
      &lt;item name="android:textSize"&gt;@dimen/text_size_14sp&lt;/item&gt;
      &lt;item name="android:textAllCaps"&gt;false&lt;/item&gt;
      &lt;item name="android:textColor"&gt;@drawable/drawable_button_toggle_group_text_selector&lt;/item&gt;
      &lt;item name="android:backgroundTint"&gt;@drawable/drawable_button_toggle_group_selector&lt;/item&gt;
    &lt;/style&gt;
  
    &lt;style name="ButtonsToggleGroupStyle"&gt;
      &lt;item name="android:layout_width"&gt;match_parent&lt;/item&gt;
      &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
      &lt;item name="android:layout_gravity"&gt;center&lt;/item&gt;
      &lt;item name="android:orientation"&gt;horizontal&lt;/item&gt;
      &lt;item name="android:layout_marginStart"&gt;@dimen/margin_32dp&lt;/item&gt;
      &lt;item name="android:layout_marginTop"&gt;@dimen/margin_12dp&lt;/item&gt;
      &lt;item name="android:layout_marginEnd"&gt;@dimen/margin_32dp&lt;/item&gt;
    &lt;/style&gt;
  </code></pre>
  
  <p>thanks in advance for your help </p>