title: Customizing spinners' spacing
body: <p>Spinners provide two states. The first and default state (<em>state A</em>) shows the currently selected value. The second (<em>state B</em>) shows a dropdown menu when the spinner display is touched.</p>
  
  <p><img src="https://i.stack.imgur.com/lTTz7.png" alt="State A and B example"></p>
  
  <p>By default a left padding is added to the items displayed in state A and B. I would like to remove it when the current selected value is displayed (<em>state A</em>) but to keep it when items are displayed in the dropdown menu (<em>state B</em>). </p>
  
  <p>Since the padding is set with the <em>CheckedTextView</em> used in the layout that is specified when the spinner is created, my first try was to pass to the spinner constructor a custom layout that contains a CheckedTextView with empty padding. This way, the left padding disapears in state A but also in state B. However, my goal was to keep it for state A.</p>
  
  <p>My second try was to customize <em>android:dropDownSpinnerStyle</em> in my theme definition. Since changing background color for <em>android:dropDownSpinnerStyle</em> changes the background color of the item in state A only, my thought was to override the marginLeft or paddingLeft with a negative value. Unfortunately, it has no effect.</p>
  
  <p>Given that negative margin/padding seems not to be taken into account, I have tried the opposite. Firstly, I have used a custom item layout (as explained for my first try) in order to remove left padding on both states (A and B). Secondly, I have defined a custom style for property <em>android:dropDownListViewStyle</em>. Unfortunately, using a positive marginLeft value with the last property has no effect. Thus, I have set paddingLeft. It works and allows me to get the left spacing for state B only. However, the left space applies also to the background touch color (cf. image below). </p>
  
  <p><img src="https://i.stack.imgur.com/PV8s9.png" alt="enter image description here"></p>
  
  <p>I think that only the style for state A should be altered if I want to have the on touch background color that fully fills the dropdown menu width. Any idea, suggestion or example is welcomed. </p>
  
  <p>Below is my theme definition for the third try:</p>
  
  <pre><code>&lt;style name="Theme.App.Base" parent="Theme.App"&gt;
      ...
      &lt;item name="android:dropDownListViewStyle"&gt;@style/Widget.Spinner.DropDown.ListView&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="Widget.Spinner.DropDown.ListView" parent="Widget.AppCompat.ListView.DropDown"&gt;
      &lt;item name="android:paddingLeft"&gt;16dp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>