- Welcome
- Getting started
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- Aria Live
- Autosuggest
- Badge
- Banner Alert
- Bar Chart
- Blockquote
- Bottom Navigation
- Bottom Sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card Button
- Carousel
- Checkbox
- Chip
- Code
- Content Cards
- Data Table
- Datepicker
- Description List
- Dialog
- Divider
- Drawer
- Field Set
- Flare
- Flat List
- Flight Leg
- Floating Action Button
- Floating Notification
- Form Label
- Form Validation
- Graphic Promotion
- Horizontal Navigation
- Icon
- Image
- Infinite Scroll
- Link
- List
- Map
- Mobile Scroll Container
- Modal
- Navigation Bar
- Nudger
- Overlay
- Page Indicator
- Pagination
- Panel
- Phone Input
- Picker
- Popover
- Price
- Progress Bar
- Radio Button
- Rating
- Scrollable Calendar
- Section List
- Select
- Skeleton
- Skip Link
- Slider
- Snackbar
- Spinner
- Split Input
- Star Rating
- Switch
- Table
- Text
- Text Input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable Native Feedback
- Touchable Overlay
- Content
- Accessibility
Dialog
Dialogs inform users about a specific task and may contain critical information, or require decisions or acknowledgement.
Dialog
Delete confirmation
Day | Night |
---|---|
![]() |
![]() |
With CTA
Day | Night |
---|---|
![]() |
![]() |
With flare
Day | Night |
---|---|
![]() |
![]() |
Installation
Backpack Android is available through Maven Central. Check the main Readme for a complete installation guide.
Usage
The Dialog component can only be used in Kotlin/Java
Example of dialog in Kotlin
import net.skyscanner.backpack.dialog.BpkDialog
import net.skyscanner.backpack.dialog.BpkDialog.Type
import net.skyscanner.backpack.dialog.BpkDialog.Button
val dialog = BpkDialog(context, BpkDialog.Type.Success)
dialog.apply {
title = "You are going to Tokyo!"
description = "Your flight is all booked. Why not check out some hotels now?"
icon = BpkDialog.Icon(R.drawable.bpk_tick)
addActionButton(
BpkDialog.Button("Continue") {
println("confirmed")
dialog.dismiss()
}
)
addActionButton(
BpkDialog.Button("Skip") {
println("skipped")
dialog.dismiss()
}
)
}
Example of flare dialog in Kotlin
import net.skyscanner.backpack.dialog.BpkDialog
import net.skyscanner.backpack.dialog.BpkDialog.Type
import net.skyscanner.backpack.dialog.BpkDialog.Button
val dialog = BpkDialog(context, BpkDialog.Type.Flare)
dialog.apply {
title = "You are going to Tokyo!"
description = "Your flight is all booked. Why not check out some hotels now?"
Picasso.get().load(url).into(image)
addActionButton(
BpkDialog.Button("Continue") {
println("confirmed")
dialog.dismiss()
}
)
addActionButton(
BpkDialog.Button("Skip") {
println("skipped")
dialog.dismiss()
}
)
}
Please use DialogInterface.OnDismissListener as the DialogInterface.OnCancelListener is not supported.
Made with ❤️ by Skyscanner © 2023
© 2023 Skyscanner Backpack. Page last updated on Oct 31, 2022, 13:16