title: how to implement multiple view in one recyclerview in android
body: <p>How to create multiple views in one activity, I had tried it by using the multi Type view but it's not working
                  Is it the right way or I need to add multiple recyclerview in one activity and hide the visibility of the recyclerview according to the filter</p>
  
  <pre><code>           public class Report_Adapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {// MultipleView Adapter class where multpleview type is binding
                      Context context;
                      List&lt;BillModel&gt; list;
                      private static final int DAILY_REPORT = 1; //these are the view type position variable
  
                      private static final int YEARLY_REPORT = 3;
                      private static final int MONTHLY_REPORT = 2;
                      private static final int ITEM_WISE_REPORT = 4;
                      private static final int DETAILED_SALES_REPORT = 5;
  
  
              public Report_Adapter(Context context, List&lt;BillModel&gt; list) { //construct which is using into the activity for setAdapter.
                          this.context = context;
                          this.list = list;}
  
                      @Override
                      public int getItemViewType(int position) { //here checking the ViewType position which is getting wrong here
                          if (position == 1)  //if position equals to viewtype position return the Dailylayout View other wise will go on second position
                              return DAILY_REPORT;
                          else if (position==2){
                              return MONTHLY_REPORT;
                          }
                          else if (position ==3)
                              return CUSTOMER_REPORT;
                          else
                              return TOTAL_SALES_REPORT;
                      }
  
                      @Override
                      public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  
                          View view = null;
                          RecyclerView.ViewHolder viewHolder = null;
                            if (i == DAILY_REPORT) {
                              view = LayoutInflater.from( viewGroup.getContext()).inflate( R.layout.daily_report, viewGroup, false );
                              viewHolder = new Daily_Sales_Report( view );
                          }
                         else if (i == CUSTOMER_REPORT) {
                              view = LayoutInflater.from( viewGroup.getContext()).inflate( R.layout.activity_report__adapter, viewGroup, false );
                              viewHolder = new ViewHolder( view );
                          }else if(i==MONTHLY_REPORT) {
                             view = LayoutInflater.from( viewGroup.getContext()).inflate( R.layout.monthly_sales_report_adapter, viewGroup, false );
                             viewHolder = new ViewHolder( view ) }
                         else { view = LayoutInflater.from( viewGroup.getContext()).inflate( R.layout.total_sales_report_adapter, viewGroup, false );
               viewHolder = new ViewHolder( view) }
                return viewHolder;
               }
  
                      @Override
                      public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
  
                          final BillModel model1 = list.get( position);
                          int type = getItemViewType(position);
                           if (type == DAILY_REPORT) {
             Daily_Sales_Report daily_sales_report =(Daily_Sales_Repor)holder;
          daily_sales_report.txt_bill_no.setText( Integer.valueOf(model1.getB_Id() ) ); daily_sales_report.txt_date.setText(model1.getB_create_date() );
                              daily_sales_report.txt_total.setText( Float.toString( model1.getB_grand_total() ) );
                              daily_sales_report.txt_gst.setText( Float.toString( model1.getTotal_with_Gst() ) );
                              daily_sales_report.txt_del.setText( Integer.toString( model1.getB_del_ch() ) );
                              daily_sales_report.txt_pkg.setText( Integer.toString( model1.getB_pack_ch() ) );
                              daily_sales_report.txt_dis.setText( Float.toString( model1.getB_discount() ) );
                              daily_sales_report.txt_amt.setText( Float.toString( model1.getB_total() ) ); }
    else if (type == MONTHLY_REPORT){
            Montly_Sales_Report  report= (Montly_Sales_Report)holder;
                                final BillModel model = list.get( position);}
                            else  if (type== CUSTOMER_REPORT) {
                                final BillModel model = list.get( position);
                        ViewHolder viewHolder = (ViewHolder) holder;
                       viewHolder.txt_cust_number.setText( model.getC_phone());
                             viewHolder.txt_cust_name.setText(model.getC_name());
                            }else {
                                Total_Sales_Report total_sales_report= (Total_Sales_Report)holder;
                                total_sales_report.txt_start_date.setText(model1.getB_create_date())} }
                   @Override
  public int getItemCount() {
   return list.size();}
                   class ViewHolder extends RecyclerView.ViewHolder { //customer report viewholder
     TextView txt_cust_name, txt_cust_number;
                   public ViewHolder(View item) {
                    super( item );
              txt_cust_name = item.findViewById( R.id.txt_cust_name );
               txt_cust_number = item.findViewById( R.id.txt_cust_number)}}
  
       class Daily_Sales_Report extends RecyclerView.ViewHolder {
             private TextView txt_bill_no, txt_date, txt_gst, txt_total, txt_dis, txt_del, txt_pkg, txt_amt;
  
   public Daily_Sales_Report(View itemView) {
                                  super( itemView );
      txt_bill_no=(TextView) itemView.findViewById( R.id.daily_adapt_bill_no );
      txt_date = (TextView) itemView.findViewById( R.id.daily_adapt_date );
      txt_gst = (TextView) itemView.findViewById( R.id.daily_adpt_GST );
      txt_total = (TextView) itemView.findViewById( R.id.daily_adpt_total );
      txt_dis = itemView.findViewById( R.id.daily_adapt_dis );
      txt_del = itemView.findViewById( R.id.daily_adapt_del );
      txt_pkg = itemView.findViewById( R.id.daily_adapt_pkg );
      txt_amt = itemView.findViewById( R.id.daily_adapt_amount );}}
  
        class Montly_Sales_Report extends RecyclerView.ViewHolder {
                  private ImageView cover_image;
  private TextView txt_start_date, txt_end_date, txt_cash, txt_credit, txt_received, txt_expense, txt_total;       
           //monthly wise report view holder
           public Montly_Sales_Report(View itemView) {
                                  super( itemView );txt_start_date = (TextView) itemView.findViewById( R.id.total_adapt_startdate );
    txt_end_date = (TextView) itemView.findViewById( R.id.total_adapt_enddate );
      txt_cash = (TextView) itemView.findViewById( R.id.total_adapt_cash );
      txt_credit = itemView.findViewById( R.id.total_adapt_credit );
      txt_received = itemView.findViewById( R.id.total_adapt_recieved );
       txt_expense = itemView.findViewById( R.id.total_adapt_expense );
       txt_total = itemView.findViewById( R.id.total_adapt_sell );}
                   }
  </code></pre>
  
  <p>I want this type of functionality for multiple search data from the database as you can see in this <a href="https://i.stack.imgur.com/2fMat.png" rel="nofollow noreferrer">image</a><a href="https://i.stack.imgur.com/kgiGj.png" rel="nofollow noreferrer">2</a></p>