I'm attempting to develop a bus seat reservation software that is quite similar to the RedBus app. I walked over to that seating arrangement and was shocked by it.
To succeed, I really need your assistance. Recycler View has been tried, but it doesn't allow me to access the precise layout.
I tried it using recycler view, and here is how it looks:
However, the actual Redbud application screen photo is as follows:
I have gone through one of the code that is available in git
https://github.com/TakeoffAndroid/SeatBookingRecyclerView
However, the issue with utilising the aforementioned code is that, for example, if there are 41 seats, but using the aforementioned git code it will only display 33 seats on the screen, it will look like this:
Help would be really appreciated.
Snippet Code:
numOfColumns = 4;
mArrayBusSeats = new ArrayList<>();
for (int i = 0; i < mArraySeats.size(); i++) {
if (i % numOfColumns == 0 || i % numOfColumns == (numOfColumns - 1)) {
BusLayoutModel model = mArraySeats.get(i);
model.setSeatType(AbstractItem.TYPE_EDGE);
mArrayBusSeats.add(model);
} else if (i % numOfColumns == 1 || i % numOfColumns == (numOfColumns - 2)) {
BusLayoutModel model = mArraySeats.get(i);
model.setSeatType(AbstractItem.TYPE_CENTER);
mArrayBusSeats.add(model);
} else {
BusLayoutModel model = new BusLayoutModel();
model.setSeatType(AbstractItem.TYPE_EMPTY);
mArrayBusSeats.add(model);
}
}