title: ImageViews change colors upon selection of one of their "brother" ImageViews
body: <p>The issue that I am having is I have a <code>comment_item.xml</code> with the user's <strong>comment, username, like and dislike and comment</strong> <code>ImageView</code> and also a <code>TextView</code> for number of <strong>comments, number of likes, and number of dislikes</strong>. The problem is of a post has for example 13 comments and I like or dislike one of the comments by clicking on the <code>ImageView</code> the other ones "blink". What I mean by that is that in my Activity I made it so that when you hit like the thumb <code>ImageView</code> turns from grey to red, and if you hit dislike <code>ImageView</code> it turns from grey to black and then you get the updated number of likes or dislikes alongside. But when I hit the <code>ImageView</code> for like or dislike all the other comment's like and dislike <code>ImageViews</code> also turn a different color then come back to the color they were at originally... It's like a "blink" per say, so you guys understand what I mean by the action taking place.</p>
  
  <p>How can I prevent that from happening. All the other comment's like and dislike <code>ImageView</code> shouldn't react if I hit like or dislike for some other comment...</p>
  
  <p>I think the problem might be in my xml file, but I am not 100%. Uploaded a picture so you guys can see the UI. Now when I click on either like or dislike all the other likes and dislikes "blink" change to the opposite color they are in and then switch back... like a blink. I need that to not happen. They should not be reacting if I'm hitting like or dislike on another post...</p>
  
  <p><a href="https://i.stack.imgur.com/7MDTm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7MDTm.jpg" alt="enter image description here"></a></p>
  
  <p><strong>comment_item.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:padding="8dp"&gt;
  
      &lt;de.hdodenhof.circleimageview.CircleImageView
          android:id="@+id/image_profile"
          android:layout_width="40dp"
          android:layout_height="40dp" /&gt;
  
      &lt;LinearLayout
          android:id="@+id/linear_layout_one"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginStart="5dp"
          android:layout_marginBottom="10dp"
          android:layout_toEndOf="@+id/image_profile"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/username"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="@color/colorPrimaryAqua50"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:id="@+id/comment"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:maxLines="5" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/linear_layout_two"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/linear_layout_one"
          android:layout_marginBottom="15dp"
          android:orientation="horizontal"&gt;
  
          &lt;ImageView
              android:id="@+id/icon_thumb_up_grey"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginStart="120dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_thumb_up_grey" /&gt;
  
          &lt;ImageView
              android:id="@+id/icon_thumb_up_red"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginStart="120dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_thumb_up_red"
              android:visibility="gone" /&gt;
  
          &lt;TextView
              android:id="@+id/comment_likes_number"
              android:layout_width="16sp"
              android:layout_height="16sp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp" /&gt;
  
          &lt;ImageView
              android:id="@+id/icon_thumb_down_grey"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_thumb_down_grey" /&gt;
  
          &lt;ImageView
              android:id="@+id/icon_thumb_down_black"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_thumb_down_black"
              android:visibility="gone" /&gt;
  
          &lt;TextView
              android:id="@+id/comment_dislikes_number"
              android:layout_width="16sp"
              android:layout_height="16sp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp" /&gt;
  
          &lt;ImageView
              android:id="@+id/icon_comment_grey"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_comment_grey" /&gt;
  
          &lt;ImageView
              android:id="@+id/icon_comment_blue"
              android:layout_width="18dp"
              android:layout_height="18dp"
              android:layout_marginTop="5dp"
              android:layout_marginEnd="15dp"
              android:src="@drawable/ic_comment_blue"
              android:visibility="gone" /&gt;
  
          &lt;TextView
              android:id="@+id/comment_response_number"
              android:layout_width="16sp"
              android:layout_height="16sp"
              android:layout_marginTop="5dp" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>CommentAdapter</strong></p>
  
  <pre><code>       holder.commentLike.setOnClickListener(v -&gt; {
  
          if (holder.commentLike.getTag().equals("like")) {
              FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(comment.getCommentid()).child("Likes").child(mFirebaseUser.getUid()).setValue(true);
              } else {
                  FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(comment.getCommentid()).child("Likes").child(mFirebaseUser.getUid()).removeValue();
              }
  
              notifyDataSetChanged();
          });
  
          holder.commentDislike.setOnClickListener(v -&gt; {
  
              if (holder.commentDislike.getTag().equals("dislike")) {
                  FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(comment.getCommentid()).child("Dislikes").child(mFirebaseUser.getUid()).setValue(true);
                  Toast.makeText(mContext, "Don't be mean", Toast.LENGTH_SHORT).show();
              } else {
                  FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(comment.getCommentid()).child("Dislikes").child(mFirebaseUser.getUid()).removeValue();
              }
  
              notifyDataSetChanged();
          });
  
  
      private void commentLike(final String commentid, final ImageView imageView) {
              if (commentid != null) {
  
  
     DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(commentid).child("Likes");
              reference.addValueEventListener(new ValueEventListener() {
                  @Override
                  public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                      if (mFirebaseUser != null)
                          if (dataSnapshot.child(mFirebaseUser.getUid()).exists()) {
                              imageView.setImageResource(R.drawable.ic_thumb_up_red);
                              imageView.setTag("liked");
                          } else {
                              imageView.setImageResource(R.drawable.ic_thumb_up_grey);
                              imageView.setTag("like");
                          }
                  }
  
                  @Override
                  public void onCancelled(@NonNull DatabaseError databaseError) {
  
                  }
              });
          }
      }
  
      private void commentDislike(final String commentid, final ImageView imageView) {
          if (commentid != null) {
              DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(commentid).child("Dislikes");
              reference.addValueEventListener(new ValueEventListener() {
                  @Override
                  public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                      if (mFirebaseUser != null)
                          if (dataSnapshot.child(mFirebaseUser.getUid()).exists()) {
                              imageView.setImageResource(R.drawable.ic_thumb_down_black);
                              imageView.setTag("disliked");
                          } else {
                              imageView.setImageResource(R.drawable.ic_thumb_down_grey);
                              imageView.setTag("dislike");
                          }
                  }
  
                  @Override
                  public void onCancelled(@NonNull DatabaseError databaseError) {
  
                  }
              });
          }
      }
  
      private void commentLikesNumber(TextView commentLikesNumber, String commentid) {
          DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(commentid).child("Likes");
          reference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  commentLikesNumber.setText(dataSnapshot.getChildrenCount() + "");
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
          });
      }
  
      private void commentDislikesNumber(TextView commentDislikesNumber, String commentid) {
          DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Comment Liked or Disliked").child(commentid).child("Dislikes");
          reference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  commentDislikesNumber.setText(dataSnapshot.getChildrenCount() + "");
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
          });
      }
  }
  </code></pre>