Moster_03_Display selected data items #3
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a RecyclerView to layout fragment
1. Add a RecyclerView to fragment
2. Create a RecyclerView item layout
@layout/monster_grid_item
3. Create a RecyclerView adapter class
Adapters provide a binding from an app-specific data set to views that are displayed.
RecyclerView display the data at the specified position. This should update the contents of the
ViewHolder#itemView
to reflect the item at the given position.The ViewHolder which should be updated to represent the contents of the item at the given position in the data set.
4. Display images dynamically with Glide
Glide supports fetching and displaying video stills, images, and animated GIFs. Glide includes a flexible api that allows developers to plug in to almost any network stack. By default Glide uses a custom HttpUrlConnection based stack, but also includes utility libraries plug in to Google’s Volley project or Square’s OkHttp library instead.
Click Here
5. Add a dynamic background to data item
Implemented Resources Types as Color state list resource and Vector Drawables
Selectors Required. This must be the root element. Contains one or more elements.
Drawable resources is a general concept for a graphic that can be drawn to the screen. An XML file that defines a geometric shape, including colors and gradients. Creates a GradientDrawable.
6. Refresh data with a swipe gesture
The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture. The activity that instantiates this view should add an OnRefreshListener to be notified whenever the swipe to refresh gesture is completed.