Using an if on layout