| | |
| | | import android.support.design.widget.TabLayout; |
| | | import android.support.v4.view.ViewPager; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bsk.zhangbo.demoforbsk.R; |
| | | import com.bsk.zhangbo.demoforbsk.adapter.MyFragmentPagerAdapter; |
| | |
| | | |
| | | public class MainActivity extends BaseActivity { |
| | | |
| | | private static TabLayout mTabLayout; |
| | | private static ViewPager mViewPager; |
| | | |
| | | private TabLayout mTabLayout; |
| | | private ViewPager mViewPager; |
| | | public static void selectPage(int pageNum) { |
| | | mTabLayout.getTabAt(pageNum).select(); |
| | | } |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_main; |
| | |
| | | mTabLayout = (TabLayout) findViewById(R.id.tab_layout); |
| | | mViewPager = (ViewPager) findViewById(R.id.viewpager); |
| | | mTabLayout.setTabGravity(TabLayout.GRAVITY_FILL); |
| | | } |
| | | |
| | | @Override |
| | | public void initToolBar() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initListeners() { |
| | | |
| | | } |
| | | |
| | | @Override |