title: Partially selected checkbox on Android?
body: <p>On Android, I need a checkbox (or checkbox-like component) which can represent/control a flag for a number of selected items. There are 3 possibilities which I need to represent:</p>
  
  <ol>
  <li>Flag is set for all items.</li>
  <li>Flag is set for none of the items.</li>
  <li>Flag is set for some of the items.</li>
  </ol>
  
  <p>I'm imagining something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/BXkQv.png" alt="enter image description here"></p>
  
  <p>If the user selects the checkbox when it's in state 3, it will switch to state 1. Thereafter, it will only toggle between states 1 &amp; 2.</p>
  
  <p>If you're familiar with the checkboxes in the attributes section of the file properties dialog in Windows, that's what I'm after.</p>
  
  <p><strong>Is there a native Android UI widget, or an existing open-source widget, which can do this?</strong></p>
  
  <p>I'm fairly confident I could do my own implementation, but I'd rather not re-invent the wheel!</p>