Optimize SquareFrameLayout to acccept width or height as parameter to calculate the square.