title: Programmatically create Parallelogram Drawable in Android
body: <p>I am trying to recreate the toggle slide that is seen in Ice Cream Sandwich, but unavailable for Android versions below ICS. I am at the point where I am comfortable with my slider, however I am currently using two parallelogram images (one for its off state, one for its on state). I would like to ideally create the drawable at runtime, and simply change the color of it based on the state. This would really help for customization in the end.</p>
  
  <p>I am quite new to drawables in general, and would like to create this one programmatically, since in our framework we do not use xml.</p>
  
  <p>The reason for creating this, is that parallelogram is one single piece, making scaling much more manageable, and customizable.</p>
  
  <p>Any help would be greatly appreciated, and please let me know if you need any more info!</p>
  
  <p>This is what androids toggle looks like, I would like to model mine after theirs:
  <img src="https://i.stack.imgur.com/7eDwY.png" alt="ICS Toggle"> </p>
  
  <p>If you need any other details please let me know, I hope I explained what I am after in a meaningful way.</p>
  
  <p>Thanks!</p>