title: Listview style Each Row
body: <p>this is the code in my custom adapter (THE CODE IN BROWN COLOR) when initially list is build proper margin is applied to valid items when i scroll down and again scroll up all the rows in list shifts the margin left by 20 what i'm doing wrong please reply soon</p>
  
  <pre><code>@Override
      public View getView(final int position, View convertView, ViewGroup parent) {
  
          final ViewHolder holder;
          // getting data
          final ViewMovieDetailsModel_ViewComments movies = getItem(position);
  
          if (convertView == null) 
          {
              convertView = View.inflate(context, R.layout.comment_row, null);                
              holder = new ViewHolder();
  
              //getting handles
  
              holder.comments_linearLayout = (LinearLayout) convertView.findViewById(R.id.comments_linearLayout);
              holder.commenter_textView = (TextView) convertView.findViewById(R.id.comment_row_commenter);
              holder.commented_on_textView = (TextView) convertView.findViewById(R.id.comment_row_comment_time);
              holder.comment_text_textView = (TextView) convertView.findViewById(R.id.comment_row_comment_text);
              holder.reply_button = (Button) convertView.findViewById(R.id.comment_row_reply_button);
  
              convertView.setTag(holder);
          }
          else
          {
              holder = (ViewHolder)convertView.getTag();
          }
  
          if (movies != null) 
          {
              if (((movies.getParent_comment_id()).toString().equals("null")) &amp;&amp; session.isLoggedIn()==true) {
                  holder.reply_button.setVisibility(View.VISIBLE);
              }else{
                  holder.reply_button.setVisibility(View.INVISIBLE);
              }
  
  
  `if (!((movies.getParent_comment_id()).toString().equals("null"))) 
  {
  
  LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
                      params.setMargins(20, 0, 0, 0);
                      holder.comments_linearLayout.setLayoutParams(params);
  }`
  
  
              holder.commenter_textView.setText(movies.getUsername_commentor());
  
              holder.commenter_textView.setTag(movies.getUser_id_commentor());
  
          return convertView;
      }
  </code></pre>