Search in sources :

Example 1 with RecommendFragment

use of com.justwayward.reader.ui.fragment.RecommendFragment in project BookReader by JustWayward.

the class MainActivity method initDatas.

@Override
public void initDatas() {
    startService(new Intent(this, DownloadBookService.class));
    mTencent = Tencent.createInstance("1105670298", MainActivity.this);
    mDatas = Arrays.asList(getResources().getStringArray(R.array.home_tabs));
    mTabContents = new ArrayList<>();
    mTabContents.add(new RecommendFragment());
    mTabContents.add(new CommunityFragment());
    mTabContents.add(new FindFragment());
    mAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) {

        @Override
        public int getCount() {
            return mTabContents.size();
        }

        @Override
        public Fragment getItem(int position) {
            return mTabContents.get(position);
        }
    };
}
Also used : DownloadBookService(com.justwayward.reader.service.DownloadBookService) RecommendFragment(com.justwayward.reader.ui.fragment.RecommendFragment) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) CommunityFragment(com.justwayward.reader.ui.fragment.CommunityFragment) Intent(android.content.Intent) FindFragment(com.justwayward.reader.ui.fragment.FindFragment) Fragment(android.support.v4.app.Fragment) CommunityFragment(com.justwayward.reader.ui.fragment.CommunityFragment) RecommendFragment(com.justwayward.reader.ui.fragment.RecommendFragment) FindFragment(com.justwayward.reader.ui.fragment.FindFragment)

Aggregations

Intent (android.content.Intent)1 Fragment (android.support.v4.app.Fragment)1 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)1 DownloadBookService (com.justwayward.reader.service.DownloadBookService)1 CommunityFragment (com.justwayward.reader.ui.fragment.CommunityFragment)1 FindFragment (com.justwayward.reader.ui.fragment.FindFragment)1 RecommendFragment (com.justwayward.reader.ui.fragment.RecommendFragment)1