This layout is a shelf with 3 books each row.

I current come up with gridview for displaying the books and manually add up the shelf bar. The problem occurs when there are more than 9 books and the layout is broken when scrolling the grid.

Could anyone suggest me another better way to deal with this layout. Thanks
I think you should set the background in
each element(one shelf) instead of the setting the Grid container background (three shelf) ….it’s looking difficult in your case because it would has three images in a row ..So you need to try some this switch(position%3) in getView of adapter to set three different image
or
Use the ListView and Re-set the data in Array List so that each element has three books and you can make all three images clickable of that row and can make list row unclickable and unfocusable