Lecture 4 & HW 4: RecyclerViews
10/17/22 - Lecture 4 Demo for RecyclerViews
10/19/22 - Discussion 4 Demo. Same as Lecture 4 Demo, but has notifyItemChanged() example.
Your goal is to recreate a simple version of Spotify's playlist view using
RecyclerViewand topics learned from previous weeks. We'll provide some guidelines below, but you will have the freedom to design the UI how you'll like!
1. Create an activity (ie. MainActivity) that has a
RecyclerViewthat contains at least 10 different songs. Each cell in the
RecyclerViewmust include an image, song name, artist, and album, and the cell must be built from a custom layout. You also must use a model to represent the information in each cell. Be clever with your models, especially with your image, to make it easier for your Adapter to use.
2. Clicking on a cell should open a new activity (ie. SongDetailActivity.kt) that displays the song's image, name, artist, and album.
3. In SongDetailActivity, there should be a save button and a way for the user to edit the song name, artist, and album. When the user clicks the save button, the song title should change to the new one, and the user should be redirected back to MainActivity. The list in MainActivity should also reflect this change.
These are optional challenge problems, and completing each successfully will earn you 1 extra point per problem. If you do attempt a challenge problem, make sure to include a
README.txtthat states which problem(s) you've attempted!
- Create an Implicit Intent to share songs and the details of the song to other apps.
- Add a search bar at the top of the MainActivity in order to search for specific songs in the dataset.
- Add an icon (ie. heart) to each cell in MainActivity for liking a song. When the user clicks on this icon, the icon should change color or shape to represented "liked". The user should also be able to undo the like.
- Add two filter buttons to the top of MainActivity, one for displaying all songs and one for displaying liked songs. Clicking on the buttons should filter the songs accordingly.
- Add the ability for the user to add new songs and delete songs from the playlist. You have the freedom to design the user interactions for this feature -- just make sure to describe how it works in the
- In SongDetailActivity, add the ability to change the song image with an image from the user's internal storage. You will need to ask for permission to access the user's storage as well as account for what happens if the user denies permissions.
For this assignment, you may need to figure out a few things on your own. Some classes that may be helpful for this assignment include:
For basic functionality:
For challenge problems: