title: An Expand/Collapse button in Android (to show/hide an optional view)
body: <p>I need a UI element that will allow the user to expand/collapse (show/hide) a view that contains optional/advanced information.</p>
  
  <p>I envision this as a text label (e.g. 'advanced options', 'more/less') plus an icon that toggles between open and close.  I've got some icons that could serve the purpose, and the functionality of the element closely matches that of a ToggleButton, so I attempted to solve this problem with a styled ToggleButton.</p>
  
  <p>This solution turned out to be super ugly (from the maintenance perspective).  I'll add it as an answer below.</p>
  
  <p>I'm hoping someone could suggest a better solution, or point out how my solution could be simplified.</p>
  
  <p>BTW, animating the expanding/collapsing of the view is addressed well in <a href="https://stackoverflow.com/questions/4946295/android-expand-collapse-animation">this SO Q/A</a>.</p>