Add layout direction support