Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
quadcopterman committed Jun 28, 2024
1 parent 12e1f4b commit c76ef0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ class ChirpListAdapter(
itemText.text = text

// Changes the color of the profile if the chirps comes from another LAO
if (chirp.laoId != laoViewModel.laoId) {
if (chirp.laoId == laoViewModel.laoId) {
itemProfile.imageTintList = context.getColorStateList(R.color.colorAccent)
} else {
itemProfile.imageTintList = context.getColorStateList(R.color.gray)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ class ChirpListAdapterTest {
val view1 = chirpListAdapter.getView(0, null, layout)
Assert.assertNotNull(view1)

// The chirp of our LAO should have an unmodified color (null in this case)
// The chirp of our LAO should be blue
val profile1 = view1.findViewById<ImageView>(R.id.social_media_profile)
Assert.assertNotNull(profile1)
Assert.assertNull(profile1.imageTintList)
Assert.assertEquals(context.getColor(R.color.colorAccent), profile1.imageTintList?.defaultColor)

// Get the view for the second chirp in the list.
val view2 = chirpListAdapter.getView(1, null, layout)
Expand Down

0 comments on commit c76ef0f

Please sign in to comment.