// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/SongMenuAdapter.java
// public class SongMenuAdapter extends BaseRecyclerViewAdapter {
//     public SongMenuAdapter(Context context) {
//     }
// 
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         return null;
//     }
// 
//     @Override
//     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
// 
//     }
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/base/BaseFragment.java
// public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
//     protected VDB mDataBinding;
// 
//     @LayoutRes
//     protected abstract int getLayoutId();
// 
//     @Override
//     public void onActivityCreated(@Nullable Bundle savedInstanceState) {
//         super.onActivityCreated(savedInstanceState);
//         loadData();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(getLayoutId(), null);
//         mDataBinding = DataBindingUtil.bind(view);
//         onCreateVew(inflater, savedInstanceState);
//         return view;
//     }
// 
//     protected void onCreateVew(LayoutInflater inflater, Bundle savedInstanceState) {
// 
//     }
// 
//     protected abstract void loadData();
// }


import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import com.ximsfei.skindemo.R;
import com.ximsfei.skindemo.databinding.FragmentSongBinding;
import com.ximsfei.skindemo.databinding.HeaderSongItemBinding;
import com.ximsfei.skindemo.ui.adapter.SongMenuAdapter;
import com.ximsfei.skindemo.ui.base.BaseFragment;
package com.ximsfei.skindemo.ui.discover;



/**
 * Created by ximsfei on 17-1-8.
 */

public class SongMenuFragment extends BaseFragment<FragmentSongBinding> {
    private HeaderSongItemBinding mHeaderBinding;
    private SongMenuAdapter mAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_song;
    }

    @Override
    protected void onCreateVew(LayoutInflater inflater, Bundle savedInstanceState) {
        super.onCreateVew(inflater, savedInstanceState);
        mHeaderBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.header_song_item, null, false);
        initRecyclerView();
    }

    private void initRecyclerView() {
        mDataBinding.recyclerView.setPullRefreshEnabled(false);
        mDataBinding.recyclerView.setLoadingMoreEnabled(true);
        mDataBinding.recyclerView.addHeaderView(mHeaderBinding.getRoot());
        mDataBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mDataBinding.recyclerView.setNestedScrollingEnabled(false);
        mDataBinding.recyclerView.setHasFixedSize(false);
        mDataBinding.recyclerView.setItemAnimator(new DefaultItemAnimator());
// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/SongMenuAdapter.java
// public class SongMenuAdapter extends BaseRecyclerViewAdapter {
//     public SongMenuAdapter(Context context) {
//     }
// 
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         return null;
//     }
// 
//     @Override
//     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
// 
//     }
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/base/BaseFragment.java
// public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
//     protected VDB mDataBinding;
// 
//     @LayoutRes
//     protected abstract int getLayoutId();
// 
//     @Override
//     public void onActivityCreated(@Nullable Bundle savedInstanceState) {
//         super.onActivityCreated(savedInstanceState);
//         loadData();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(getLayoutId(), null);
//         mDataBinding = DataBindingUtil.bind(view);
//         onCreateVew(inflater, savedInstanceState);
//         return view;
//     }
// 
//     protected void onCreateVew(LayoutInflater inflater, Bundle savedInstanceState) {
// 
//     }
// 
//     protected abstract void loadData();
// }


// Path: app/src/main/java/com/ximsfei/skindemo/ui/discover/SongMenuFragment.java
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import com.ximsfei.skindemo.R;
import com.ximsfei.skindemo.databinding.FragmentSongBinding;
import com.ximsfei.skindemo.databinding.HeaderSongItemBinding;
import com.ximsfei.skindemo.ui.adapter.SongMenuAdapter;
import com.ximsfei.skindemo.ui.base.BaseFragment;

package com.ximsfei.skindemo.ui.discover;



/**
 * Created by ximsfei on 17-1-8.
 */

public class SongMenuFragment extends BaseFragment<FragmentSongBinding> {
    private HeaderSongItemBinding mHeaderBinding;
    private SongMenuAdapter mAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_song;
    }

    @Override
    protected void onCreateVew(LayoutInflater inflater, Bundle savedInstanceState) {
        super.onCreateVew(inflater, savedInstanceState);
        mHeaderBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.header_song_item, null, false);
        initRecyclerView();
    }

    private void initRecyclerView() {
        mDataBinding.recyclerView.setPullRefreshEnabled(false);
        mDataBinding.recyclerView.setLoadingMoreEnabled(true);
        mDataBinding.recyclerView.addHeaderView(mHeaderBinding.getRoot());
        mDataBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mDataBinding.recyclerView.setNestedScrollingEnabled(false);
        mDataBinding.recyclerView.setHasFixedSize(false);
        mDataBinding.recyclerView.setItemAnimator(new DefaultItemAnimator());
        mAdapter = new SongMenuAdapter(getActivity());