Fluent UI dual-screen Snackbar
The Snackbar
will automatically avoid rendering underneath the hinge:
Single screen
Dual-screen - only appears on one screen
To use the Fluent UI Snackbar
, configure your gradle file and import the class:
import com.microsoft.fluentui.snackbar.Snackbar
The simplest Snackbar
can be created with the following code:
Snackbar.make(view, "Single line snackbar").show()
You can add an action button and set other properties like display time with this code:
val snackbar = Snackbar.make(view, "This is a multiline snackbar. Max lines are set to two, the rest of the text will truncate.", Snackbar.LENGTH_INDEFINITE)
.setAction("Action", View.OnClickListener {
// handle click here
})
snackbar.show()