Skip to content

Commit

Permalink
Step.03-Exercise-Recycling-ViewHolders
Browse files Browse the repository at this point in the history
  • Loading branch information
Jill Heske authored and yenerm committed Jun 5, 2019
1 parent ef0fb43 commit 8fd6157
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ class SleepNightAdapter : RecyclerView.Adapter<TextItemViewHolder>() {
override fun onBindViewHolder(holder: TextItemViewHolder, position: Int) {
val item = data[position]
holder.textView.text = item.sleepQuality.toString()

// TODO (01) Add an if block and set the sleep quality to red
// if sleepQuality is 1 or less.

// TODO (02) Run the app and see that color does not reset to black.

// TODO (03) Add an else clause and reset the color if sleepQuality is 2 or higher.

// TODO (04) Run the app again and verify that the color displays correctly
// for all sleepQuality values.
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextItemViewHolder {
Expand Down

0 comments on commit 8fd6157

Please sign in to comment.