Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Android Studio, create two types of rows in your RecyclerView: a normal row and a row for more serious crimes. To implement this, you

Using Android Studio,

create two types of rows in your RecyclerView: a normal row and a row for more serious crimes.

To implement this, you will work with the view type feature available in RecyclerView.Adapter. Add a new property, mRequiresHR, to the Crime object and use it to determine which view to load on the CrimeAdapter by implementing the getItemViewType(int) method (developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#getItemViewType(int)).

In the onCreateViewHolder(ViewGroup, int) method, you will also need to add logic that returns a different ViewHolder based on the new viewType value returned by getItemViewType(int). Use the original layout for crimes that do not require human resources intervention and a new layout with a streamlined interface containing a button that says contact HR for crimes that do.

The repository is available at

https://bitbucket.org/brianthoms/criminalintent-2/downloads/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions