title: ListView with Horizontal ScrollView
body: <p>I am trying to make a listview which consists of a horizontal scrollview as each one of the rows. I want the elements to be lined up vertically so the view would become scrollable if there are more then a certain amount of items.</p>
  
  <p>However it comes out looking like this.</p>
  
  <p><a href="https://i.stack.imgur.com/KwmDV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KwmDV.png" alt="enter image description here"></a></p>
  
  <p>I am inflating the following xml</p>
  
  <p><strong>single_row.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:background="#FFFFFF"
      android:layout_height="fill_parent"&gt;
  
      &lt;HorizontalScrollView  xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;LinearLayout
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"&gt;
  
          &lt;com.example.jj.library.ChipView
              android:layout_weight="1"
              android:id="@+id/text_chip_layout"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content" /&gt;
          &lt;/LinearLayout&gt;
  
      &lt;/HorizontalScrollView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is my adapter to add the views to the view</p>
  
  <p><strong>Adapter.java</strong></p>
  
  <pre><code>import android.content.Context;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  
  import com.example.jj.library.Chip;
  import com.example.jj.library.ChipView;
  import com.example.jj.library.ChipViewAdapter;
  import com.example.jj.library.OnChipClickListener;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by jj on 12/21/2015.
   */
  public class LiveFeedAdapter extends ArrayAdapter&lt;LiveFeedDataProvider&gt; implements OnChipClickListener {
  
  
      private static final String TAG = "LIVEFEED ADAPTER";
      Context CTX;
      private ChipView mTextChipLayout;
      public List&lt;LiveFeedDataProvider&gt; liveFeed_list = new ArrayList&lt;LiveFeedDataProvider&gt;();
  
      public LiveFeedAdapter(Context context, int resource) {
          super(context, resource);
          CTX = context;
      }
  
      @Override
      public void add(LiveFeedDataProvider object){
          liveFeed_list.add(object);
          super.add(object);
      }
  
      @Override
      public int getCount() {
          return liveFeed_list.size();
      }
  
  
      @Override
      public LiveFeedDataProvider getItem(int position) {
  
          return liveFeed_list.get(position);
      }
  
      @Override
      public View getView(final int position, View convertView, final ViewGroup parent) {
          if(convertView == null){
              LayoutInflater inflator = (LayoutInflater) CTX.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView = inflator.inflate(R.layout.single_livefeed_row,parent,false);
          }
          ChipViewAdapter adapterLayout = new MainChipViewAdapter(getContext());
          mTextChipLayout = (ChipView) convertView.findViewById(R.id.text_chip_layout);
          mTextChipLayout.setAdapter(adapterLayout);
          mTextChipLayout.setChipLayoutRes(R.layout.chip_close);
          mTextChipLayout.setChipBackgroundColor(CTX.getResources().getColor(R.color.light_blue));
          mTextChipLayout.setChipBackgroundColorSelected(CTX.getResources().getColor(R.color.green));
          mTextChipLayout.setOnChipClickListener(this);
          LiveFeedDataProvider provider = liveFeed_list.get(position);
          Log.d(TAG, "LENGTH = " + provider.interests.length);
          for(int i = 0; i &lt; provider.interests.length; i++) {
              String interest = provider.interests[i];
              mTextChipLayout.add(new Tag(interest));
          }
              return convertView;
      }
  
      @Override
      public void onChipClick(Chip chip) {
  
      }
  
  }
  </code></pre>