com.roughike.bottombar.BottomBar Java Examples

The following examples show how to use com.roughike.bottombar.BottomBar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From Pigeon with MIT License 6 votes vote down vote up
private void initView() {
    mToolBar= (Toolbar) findViewById(R.id.common_toolbar);
    mBottomBar= (BottomBar) findViewById(R.id.bottomBar );
    mVpContent = (ViewPager) findViewById(R.id.vp_main_content);
    mBottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_home:
                    mToolBar.setTitle("飞鸽");
                    mVpContent.setCurrentItem(0);
                    break;
                case R.id.tab_tools:
                    mToolBar.setTitle("发现");
                    mVpContent.setCurrentItem(1);
                    break;
                case R.id.tab_person:
                    mToolBar.setTitle("我");
                    mVpContent.setCurrentItem(2);
                    break;

            }
        }
    });
}
 
Example #2
Source File: ThreeTabsQRActivity.java    From BottomBar with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three_tabs_quick_return);

    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);

    // We're doing nothing with this listener here this time. Check example usage
    // from ThreeTabsActivity on how to use it.
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {

        }
    });
}
 
Example #3
Source File: MainActivity.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AppLog.d("trace===MainActivity onCreate");
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    mBottomBar = BottomBar.attach(this, savedInstanceState);

    initViews();

    AppLog.d("trace===MainActivity onCreate, end");
}