// Path: app/src/main/java/com/zsorg/neteasecloudmusic/adapters/MusicPagerAdapter.java
// public class MusicPagerAdapter extends FragmentPagerAdapter {
//     private final ArrayList<SubMusicFragment> mList;
//     @BindArray(R.array.music)
//     String[] mTabName;
//     private int[] mFragmentType = {CONST.TYPE_SINGLE, CONST.TYPE_SINGER, CONST.TYPE_ALBUM, CONST.TYPE_FOLDER};
// 
//     public MusicPagerAdapter(View view, FragmentManager fm) {
//         super(fm);
//         ButterKnife.bind(this, view);
// 
//         mList = new ArrayList<>();
//         for (int position=0;position<mFragmentType.length;position++) {
//             mList.add(SubMusicFragment.newInstance(mFragmentType[position]));
//         }
// 
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mTabName.length;
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mTabName[position];
//     }
// }


import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.zsorg.neteasecloudmusic.R;
import com.zsorg.neteasecloudmusic.adapters.MusicPagerAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
     */
    public static MusicFragment newInstance() {
        return new MusicFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        Fragment fragment = null;
        if (null!=mAdapter) {
            fragment = mAdapter.getItem(mCurrentPosition);
        }
        if (null!=fragment) {
            fragment.onResume();
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_music, container, false);
        ButterKnife.bind(this, view);

        Log.e("tag", "onCreateView");
// Path: app/src/main/java/com/zsorg/neteasecloudmusic/adapters/MusicPagerAdapter.java
// public class MusicPagerAdapter extends FragmentPagerAdapter {
//     private final ArrayList<SubMusicFragment> mList;
//     @BindArray(R.array.music)
//     String[] mTabName;
//     private int[] mFragmentType = {CONST.TYPE_SINGLE, CONST.TYPE_SINGER, CONST.TYPE_ALBUM, CONST.TYPE_FOLDER};
// 
//     public MusicPagerAdapter(View view, FragmentManager fm) {
//         super(fm);
//         ButterKnife.bind(this, view);
// 
//         mList = new ArrayList<>();
//         for (int position=0;position<mFragmentType.length;position++) {
//             mList.add(SubMusicFragment.newInstance(mFragmentType[position]));
//         }
// 
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mTabName.length;
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mTabName[position];
//     }
// }


// Path: app/src/main/java/com/zsorg/neteasecloudmusic/fragments/MusicFragment.java
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.zsorg.neteasecloudmusic.R;
import com.zsorg.neteasecloudmusic.adapters.MusicPagerAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;

     */
    public static MusicFragment newInstance() {
        return new MusicFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        Fragment fragment = null;
        if (null!=mAdapter) {
            fragment = mAdapter.getItem(mCurrentPosition);
        }
        if (null!=fragment) {
            fragment.onResume();
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_music, container, false);
        ButterKnife.bind(this, view);

        Log.e("tag", "onCreateView");
        mAdapter = new MusicPagerAdapter(view, getChildFragmentManager());