Bus Seating Arrangement same as in RedBus Android

0 votes

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:

enter image description here

However, the actual Redbud application screen photo is as follows:

enter image description here

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:

enter image description here

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);
                }
            }
Nov 23, 2022 in Android by Edureka
• 13,620 points
699 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Android

0 votes
1 answer

How to set my Activity as main activity in android?

The "intent-filter" in "AndroidManifest.xml" allows you to ...READ MORE

answered Nov 8, 2022 in Android by Edureka
• 13,620 points
1,758 views
0 votes
0 answers

Android logo as an emoji (symbol) to copy and paste in text form

To use it in text editors, I ...READ MORE

Nov 23, 2022 in Android by Ashwini
• 5,430 points
3,803 views
0 votes
0 answers
0 votes
0 answers

How to make grid view scroll horizontally not vertically in android?

I use a flexible Grid View. means ...READ MORE

Sep 21, 2022 in Android by Edureka
• 13,620 points
260 views
0 votes
0 answers

Factorial program in android

Hey guys, I am aware that there ...READ MORE

Sep 21, 2022 in Android by Edureka
• 13,620 points
3,390 views
0 votes
0 answers

Unable to detect adb version, adb output in Android Studio 3.3.2

I have done following task for solutions; Download ...READ MORE

Sep 21, 2022 in Android by Edureka
• 13,620 points
1,052 views
0 votes
1 answer

Recyclerview No adapter attached; skipping layout

Check if you are calling these statements ...READ MORE

answered Apr 29, 2022 in Other DevOps Questions by narikkadan
• 63,420 points
7,898 views
0 votes
1 answer

Running docker on Android

According to the documentation, the Android kernel is ...READ MORE

answered Aug 1, 2018 in Docker by Kalgi
• 52,360 points
3,393 views
0 votes
1 answer

Task Canceled Exception while invoking AWS Lambda

I'm guessing either the TaskCanceledException instance is ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 58,090 points
2,185 views
0 votes
1 answer

Is there a way to run Python on Android?

YES! An example via Matt Cutts via SL4A -- "here’s ...READ MORE

answered Sep 19, 2018 in Python by Priyaj
• 58,090 points
830 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP