title: Setting Layout params programmatically recyclerview's item
body: <p>I am using <code>RecyclerView</code> in which I have a <code>RelativeLayout</code>. In that <code>RelativeLayout</code>, I have a 2 <code>TextView</code>. If the first <code>TextView</code> has some value which decides if the second <code>TextView</code> should be aligned to right or left.</p>
  
  <p>I have set the <code>LayoutParams</code> in <code>RecyclerView</code> Adapter using the below code: </p>
  
  <pre><code>if (listItem.getmLikeCount() &gt; 0) {
      RelativeLayout.LayoutParams feedCommentParams = new RelativeLayout.LayoutParams(
          RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
      feedCommentParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
      listItemHolder.mCommentCount.setLayoutParams(feedCommentParams);
  } else {
      listItemHolder.mLikeCount.setVisibility(View.GONE);
      RelativeLayout.LayoutParams feedCommentParams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
      feedCommentParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 0);
      listItemHolder.mCommentCount.setLayoutParams(feedCommentParams);
  }
  </code></pre>
  
  <p>But the items are getting recycled i.e. if any of the <code>RecyclerView</code> items is not having any <code>count</code> then all other items are also aligned to the left.</p>
  
  <p>I want to show the comment count to Right if like <code>count &gt; 0</code> else show comment count to left. </p>