Pass section in adapter method for convenience, fix layout bug when grid orientation vertical and improve layout logic for edge case