ImageView
ImageView is responsible for displaying images, including internal resources and external web images.
Core Attributes
Toast
Toast is a light-weight floating notification box that will disappear automatically after a few seconds.
1 | Toast.makeText( |
Don’t forget to invoke .show()!
Snackbar
Snackbar is another light-weight notifcation component that supports buttons. Since it can interact with users, it’s more flexible and is often used to replace Toast for information that requires fast response.
First, we have to add dependency in build.gradle
1 | dependencies { implementation 'com.google.android.material:material:1.9.0' } |
| features | Snackbar |
Toast |
|---|---|---|
| Position | Bottom of screen | set by setGravity() |