Flip the starting point of the popup if its on the right side of the screen

Change-Id: I7a3fea220d051e0d70fcbf0be3d0557ee24c5da2