package com.sheep.gamegroup.view.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.sheep.gamegroup.view.fragment.MessageCenterFragment;
import com.sheep.gamegroup.view.fragment.MessageReplyFragment;

/**
 * created on：2018/8/29 on 9:47
 * created by: YSL
 * 描述: 消息模块的FragmentAdapter，
 */
public class MessageAdapter extends FragmentPagerAdapter {
    private Context context;

    public MessageAdapter(FragmentManager fm, Context context) {
        super(fm);
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return new MessageCenterFragment(context);
        } else {
            return new MessageReplyFragment(context);
        }
    }

    @Override
    public int getCount() {
        return 2;
    }
}
