package com.sheep.gamegroup.view.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;

import com.sheep.gamegroup.absBase.BaseActivity;
import com.sheep.gamegroup.view.fragment.FgtDownloadWelfareList;
import com.sheep.jiuyan.samllsheep.R;
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;

/**
 * 福利中心--点击全部福利  进入  下载福利列表
 * Created by realicing on 2018/8/28.
 * realicing@sina.com
 */
public class ActDownloadWelfareList extends BaseActivity {
    @Override
    protected int getLayoutId() {
        return R.layout.common_container_act;
    }


    @Override
    public void initView() {
        TitleBarUtils.getInstance()
                .setTitle(this, "下载福利列表")
                .setTitleFinish(this);

        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        Bundle bundle = new Bundle();
        Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
        if(fragment == null){
            fragment = new FgtDownloadWelfareList();
            fragment.setArguments(bundle);
            transaction.add(R.id.frame_container, fragment, "tag");
            transaction.commitAllowingStateLoss();
        }else {
            fragment.setArguments(bundle);
            transaction.replace(R.id.frame_container, fragment);
            transaction.commitAllowingStateLoss();
        }

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

}
