//package com.sheep.gamegroup.view.fragment;
//
//import android.os.Bundle;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//
//import com.sheep.gamegroup.event.BigEvent;
//import com.sheep.gamegroup.model.api.ApiService;
//import com.sheep.gamegroup.model.entity.BaseMessage;
//import com.sheep.gamegroup.model.entity.GameEntity;
//import com.sheep.gamegroup.model.entity.GameEntityList;
//import com.sheep.gamegroup.util.CommonUtil;
//import com.sheep.gamegroup.util.ListUtil;
//import com.sheep.gamegroup.view.adapter.PlayGameListAdapter;
//import com.sheep.jiuyan.samllsheep.R;
//
//import org.greenrobot.eventbus.Subscribe;
//
//import java.util.List;
//import java.util.Locale;
//
//import io.reactivex.Observable;
//
///**
// * Created by ljy on 2018/9/3.
// */
//
//public class FgtPlayGameSon extends BaseListFragment3<GameEntity> {
//    private int type;
//
//    //第一次就展示在viewpager中的页面
//    public boolean firstPage = false;
//
//    public void setFirstPage(boolean firstPage) {
//        this.firstPage = firstPage;
//    }
//    @Override
//    protected void initDataOnVisibleToUser() {
//        if(activity == null)
//            onViewCreated();
//        if(!firstPage && firstVisibleToUser) {
//            refreshData();
//        }
//    }
//
//    @Override
//    public int refreshDataType() {
//        if(firstPage){
//            return REFRESH_ON_CREATE;
//        }
//        return REFRESH_ON_YOURSELF;
//    }
//
//    public static FgtPlayGameSon newInstance(int type){
//        FgtPlayGameSon fgt = new FgtPlayGameSon();
//        Bundle bundle = new Bundle();
//        bundle.putInt("type", type);
//        fgt.setArguments(bundle);
//        return fgt;
//    }
//
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//        View rootView = super.onCreateView(inflater, container, savedInstanceState);
//        Bundle bundle = getArguments();
//        if(bundle != null){
//            type = bundle.getInt("type", 1002);
//        }
//        return rootView;
//    }
//
//    private GameEntityList gameEntityList = new GameEntityList(list);
//    private List<GameEntityList> gameEntityListList = ListUtil.emptyList();
//    @Override
//    protected RecyclerView.Adapter getAdapter() {
//        if(gameEntityListList.isEmpty())
//            gameEntityListList.add(gameEntityList);
//        return new PlayGameListAdapter(activity, gameEntityListList);
//    }
//
//    @Override
//    protected String getKey(int page, int per_page) {
//        return String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&is_hot=%d&daily_play=%d&type=%d", page, per_page, 0, 0, type);
//    }
//
//    @Override
//    protected Observable<BaseMessage> getApi(ApiService apiService) {
//        return apiService.getPlayGameList(page, per_page, 0, 0, type);
//    }
//
//    @Override
//    protected Class<GameEntity> getTClass() {
//        return GameEntity.class;
//    }
//
//    @Subscribe
//    public void onEventMainThread(BigEvent event){
//        CommonUtil.getInstance().setEventResultViewStatus(event, view_list);
//    }
//
//    @Override
//    protected boolean isFirstGetACache() {
//        return false;
//    }
//
//    @Override
//    protected int getItemHeight() {
//        return getResources().getDimensionPixelSize(R.dimen.content_padding_96);
//    }
//}
