// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/Insertable.java
// public interface Insertable<T> {
// 
//     /**
//      * Will be called to insert given {@code item} at given {@code index} in the list.
//      *
//      * @param index the index the new item should be inserted at
//      * @param item  the item to insert
//      */
//     void add(int index, @NonNull T item);
// }
// 
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/ListViewWrapper.java
// public interface ListViewWrapper {
// 
//     @NonNull
//     ViewGroup getListView();
// 
//     @Nullable
//     View getChildAt(int index);
// 
//     int getFirstVisiblePosition();
// 
//     int getLastVisiblePosition();
// 
//     int getCount();
// 
//     int getChildCount();
// 
//     int getHeaderViewsCount();
// 
//     int getPositionForView(@NonNull View view);
// 
//     @Nullable
//     ListAdapter getAdapter();
// 
//     void smoothScrollBy(int distance, int duration);
// }
// 
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/ListViewWrapperSetter.java
// public interface ListViewWrapperSetter {
// 
//     void setListViewWrapper(@NonNull final ListViewWrapper listViewWrapper);
// }


import android.database.DataSetObserver;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.SectionIndexer;
import com.nhaarman.listviewanimations.util.AbsListViewWrapper;
import com.nhaarman.listviewanimations.util.Insertable;
import com.nhaarman.listviewanimations.util.ListViewWrapper;
import com.nhaarman.listviewanimations.util.ListViewWrapperSetter;
import com.nhaarman.listviewanimations.util.Swappable;
/*
 * Copyright 2014 Niek Haarman
 *
 * 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.nhaarman.listviewanimations;



/**
 * A decorator class that enables decoration of an instance of the {@link BaseAdapter} class.
 * <p/>
 * Classes extending this class can override methods and provide extra functionality before or after calling the super method.
 */
public abstract class BaseAdapterDecorator extends BaseAdapter implements SectionIndexer, Swappable, Insertable, ListViewWrapperSetter {

    /**
     * The {@link android.widget.BaseAdapter} this {@code BaseAdapterDecorator} decorates.
     */
    @NonNull
    private final BaseAdapter mDecoratedBaseAdapter;

    /**
     * The {@link com.nhaarman.listviewanimations.util.ListViewWrapper} containing the ListView this {@code BaseAdapterDecorator} will be bound to.
     */
    @Nullable
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/Insertable.java
// public interface Insertable<T> {
// 
//     /**
//      * Will be called to insert given {@code item} at given {@code index} in the list.
//      *
//      * @param index the index the new item should be inserted at
//      * @param item  the item to insert
//      */
//     void add(int index, @NonNull T item);
// }
// 
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/ListViewWrapper.java
// public interface ListViewWrapper {
// 
//     @NonNull
//     ViewGroup getListView();
// 
//     @Nullable
//     View getChildAt(int index);
// 
//     int getFirstVisiblePosition();
// 
//     int getLastVisiblePosition();
// 
//     int getCount();
// 
//     int getChildCount();
// 
//     int getHeaderViewsCount();
// 
//     int getPositionForView(@NonNull View view);
// 
//     @Nullable
//     ListAdapter getAdapter();
// 
//     void smoothScrollBy(int distance, int duration);
// }
// 
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/ListViewWrapperSetter.java
// public interface ListViewWrapperSetter {
// 
//     void setListViewWrapper(@NonNull final ListViewWrapper listViewWrapper);
// }


// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/BaseAdapterDecorator.java
import android.database.DataSetObserver;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.SectionIndexer;
import com.nhaarman.listviewanimations.util.AbsListViewWrapper;
import com.nhaarman.listviewanimations.util.Insertable;
import com.nhaarman.listviewanimations.util.ListViewWrapper;
import com.nhaarman.listviewanimations.util.ListViewWrapperSetter;
import com.nhaarman.listviewanimations.util.Swappable;

/*
 * Copyright 2014 Niek Haarman
 *
 * 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.nhaarman.listviewanimations;



/**
 * A decorator class that enables decoration of an instance of the {@link BaseAdapter} class.
 * <p/>
 * Classes extending this class can override methods and provide extra functionality before or after calling the super method.
 */
public abstract class BaseAdapterDecorator extends BaseAdapter implements SectionIndexer, Swappable, Insertable, ListViewWrapperSetter {

    /**
     * The {@link android.widget.BaseAdapter} this {@code BaseAdapterDecorator} decorates.
     */
    @NonNull
    private final BaseAdapter mDecoratedBaseAdapter;

    /**
     * The {@link com.nhaarman.listviewanimations.util.ListViewWrapper} containing the ListView this {@code BaseAdapterDecorator} will be bound to.
     */
    @Nullable
    private ListViewWrapper mListViewWrapper;