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);
                }
            }
3 days ago in Android by Edureka
• 12,290 points
6 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 in Android by Edureka
• 12,290 points
32 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

3 days ago in Android by Ashwini
• 2,760 points
16 views
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 in Android by Edureka
• 12,290 points
38 views
0 votes
0 answers

Factorial program in android

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

Sep 21 in Android by Edureka
• 12,290 points
123 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 in Android by Edureka
• 12,290 points
185 views
0 votes
0 answers

What does LayoutInflater in Android do?

What is the use of LayoutInflater in ...READ MORE

Sep 22 in Android by Edureka
• 12,290 points
33 views
0 votes
1 answer

Recyclerview No adapter attached; skipping layout

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

answered Apr 29 in Other DevOps Questions by narikkadan
• 37,660 points
2,817 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,350 points
3,022 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,100 points
1,656 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,100 points
465 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