A Snackbar can have a single action that the user can respond to. Here we look at how such an action can be hooked up.
- [Instructor] A snackbar can have a single action.…In the case of our application, we want to give the user…an opportunity to undo the operation…that added a new activity to the activity list.…Since snackbars are transient in nature,…you will normally give the user another way…to perform the same function if you want them…to have access to it later.…Ultimately, the snackbar is a user convenience feature,…to notify the user of an application event…and give them an opportunity to respond to it.…Since we want our snackbar to be able to respond…when the Undo prompt is touched, we need a class…to implement the View.IOnClickListener.…
We are going to implement it in the main activity itself.…So at the top, we're going to implement this interface.…And that's going to be View.IOnClickListener.…And if I right-click on that, I'll click Fix,…and say implement interface.…And that's going to add a new method, OnClick.…The OnClick method takes a view as a parameter.…It is possible for this activity to be used…as a click handler for more views than our snackbar.…
- Breaking down a material design layout
- Adding AppCompat
- Adding icons and floating action buttons
- Animating the appearance
- Creating a RecyclerView
- Creating a ViewHolder
- Modifying the adapter
- Adding CardView
- Adding transition animations
- Adding a Snackbar
- Working with CoordinatorLayout
Skill Level Intermediate
1. What Is Android Material Design?
2. Implementing Material Design
3. Floating Action Button
View state change animations4m 17s
Next steps1m 40s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.