Added layout switcher functionality