title: Horizontal recyclerview inside fragment not scrolling
body: <p>I want to add horizontal recyclerview at the bottom of fragment. I followed the tutorial and successfully implemented horizontal recyclerview and cardview but after trying all possible answers,horizontal scrolling is not working. </p>
  
  <p><strong>Here is my code :- 
  XML :-</strong> </p>
  
  <pre><code> &lt;RelativeLayout tools:context="com.AlfaCab.Menuactivtiy"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:layout_marginTop="56dp"
      android:id="@+id/Mainlayout"
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:background="@color/BgColor"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_alignParentBottom="true"
          android:background="@drawable/offer_white_box"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="Offers"
          android:gravity="center"
          android:textSize="18sp"
          android:textColor="@color/BlackTextColor"
          android:textStyle="bold"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="10dp"
          android:layout_marginTop="10dp"
          android:layout_marginBottom="5dp" /&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recyclerView_offer"
          android:orientation="horizontal"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layoutManager="android.support.v7.widget.LinearLayoutManager"
          android:scrollbars="none"/&gt;
        &lt;!--  android:orientation="horizontal"
          android:scrollbars="horizontal"
          app:layoutManager="android.support.v7.widget.LinearLayoutManager"
         /&gt; --&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Here is my offer_cardview.xml / custom layout for recyclerview :-</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:orientation="vertical" android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;
  
          &lt;android.support.v7.widget.CardView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="5dp"&gt;
  
                &lt;!--  &amp;lt;!&amp;ndash;Offer Start&amp;ndash;&amp;gt;
                  &lt;LinearLayout
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:orientation="vertical"
                      android:background="@drawable/offer_white_box"&gt;
      --&gt;
  
                      &lt;LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:orientation="horizontal"&gt;
  
                          &lt;!--Offer Coupon--&gt;
                          &lt;LinearLayout
                              android:layout_width="140dp"
                              android:layout_height="wrap_content"
                              android:orientation="vertical"
                              android:background="@drawable/round_box"
                              &gt;
                              &lt;LinearLayout
                                  android:id="@+id/ll_offer_bg"
                                  android:layout_width="match_parent"
                                  android:layout_height="60dp"
                                  android:orientation="horizontal"
                                  android:background="@drawable/offer_red_box"
                                  android:layout_marginBottom="3dp"&gt;
                                  &lt;TextView
                                      android:id="@+id/tv_offer_title"
                                      android:layout_width="match_parent"
                                      android:layout_height="wrap_content"
                                      android:text="Get 30% Cashback"
                                      android:textSize="12sp"
                                      android:textColor="@color/WhiteTextColor"
                                      android:textStyle="bold"
                                      android:layout_gravity="center_vertical"
                                      android:gravity="center"/&gt;
                              &lt;/LinearLayout&gt;
                              &lt;TextView
                                  android:id="@+id/tv_offer_disc"
                                  android:layout_width="match_parent"
                                  android:layout_height="80dp"
                                  android:text="upto Rs. 300 cashback on Outstation"
                                  android:textSize="10sp"
                                  android:textColor="@color/BlackTextColor"
                                  android:layout_marginBottom="5dp"
                                  android:layout_marginLeft="5dp"
                                  android:layout_marginRight="5dp"/&gt;
                          &lt;/LinearLayout&gt;
                          &lt;!--Offer Coupon Ends--&gt;
                      &lt;/LinearLayout&gt;
  
                  &lt;!--&lt;/LinearLayout&gt;--&gt;
                  &lt;!--Offer Ends--&gt;  
     &lt;/android.support.v7.widget.CardView&gt;
  
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>HomeFragment.java :-</strong></p>
  
  <pre><code>//a list to store all the products
  
  List&lt;Offer_Data&gt; offerList;
  
  //the recyclerview
  RecyclerView recyclerView;
  
  String appOfferId,appOfferTitle,appOfferDes,status;
  </code></pre>
  
  <p><strong>In onCreate :-</strong> </p>
  
  <pre><code>   //getting the recyclerview from xml
          recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView_offer);
  </code></pre>
  
  <p><strong>After successfully adding data to offerList :-</strong></p>
  
  <pre><code> //creating recyclerview adapter
              Offer_Adapter adapter = new Offer_Adapter(getActivity(), offerList);
              //adapter.notifyDataSetChanged();
              recyclerView.setHasFixedSize(true);
              recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
              recyclerView.setAdapter(adapter);
              adapter.notifyDataSetChanged();// Notify the adapter
  </code></pre>
  
  <p><strong>Offer_Adapter.java :-</strong> (Recyclervire adapter)</p>
  
  <pre><code>public class Offer_Adapter extends RecyclerView.Adapter&lt;Offer_Adapter.ProductViewHolder&gt; {
  
      int[] myImageList;
      //this context we will use to inflate the layout
      private Context mCtx;
  
      //we are storing all the products in a list
      private List&lt;Offer_Data&gt; offerList;
  
      //getting the context and product list with constructor
      public Offer_Adapter(Context mCtx, List&lt;Offer_Data&gt; offerList) {
          this.mCtx = mCtx;
          this.offerList = offerList;
          this.myImageList = new int[]{R.drawable.offer_red_box, R.drawable.offer_megento_box, R.drawable.offer_yellow_box};
      }
  
      @Override
      public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          //inflating and returning our view holder
          LayoutInflater inflater = LayoutInflater.from(mCtx);
          View view = inflater.inflate(R.layout.offer_cardview, null);
          return new ProductViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(ProductViewHolder holder, int position) {
          //getting the product of the specified position
          Offer_Data product = offerList.get(position);
  
          //binding the data with the viewholder views
          holder.tv_offer_title.setText(product.getOffer_title());
          holder.tv_offer_disc.setText(product.getOffer_disc());
  
          int random_box = getRandom(myImageList);
          holder.ll_offer_bg.setBackgroundResource(random_box);
      }
  
      public static int getRandom(int[] array) {
          int rnd = new Random().nextInt(array.length);
          return array[rnd];
      }
  
      @Override
      public int getItemCount() {
          return offerList.size();
      }
  
  
      class ProductViewHolder extends RecyclerView.ViewHolder {
  
          TextView tv_offer_title, tv_offer_disc;
          LinearLayout ll_offer_bg;
  
  
          public ProductViewHolder(View itemView) {
              super(itemView);
  
              tv_offer_title = (TextView) itemView.findViewById(R.id.tv_offer_title);
              tv_offer_disc = (TextView) itemView.findViewById(R.id.tv_offer_disc);
              ll_offer_bg = (LinearLayout)itemView.findViewById(R.id.ll_offer_bg);
          }
      }
  }
  </code></pre>
  
  <p>Please, help me to make it scroll horizontally.</p>