package com.sheep.gamegroup.view.activity;

import android.app.Activity;
import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadTask;
import com.kfzs.duanduan.fragment.FgtFindChild;
import com.kfzs.duanduan.mine.GiftpackListAdapter;
import com.kfzs.duanduan.services.DownloadTaskService;
import com.sheep.gamegroup.absBase.BaseActivity;
import com.sheep.gamegroup.model.entity.BaseMessage;
import com.sheep.gamegroup.model.entity.FindApp;
import com.sheep.gamegroup.model.entity.Welfare;
import com.sheep.gamegroup.model.util.SheepSubscriber;
import com.sheep.gamegroup.util.CommonUtil;
import com.sheep.gamegroup.util.ListUtil;
import com.sheep.gamegroup.util.SysAppUtil;
import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
import com.sheep.gamegroup.view.fragment.FgtDownloadWelfare;
import com.sheep.gamegroup.view.fragment.FgtMyGift;
import com.sheep.gamegroup.view.fragment.FgtWelfareUseRecord;
import com.sheep.jiuyan.samllsheep.R;
import com.sheep.jiuyan.samllsheep.SheepApp;
import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;

import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import butterknife.BindView;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

import static android.content.Intent.ACTION_PACKAGE_ADDED;
import static android.content.Intent.ACTION_PACKAGE_REMOVED;
import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_TAG;

/**
 * Created by realicing on 2018/8/28.
 * realicing@sina.com
 */
public class ActMyWelfare extends BaseActivity {
    @BindView(R.id.indicator)
    TabLayout indicator;
    @BindView(R.id.pager)
    ViewPager pager;
    @Override
    protected int getLayoutId() {
        return R.layout.common_tab_vp;
    }


    @Override
    public void initView() {
        activity = this;
        TitleBarUtils.getInstance()
                .setTitle(this, "我的福利")
                .setTitleFinish(this);

    }

    private Activity activity;


    private GiftpackListAdapter mAdapter;
    @Override
    public void initListener() {
        mAdapter = new GiftpackListAdapter(getSupportFragmentManager(), SheepApp.getInstance());
        mAdapter.add(new FgtDownloadWelfare(), "下载福利");
        mAdapter.add(new FgtMyGift(), "我的礼包");
        mAdapter.add(new FgtWelfareUseRecord(), "使用记录");
        pager.setAdapter(mAdapter);
        indicator.setupWithViewPager(pager);
        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int i, float v, int i1) {

            }

            @Override
            public void onPageSelected(int i) {
            }

            @Override
            public void onPageScrollStateChanged(int i) {

            }
        });
        CommonUtil.getInstance().reflex(indicator, activity);
    }


    @Override
    public void initData() {
    }

}
