title: How to add loading progress at bottom of recyclerview?
body: <p>I have an app which contain recyclerview with ads in between recyclerview and Losing progress as footer at bottom of recyclerview when I scroll at bottom of RecyclerView it is adding more data in dataset all is working fine but problem is with adding loading progress at bottom.</p>
  
  <p>Code of main activity:</p>
  
  <pre><code> contacts = new ArrayList&lt;&gt;();
      random = new Random();
      for (int i = 0; i &lt; 5; i++) {
          Contact contact = new Contact();
          contact.setPhone(phoneNumberGenerating());
          contact.setEmail("Contact" + i + "@gmail.com");
          contact.setViewType(1);
          contacts.add(contact);
      }
      //Place two Admob Ads in recyclerview
      Contact myString1 = new Contact();
      myString1.setViewType(2);
      contacts.add(3,myString1);
  
      recyclerView.setLayoutManager(new LinearLayoutManager(this));
      contactAdapter = new ContactAdapter(recyclerView, contacts, this);
      recyclerView.setAdapter(contactAdapter);
  
      //set load more listener for the RecyclerView adapter
      contactAdapter.setOnLoadMoreListener(new OnLoadMoreListener() {
          @Override
          public void onLoadMore() {
              if (contacts.size() &lt;= 7) {
                  contacts.add(null);
                  contactAdapter.notifyItemInserted(contacts.size() - 1);
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          contacts.remove(contacts.size() - 1);
                          contactAdapter.notifyItemRemoved(contacts.size());
  
                          //Generating more data
                          int index = contacts.size();
                          int end = index + 2;
                          for (int i = index; i &lt; end; i++) {
                              Contact contact = new Contact();
                              contact.setPhone(phoneNumberGenerating());
                              contact.setEmail("DevExchanges" + i + "@gmail.com");
                              contact.setViewType(1);
                              contacts.add(contact);
                          }
                          //Place one Admob Ads in recyclerview
                          Contact myString1 = new Contact();
                          myString1.setViewType(2);
                          contacts.add(3,myString1);
  
                          contactAdapter.notifyDataSetChanged();
                          contactAdapter.setLoaded();
                      }
                  }, 5000);
              } else {
                  Toast.makeText(MainActivity.this, "Loading data completed", Toast.LENGTH_SHORT).show();
              }
          }
      });
  </code></pre>
  
  <p>code of adapter:</p>
  
  <pre><code>public int getItemViewType(int position) {
      if (position == contacts.size()) {
          // footer_view to check in your switch/case
          return 3;
      }
      return contacts.get(position).getViewType();
  }
  
  @Override
  public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      RecyclerView.ViewHolder viewHolder = null;
      LayoutInflater inflater = LayoutInflater.from(parent.getContext());
      switch (viewType) {
          case 1:
              View itemView = inflater.inflate(R.layout.item_recycler_view_row, parent, false);
              viewHolder = new UserViewHolder(itemView);
              break;
          case 2:
              View adView = inflater.inflate(R.layout.item_three, parent, false);
              viewHolder = new ItemThree(adView);
              break;
          case 3:
              View loading = inflater.inflate(R.layout.item_loading, parent, false);
              viewHolder = new LoadingViewHolder(loading);
              break;
      }
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
      switch (holder.getItemViewType()) {
          case 1:
              Contact contact = contacts.get(position);
              UserViewHolder userViewHolder = (UserViewHolder) holder;
              userViewHolder.phone.setText(contact.getEmail());
              userViewHolder.email.setText(contact.getPhone());
              break;
          case 2:
              ItemThree itemThree = (ItemThree) holder;
              itemThree.textView.setText("ADs");
              break;
          case 3:
              LoadingViewHolder loadingViewHolder = (LoadingViewHolder) holder;
              loadingViewHolder.progressBar.setIndeterminate(true);
              break;
      }
  }
  
  @Override
  public int getItemCount() {
      return contacts.size()+1;
  }
  </code></pre>