title: create horizontal recyclerview in vertical recyclerview like google play store with volley
body: <p>I want create horizontal recyclerview inside vertical recyclerview like google play store and get data with volley and display, i see this sample <a href="http://android-pratap.blogspot.co.uk/2015/12/horizontal-recyclerview-in-vertical.html" rel="nofollow noreferrer">http://android-pratap.blogspot.co.uk/2015/12/horizontal-recyclerview-in-vertical.html</a>
  but not use volley for display data in recyclerview,<strong>how to can used this API for display data in recyclerview horizontal recyclerview inside vertical recyclerview with volley</strong>?
  API:<a href="http://monaasoft.com/indianfm/api/test.json" rel="nofollow noreferrer">http://monaasoft.com/indianfm/api/test.json</a>
  Help me please</p>
  
  <p>Data</p>
  
  <pre><code>public class Data {
  
  
  private String title;
  private List&lt;Section&gt; section;
  
  
  public Data(){
  
  }
  
  public Data(String title,List&lt;Section&gt; sections){
      this.title=title;
      this.section=section;
  }
  
  
  public String getTitle() {
      return title;
  }
  
  public void setTitle(String title) {
      this.title = title;
  }
  
  public List&lt;Section&gt; getSection() {
      return section;
  }
  
  public void setSection(List&lt;Section&gt; section) {
      this.section = section;
  }
  
  
   }
  </code></pre>
  
  <p>Section</p>
  
  <pre><code>public class Section {
  private String name;
  private String image;
  
  
  public Section(){
  
  }
  
  
  public Section(String name,String image){
      this.name=name;
      this.image=image;
  }
  
  public String getImage() {
      return image;
  }
  
  public void setImage(String image) {
      this.image = image;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  
   }
  </code></pre>
  
  <p>RecyclerViewDataAdapter </p>
  
  <pre><code>public class RecyclerViewDataAdapter extends 
  RecyclerView.Adapter&lt;RecyclerViewDataAdapter.ItemRowHolder&gt; {
  
  private List&lt;Data&gt; dataList;
  private Context mContext;
  
  public RecyclerViewDataAdapter(Context context, List&lt;Data&gt; dataList) {
      this.dataList = dataList;
      this.mContext = context;
  }
  
  
  
  @Override
  public ItemRowHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = 
  LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_item, 
  null);
      ItemRowHolder mh = new ItemRowHolder(v);
      return mh;
  }
  
  @Override
  public void onBindViewHolder(ItemRowHolder itemRowHolder, int i) {
  
      final String sectionName = dataList.get(i).getTitle();
  
      List singleSectionItems = dataList.get(i).getSection();
  
      itemRowHolder.itemTitle.setText(sectionName);
  
      SectionListDataAdapter itemListDataAdapter = new 
      SectionListDataAdapter(mContext, singleSectionItems);
  
      itemRowHolder.recycler_view_list.setHasFixedSize(true);
      itemRowHolder.recycler_view_list.setLayoutManager(new 
      LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
      itemRowHolder.recycler_view_list.setAdapter(itemListDataAdapter);
  
  
      itemRowHolder.recycler_view_list.setNestedScrollingEnabled(false);
  
  
     /*  itemRowHolder.recycler_view_list.setOnTouchListener(new 
      View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              int action = event.getAction();
              switch (action) {
                  case MotionEvent.ACTION_DOWN:
                      // Disallow ScrollView to intercept touch events.
                      v.getParent().requestDisallowInterceptTouchEvent(true);
                      break;
                  case MotionEvent.ACTION_UP:
                      //Allow ScrollView to intercept touch events once again.
                      v.getParent().requestDisallowInterceptTouchEvent(false);
                      break;
              }
              // Handle RecyclerView touch events.
              v.onTouchEvent(event);
              return true;
          }
      });*/
  
      itemRowHolder.btnMore.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
  
              Toast.makeText(v.getContext(), "click event on more, 
      "+sectionName , Toast.LENGTH_SHORT).show();
  
  
  
          }
      });
  
  
  
  
  
  
  
     /* Glide.with(mContext)
              .load(feedItem.getImageURL())
              .diskCacheStrategy(DiskCacheStrategy.ALL)
              .centerCrop()
              .error(R.drawable.bg)
              .into(feedListRowHolder.thumbView);*/
  }
  
  @Override
  public int getItemCount() {
      return (null != dataList ? dataList.size() : 0);
  }
  
  public class ItemRowHolder extends RecyclerView.ViewHolder {
  
      protected TextView itemTitle;
  
      protected RecyclerView recycler_view_list;
  
      protected Button btnMore;
  
  
  
      public ItemRowHolder(View view) {
          super(view);
  
          this.itemTitle = (TextView) view.findViewById(R.id.itemTitle);
          this.recycler_view_list = (RecyclerView) view.findViewById(R.id.recycler_view_list);
          this.btnMore= (Button) view.findViewById(R.id.btnMore);
  
  
      }
  
  }
  
  }
  </code></pre>
  
  <p>SectionListDataAdapter</p>
  
  <pre><code>public class SectionListDataAdapter extends 
  RecyclerView.Adapter&lt;SectionListDataAdapter.SingleItemRowHolder&gt; {
  
  private List&lt;Section&gt; itemsList;
  private Context mContext;
  
  public SectionListDataAdapter(Context context, List&lt;Section&gt; itemsList) {
      this.itemsList = itemsList;
      this.mContext = context;
  }
  
  @Override
  public SingleItemRowHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = 
  
  
   LayoutInflater.from(viewGroup.getContext())
  .inflate(R.layout.list_single_card, 
    null);
      SingleItemRowHolder mh = new SingleItemRowHolder(v);
      return mh;
  }
  
  @Override
  public void onBindViewHolder(SingleItemRowHolder holder, int i) {
  
      Section singleItem = itemsList.get(i);
  
      holder.tvTitle.setText(singleItem.getName());
  
  
      Glide.with(mContext)
              .load(singleItem.getImage())
              .diskCacheStrategy(DiskCacheStrategy.ALL)
              .centerCrop()
              .into(holder.itemImage);
  }
  
  @Override
  public int getItemCount() {
      return (null != itemsList ? itemsList.size() : 0);
  }
  
  public class SingleItemRowHolder extends RecyclerView.ViewHolder {
  
      protected TextView tvTitle;
  
      protected ImageView itemImage;
  
  
      public SingleItemRowHolder(View view) {
          super(view);
  
          this.tvTitle = (TextView) view.findViewById(R.id.tvTitle);
          this.itemImage = (ImageView) view.findViewById(R.id.itemImage);
  
  
          view.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
                  Toast.makeText(v.getContext(), tvTitle.getText(), 
          Toast.LENGTH_SHORT).show();
  
              }
          });
  
  
      }
  
  }
  
    }
  </code></pre>
  
  <p>MainAcivity</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  private Toolbar toolbar;
  private RecyclerView my_recycler_view;
  private RecyclerView.LayoutManager layoutManager;
  private RecyclerView.Adapter adapter;
  List&lt;Data&gt; allSampleData;
  private String TEST_URL="http://monaasoft.com/indianfm/api/test.json";
  
  
  
    @Override
     protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      toolbar = (Toolbar) findViewById(R.id.toolbar);
      allSampleData=new ArrayList&lt;Data&gt;();
      my_recycler_view = (RecyclerView) findViewById(R.id.my_recycler_view);
  
      my_recycler_view.setHasFixedSize(true);
  
      RecyclerViewDataAdapter adapter = new 
     RecyclerViewDataAdapter(MainActivity.this, allSampleData);
  
      my_recycler_view.setLayoutManager(new 
    LinearLayoutManager(MainActivity.this, LinearLayoutManager.VERTICAL, 
    false));
  
      my_recycler_view.setAdapter(adapter);
  
  
  
   JsonArrayRequest newreq=new JsonArrayRequest(TEST_URL, new 
   Response.Listener&lt;JSONArray&gt;() {
  @Override
    public void onResponse(JSONArray response) {
  
  
       Log.d("main",""+response);
  
  
  
  
  
        for (int i=0 ; i&lt;=response.length();i++){
          try {
              JSONObject sectionObj= (JSONObject) response.get(i);
              String title=sectionObj.getString("title");
              List&lt;Section&gt; sections=new ArrayList&lt;Section&gt;();
  
  
              JSONArray sectionArray=sectionObj.getJSONArray("section");
              for(int j=0;j&lt;sectionArray.length();j++){
                  JSONObject obj=(JSONObject) sectionArray.get(j);
                  Section section = new Section();
  
                  section.setName(obj.getString("name"));
                  section.setImage(obj.getString("image"));
                  sections.add(section);
  
                  Data data= new Data();
  
                  data.setTitle(title);
                  data.setSection(sections);
  
  
                  allSampleData.add(data);
  
              }
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
      }
  
  
    }
        }, new Response.ErrorListener() {
     @Override
     public void onErrorResponse(VolleyError error) {
  
     }
      });
  
  
       MySingleton.getInstance(this).addToRequestQueue(newreq);
  
                  }
  
  
  
          }
  </code></pre>
  
  <p>MySingleton </p>
  
  <pre><code>    public class MySingleton {
      private static MySingleton mInstance;
      private RequestQueue mRequestQueue;
      private ImageLoader mImageLoader;
      private static Context mCtx;
  
      private MySingleton(Context context) {
          mCtx = context;
          mRequestQueue = getRequestQueue();
  
          mImageLoader = new ImageLoader(mRequestQueue,
                  new ImageLoader.ImageCache() {
                      private final LruCache&lt;String, Bitmap&gt;
                              cache = new LruCache&lt;String, Bitmap&gt;(20);
  
                      @Override
                      public Bitmap getBitmap(String url) {
                          return cache.get(url);
                      }
  
                      @Override
                      public void putBitmap(String url, Bitmap bitmap) {
                          cache.put(url, bitmap);
                      }
                  });
      }
  
      public static synchronized MySingleton getInstance(Context context) {
          if (mInstance == null) {
              mInstance = new MySingleton(context);
          }
          return mInstance;
      }
  
      public RequestQueue getRequestQueue() {
          if (mRequestQueue == null) {
              // getApplicationContext() is key, it keeps you from leaking the
              // Activity or BroadcastReceiver if someone passes one in.
              mRequestQueue = 
             Volley.newRequestQueue(mCtx.getApplicationContext());
          }
          return mRequestQueue;
      }
  
      public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req) {
          getRequestQueue().add(req);
      }
  
      public ImageLoader getImageLoader() {
          return mImageLoader;
      }
  }
  </code></pre>