Added support for gravity.  But orientation changes are not being handled properly yet.