// Path: app/src/main/java/com/andremion/heroes/api/data/SectionVO.java
// public class SectionVO implements Serializable {
// 
//     public static final int TYPE_COMIC = 0;
//     public static final int TYPE_SERIES = 1;
//     public static final int TYPE_STORY = 2;
//     public static final int TYPE_EVENT = 3;
// 
//     @IntDef({TYPE_COMIC, TYPE_SERIES, TYPE_STORY, TYPE_EVENT})
//     @Retention(RetentionPolicy.SOURCE)
//     public @interface Type {
//     }
// 
//     private long mId;
//     private String mTitle;
//     private String mThumbnail;
//     private String mImage;
// 
//     public SectionVO() {
//     }
// 
//     public long getId() {
//         return mId;
//     }
// 
//     public void setId(long id) {
//         mId = id;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public void setTitle(String title) {
//         mTitle = title;
//     }
// 
//     public String getThumbnail() {
//         return mThumbnail;
//     }
// 
//     public void setThumbnail(String thumbnail) {
//         mThumbnail = thumbnail;
//     }
// 
//     public String getImage() {
//         return mImage;
//     }
// 
//     public void setImage(String image) {
//         mImage = image;
//     }
// 
//     @Override
//     public String toString() {
//         return "Section{" + mId + ", '" + mTitle + "'}";
//     }
// }
// 
// Path: app/src/main/java/com/andremion/heroes/ui/adapter/ArrayAdapter.java
// public abstract class ArrayAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {
// 
//     private final OnItemClickListener mItemClickListener;
//     private final List<T> mItems;
// 
//     public ArrayAdapter(@Nullable OnItemClickListener itemClickListener) {
//         super();
//         mItemClickListener = itemClickListener;
//         mItems = new ArrayList<>();
//         setHasStableIds(true);
//     }
// 
//     @Override
//     public abstract long getItemId(int position);
// 
//     @Override
//     public int getItemCount() {
//         return mItems.size();
//     }
// 
//     public T getItem(int position) {
//         if (mItems == null) {
//             return null;
//         }
//         return mItems.get(position);
//     }
// 
//     public void setItems(List<T> items) {
//         mItems.clear();
//         mItems.addAll(items);
//         notifyDataSetChanged();
//     }
// 
//     public List<T> getItems() {
//         return new ArrayList<>(mItems);
//     }
// 
//     public interface OnItemClickListener<T, VH extends RecyclerView.ViewHolder, VB extends ViewDataBinding> {
//         void onItemClick(ArrayAdapter<T, VH> adapter, VB binding, int position);
//     }
// 
//     public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         public final ViewDataBinding mBinding;
// 
//         public ViewHolder(ViewDataBinding binding) {
//             super(binding.getRoot());
//             mBinding = binding;
//             mBinding.getRoot().setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View v) {
//             int position = getAdapterPosition();
//             if (position != RecyclerView.NO_POSITION && mItemClickListener != null) {
//                 //noinspection unchecked
//                 mItemClickListener.onItemClick(ArrayAdapter.this, mBinding, position);
//             }
//         }
//     }
// 
// }


import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.andremion.heroes.BR;
import com.andremion.heroes.R;
import com.andremion.heroes.api.data.SectionVO;
import com.andremion.heroes.ui.adapter.ArrayAdapter;
/*
 * Copyright (c) 2017. André Mion
 *
 * 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.andremion.heroes.ui.character.view;



public class SectionAdapter extends ArrayAdapter<SectionVO, SectionAdapter.ViewHolder> {

    private final String mImageTransitionName;
    private final int mType;

    public SectionAdapter(Context context, @SectionVO.Type int type, OnItemClickListener listener) {
        super(listener);
        mImageTransitionName = context.getString(R.string.transition_section_image);
        mType = type;
    }

// Path: app/src/main/java/com/andremion/heroes/api/data/SectionVO.java
// public class SectionVO implements Serializable {
// 
//     public static final int TYPE_COMIC = 0;
//     public static final int TYPE_SERIES = 1;
//     public static final int TYPE_STORY = 2;
//     public static final int TYPE_EVENT = 3;
// 
//     @IntDef({TYPE_COMIC, TYPE_SERIES, TYPE_STORY, TYPE_EVENT})
//     @Retention(RetentionPolicy.SOURCE)
//     public @interface Type {
//     }
// 
//     private long mId;
//     private String mTitle;
//     private String mThumbnail;
//     private String mImage;
// 
//     public SectionVO() {
//     }
// 
//     public long getId() {
//         return mId;
//     }
// 
//     public void setId(long id) {
//         mId = id;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public void setTitle(String title) {
//         mTitle = title;
//     }
// 
//     public String getThumbnail() {
//         return mThumbnail;
//     }
// 
//     public void setThumbnail(String thumbnail) {
//         mThumbnail = thumbnail;
//     }
// 
//     public String getImage() {
//         return mImage;
//     }
// 
//     public void setImage(String image) {
//         mImage = image;
//     }
// 
//     @Override
//     public String toString() {
//         return "Section{" + mId + ", '" + mTitle + "'}";
//     }
// }
// 
// Path: app/src/main/java/com/andremion/heroes/ui/adapter/ArrayAdapter.java
// public abstract class ArrayAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {
// 
//     private final OnItemClickListener mItemClickListener;
//     private final List<T> mItems;
// 
//     public ArrayAdapter(@Nullable OnItemClickListener itemClickListener) {
//         super();
//         mItemClickListener = itemClickListener;
//         mItems = new ArrayList<>();
//         setHasStableIds(true);
//     }
// 
//     @Override
//     public abstract long getItemId(int position);
// 
//     @Override
//     public int getItemCount() {
//         return mItems.size();
//     }
// 
//     public T getItem(int position) {
//         if (mItems == null) {
//             return null;
//         }
//         return mItems.get(position);
//     }
// 
//     public void setItems(List<T> items) {
//         mItems.clear();
//         mItems.addAll(items);
//         notifyDataSetChanged();
//     }
// 
//     public List<T> getItems() {
//         return new ArrayList<>(mItems);
//     }
// 
//     public interface OnItemClickListener<T, VH extends RecyclerView.ViewHolder, VB extends ViewDataBinding> {
//         void onItemClick(ArrayAdapter<T, VH> adapter, VB binding, int position);
//     }
// 
//     public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         public final ViewDataBinding mBinding;
// 
//         public ViewHolder(ViewDataBinding binding) {
//             super(binding.getRoot());
//             mBinding = binding;
//             mBinding.getRoot().setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View v) {
//             int position = getAdapterPosition();
//             if (position != RecyclerView.NO_POSITION && mItemClickListener != null) {
//                 //noinspection unchecked
//                 mItemClickListener.onItemClick(ArrayAdapter.this, mBinding, position);
//             }
//         }
//     }
// 
// }


// Path: app/src/main/java/com/andremion/heroes/ui/character/view/SectionAdapter.java
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.andremion.heroes.BR;
import com.andremion.heroes.R;
import com.andremion.heroes.api.data.SectionVO;
import com.andremion.heroes.ui.adapter.ArrayAdapter;

/*
 * Copyright (c) 2017. André Mion
 *
 * 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.andremion.heroes.ui.character.view;



public class SectionAdapter extends ArrayAdapter<SectionVO, SectionAdapter.ViewHolder> {

    private final String mImageTransitionName;
    private final int mType;

    public SectionAdapter(Context context, @SectionVO.Type int type, OnItemClickListener listener) {
        super(listener);
        mImageTransitionName = context.getString(R.string.transition_section_image);
        mType = type;
    }

    @SectionVO.Type