Added horizontal gravity support / only handle back key for hiding

Change-Id: I845598bb706089c788e8d829d7d4ebfb9998eb99