Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Snackbar

Snackbar displays informative text

banner-Snackbar
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Upcoming Upcoming

Snackbars notify users of processes that have been or will be performed by the app. They appear temporarily, towards the bottom of the screen. They must not interfere with the user experience, and they do not require user input to disappear.

usage snackbar

Variants & Themes

Legion has 4 variants for snackbar :

  1. Title
  2. Description
  3. Action Text
  4. Icon
  5. Avatar

Legion has 4 themes for snackbar :

  1. Basic / Normal Theme
  2. Error Theme
  3. Warning Theme
  4. Success Theme

Usage

Basic use of snackbars in fragments and in activities without customization


basic usage

Normal Snackbar

...
btnAction.setOnClickListener {
normalSnackBar("Normal Snackbar")
}
...

Success Snackbar

...
btnAction.setOnClickListener {
successSnackBar("Success Snackbar")
}
...

Error Snackbar

...
btnAction.setOnClickListener {
errorSnackBar("Error Snackbar")
}
...

Warning Snackbar

...
btnAction.setOnClickListener {
warningSnackBar("Warning Snackbar")
}
...

Variants Usage

Further use of the snackbar in fragments and in activities with customization such as:

  1. Title
...
btnAction.setOnClickListener {
LgnSnackBar.setup(this) {
...
title = "Title"
...
}.show()
}
  1. Description
...
btnAction.setOnClickListener {
LgnSnackBar.setup(this) {
...
description = "Description"
...
}.show()
}
  1. Action Text
...
btnAction.setOnClickListener {
LgnSnackBar.setup(this) {
...
actionText = "Action Text"
...
}.show()
}
  1. Icon
...
btnAction.setOnClickListener {
LgnSnackBar.setup(this) {
...
icon = "https://cdn.kincir.com/2/cojC8OAR0YiByhyEPOO6AADzHrc9p3w7CTursS4z35A/transform/rs:fit:764/src/production/2021-02/740x435_3576f9505b43dabaea0294436ab365775c42fe56.jpg"
...
}.show()
}
  1. Avatar
...
btnAction.setOnClickListener {
LgnSnackBar.setup(this) {
...
avatarUrl = "https://cdn.kincir.com/2/cojC8OAR0YiByhyEPOO6AADzHrc9p3w7CTursS4z35A/transform/rs:fit:764/src/production/2021-02/740x435_3576f9505b43dabaea0294436ab365775c42fe56.jpg"
...
}.show()
}

Attribute

Attribute NameXml AttrsRelated method(s)Description
Type SnackbarN/AtypeTo set Snackbar Type
View AnchorN/AviewTo set Snackbar Anchor View
Description TextN/AdescriptionTo set Snackbar Description
Title TextN/AtitleTo set Snackbar Title
Duration SnackbarN/AdurationTo set Snackbar Duration
Action TextN/AactionTextTo set Snackbar Action Text
Icon DrawableN/AiconTo set Snackbar Icon
Avatar UrlN/AavatarUrlTo set Snackbar Avatar Url
Callback ButtonN/AsetActionButtonListener { //Action }To set Snackbar Callback Action Button