SeatLayout
A seat selection library for Android with an example for selecting seats for flights, sports venue, theatres, etc
Install / Use
/learn @mutualmobile/SeatLayoutREADME
Seat Layout
This library is an example implementation of an interactive seat layout which has the following features:
- Pinch to zoom seat arrangement along
- Optional zoom in/out button
- Ability to have multiple seat types like available, sold, reserved, disabled seats etc
- Clickable seats with animated popup showing selected seat information
- Select or deselect multiple seats
Download the sample apk from HERE
How To Use
Since the requirement can be vastly different for different applications, we decided to post an example implementation rather than an injectable library.
This repo has two modules:
-
example: Which is an example app on how to use SeatLayout. Run this module to test the example app
-
seatlayout: This is the library that you need to add in your project as a module
SeatLayout has predefined data models and example JSON which you can edit to fit your needs. Following is a piece of brief information to help you do that:
Seat Layout expects an <em>Array<Array<SeatData>></em> so that it can draw seats in the xy plain.
numberOfRows = seatDataArray.size;
numberOfColumnsInNthRow = seatDataArray[n].size
SeatData Model:
- SeatData is the model that is used to represent each seat in the layout. It contains all the information that is required by SeatLayout for rendering the seat.
- SeatData model contains the
rowIndex, columnIndex, areaIndex, price, description(Any information that you want to provide when a user taps on the seat) - SeatStatus:
NONE, EMPTY, SOLD, RESERVED, BROKEN, PLACEHOLDER, UNKNOWN, BUSY, CHOSEN, INFO - SeatStyle:
NONE, NORMAL, BARSEAT, HANDICAP, COMPANION, UNKNOWN - TableStyle:
NONE, SINGLE, PAIR_LEFT, PAIR_RIGHT, SIDE_TABLE_LEFT, SIDE_TABLE_RIGHT, LONG_LEFT, LONG_CENTER, LONG_RIGHT, LONG_GAP, LONG_GAP_LEFT, LONG_GAP_RIGHT, UNKNOWN
If you want callbacks, SeatView offers three callbacks right now using SeatListener:
- maxSeatsReached()
- seatTapped()
- updateSelectedSeatDisplay(selectedSeats: Int, maxSelectedSeats: Int)
Contributors
License
Copyright 2019 Mutual Mobile
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
