package com.yutou.jianr_mg.Fragments;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yutou.jianr_mg.Data.MAppMg;
import com.yutou.jianr_mg.Tools.Log;

/**
 * Created by 58381 on 2018/1/25.
 */

public class ModListFragment_1 extends Fragment {
    private static ModListFragment_1 mod;
    private ModListFragmentData modData;
    private int index=1;
    public ModListFragment_1(){
        this.modData=new ModListFragmentData();
    }
    public static ModListFragment_1 init(MAppMg mgList){
        if(mod==null){
            mod=new ModListFragment_1();

        }
        if(mgList!=null)
            Log.i("mod",mgList.getName());
        mod.setMgList(mgList);
        mod.setIndex(mod.index);
        return mod;
    }
    private void setIndex(int index){
        modData.setIndex(index);
    }
    private void setMgList(MAppMg mgList){
        modData.setMgList(mgList);
    }
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return modData.onCreateView(getContext(),getActivity(),inflater);
    }

}
