/*
 * Copyright 2017 Riyaz Ahamed
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ahamed.multiviewadapter;

import java.util.List;

/**
 * SimpleAdapter is an easy way to set-up adapters which has single view types
 *
 * @param <M> Model class to be displayed
 * @param <B> ItemBinder class
 */
public final class SimpleRecyclerAdapter<M, B extends ItemBinder> extends SelectableAdapter {

  private final DataListManager<M> dataListManager = new DataListManager<>(this);

  public SimpleRecyclerAdapter(B binder) {
    addDataManager(dataListManager);
    registerBinder(binder);
  }

  /**
   * Returns the DataListManager on which list operations can be made. It will call necessary item
   * animations.
   *
   * @return DataListManager
   */
  public final DataListManager<M> getDataManager() {
    return dataListManager;
  }

  /**
   * Sets the data list to the data manager.
   *
   * @param dataList Data list to be set
   */
  public final void setData(List<M> dataList) {
    dataListManager.set(dataList);
  }
}

@@ -1542,11 +1542,706 @@
 st);%0A  %7D
+%0A%0A  /**%0A   * Adds an header to the adapter.%0A   *%0A   * @param itemBinder ItemBinder for the header%0A   * @param header Header to be added%0A   */%0A  public final %3CH, VH extends BaseViewHolder%3CH%3E%3E void addHeader(ItemBinder%3CH, VH%3E itemBinder,%0A      H header) %7B%0A    registerBinder(itemBinder);%0A    addDataManager(0, new DataItemManager%3C%3E(this, header));%0A  %7D%0A%0A  /**%0A   * Adds an footer to the adapter.%0A   *%0A   * @param itemBinder ItemBinder for the footer%0A   * @param footer Footer to be added%0A   */%0A  public final %3CF, VH extends BaseViewHolder%3CF%3E%3E void addFooter(ItemBinder%3CF, VH%3E itemBinder,%0A      F footer) %7B%0A    registerBinder(itemBinder);%0A    addDataManager(new DataItemManager%3C%3E(this, footer));%0A  %7D
 %0A%7D%0A

Add header and footer to SimpleRecyclerAdapter