• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OnTabSelectListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.roughike.bottombar.OnTabSelectListener的典型用法代码示例。如果您正苦于以下问题:Java OnTabSelectListener类的具体用法?Java OnTabSelectListener怎么用?Java OnTabSelectListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OnTabSelectListener类属于com.roughike.bottombar包,在下文中一共展示了OnTabSelectListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    View decorView = getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    decorView.setSystemUiVisibility(uiOptions);
    ActionBar actionBar = getActionBar();
    if (null != actionBar) actionBar.hide();
    mBottomBar.setOnTabSelectListener(
            new OnTabSelectListener() {
                @Override
                public void onTabSelected(@IdRes int tabId) {
                    Fragment fragment;
                    switch (tabId) {
                        case R.id.bot_bar_today:
                            fragment = new TodayTasksFragment();
                            break;
                        case R.id.bot_bar_list:
                            fragment = new ListTasksFragment();
                            break;
                        case R.id.bot_bar_more:
                            fragment = new MoreInfoFragment();
                            break;
                        default:
                            fragment = new TodayTasksFragment();
                    }
                    FragmentManager fragmentManager = getSupportFragmentManager();
                    FragmentTransaction ft = fragmentManager.beginTransaction();
                    ft.replace(R.id.flContent, fragment, fragment.getClass().getName());
                    ft.commit();
                }
            });
}
 
开发者ID:vixir,项目名称:Perfect-Day,代码行数:36,代码来源:MainActivity.java


示例2: initView

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
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;

            }
        }
    });
}
 
开发者ID:monsterLin,项目名称:Pigeon,代码行数:26,代码来源:MainActivity.java


示例3: onCreate

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.app_main_act);

    ButterKnife.bind(this);

    // 初始化页面ViewPaper
    mViewPaperAdapter = new NavViewPaperAdapter(getSupportFragmentManager());
    mNavContent.setAdapter(mViewPaperAdapter);
    mNavContent.setOffscreenPageLimit(4);

    // 获取当前Fragment
    mCurFragment = (BaseFragment) mViewPaperAdapter.getItem(mNavContent.getCurrentItem());

    mBottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            int position = mBottomBar.findPositionForTabWithId(tabId);
            updateCurNav(position);
        }
    });
}
 
开发者ID:hcw2175,项目名称:GankEssence,代码行数:24,代码来源:MainActivity.java


示例4: onCreate

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@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) {

        }
    });
}
 
开发者ID:roughike,项目名称:BottomBar,代码行数:17,代码来源:ThreeTabsQRActivity.java


示例5: initListener

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
public void initListener() {
    bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab1:
                    replaceFragment(new MusicFragment());
                    break;
                case R.id.tab2:
                    replaceFragment(new VideoHomeFragment());
                    break;
                case R.id.tab3:
                    replaceFragment(new HomeFragment());
                    break;
                case R.id.tab4:
                    replaceFragment(new MeFragment());

            }
        }
    });

    mFabMusic.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            LogUtils.d("MainActivity", "mFabMusic to startActivity");
            startActivity(new Intent(MainActivty.this, PlayMusicActivity.class));
        }
    });
    mFabMusic.setVisibility(View.GONE);

}
 
开发者ID:popo1379,项目名称:popomusic,代码行数:34,代码来源:MainActivty.java


示例6: initializeBottomBar

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
/**
 * set up the navigation tabs at the bottom of the screen
 * navigation items:
 *      dashboard
 *      search
 *      add new habit
 *      follow requests
 *      profile
 */
private void initializeBottomBar() {
    bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_dashboard:
                    onDashboardClicked();
                    break;
                case R.id.tab_search:
                    onSearchClicked();
                    break;
                case R.id.tab_addHabit:
                    break;
                case R.id.tab_followRequests:
                    onFollowRequestClicked();
                    break;
                case R.id.tab_profile:
                    onProfileClicked();
                    break;
            }
        }
    });

    bottomBar.setTabSelectionInterceptor(new TabSelectionInterceptor() {
        @Override
        public boolean shouldInterceptTabSelection(@IdRes int oldTabId, @IdRes int newTabId) {
            if (newTabId == R.id.tab_addHabit) {
                onAddHabitClicked();
                return true;
            }
            return false;
        }
    });
}
 
开发者ID:CMPUT301F17T15,项目名称:CIA,代码行数:45,代码来源:HomeTabbedActivity.java


示例7: onCreate

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);

    bottomNavigationView.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(int tabId) {
            handleBottomNavClicked(tabId);
        }
    });
}
 
开发者ID:bapspatil,项目名称:Pantheon,代码行数:14,代码来源:MainActivity.java


示例8: setListeners

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
public void setListeners() {
    this.bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
            fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);

            switch (tabId) {
                case R.id.tab_search:
                    fragmentTransaction
                            .replace(R.id.content_container, searchFragment, SearchFragment.class.toString())
                            .commitNow();
                    break;
                case R.id.tab_fav:
                    fragmentTransaction
                            .replace(R.id.content_container, favFragment, FavFragment.class.toString())
                            .commitNow();
                    break;
                case R.id.tab_history:
                    fragmentTransaction
                            .replace(R.id.content_container, historyFragment, HistoryFragment.class.toString())
                            .commitNow();
                    break;
            }
        }
    });
}
 
开发者ID:freespanish,项目名称:Diccionario,代码行数:29,代码来源:MainActivity.java


示例9: bind

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
protected void bind() {
    mFab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mCalendar == null){
                mCalendar = new CalendarDialog(MainActivity.this, new CalendarDialog.DatePickerListener() {
                    @Override
                    public void onDateSet(int year, int month, int day) {
                        if (dailyFragment != null){
                            dailyFragment.getGankByDate(year,month,day);
                        }
                    }
                });
            }
                mCalendar.show();
        }
    });
    mBottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_movie:
                    mToolbar.setTitle(titles[0]);
                    showFragment(movieFragment, 0);
                    mFab.hide();
                    break;
                case R.id.tab_developer:
                    mToolbar.setTitle(titles[1]);
                    showFragment(dailyFragment, 1);
                    mFab.show();
                    break;
                case R.id.tab_girl:
                    mToolbar.setTitle(titles[2]);
                    showFragment(meiziFragment, 2);
                    mFab.hide();
                    break;
                case R.id.tab_dribbble:
                    mToolbar.setTitle(titles[3]);
                    showFragment(shotsFragment, 3);
                    mFab.hide();
                    break;
                default:
                    break;
            }
        }
    });
    mBottomBar.selectTabAtPosition(0);
}
 
开发者ID:HStanN,项目名称:TakeRest,代码行数:50,代码来源:MainActivity.java


示例10: onCreate

import com.roughike.bottombar.OnTabSelectListener; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fresco.initialize(this);
    setContentView(R.layout.activity_main);
    LibF = new LibraryFragment();
    PopF = new PopularFragment();
    BroF = new BrowseFragment();
    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int menuItemId) {
            // The user selected a tab at the specified position
            FragmentTransaction FragTrans = FragMan.beginTransaction();
            if (menuItemId == R.id.menu_library) {

                FragTrans.replace(R.id.MainLayout, LibF);
            } else if (menuItemId == R.id.menu_popular) {

                FragTrans.replace(R.id.MainLayout, PopF);
            } else if (menuItemId == R.id.menu_browse) {

                FragTrans.replace(R.id.MainLayout, BroF);
            }
            FragTrans.commit();
        }

    });
    RequestQueue queue = MySingleton.getInstance(this.getApplicationContext()).
            getRequestQueue();
    popularMangaList = new ArrayList<>();
    newMangaList = new ArrayList<>();

    //TODO : Caching Popular mangalist
    //TODO : Implementing ThreadPool for concurrent mangalist fetch
    Intent mangaFetch = new Intent(this,MangaFetchService.class);
    mangaFetch.putExtra("mangaURL",mangaFox);
    mangaFetch.putExtra("receiver",new PopularProgress(new Handler()));
    this.startService(mangaFetch);

}
 
开发者ID:FR0ST1N,项目名称:Mataku,代码行数:42,代码来源:MainActivity.java



注:本文中的com.roughike.bottombar.OnTabSelectListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntityType类代码示例发布时间:2022-05-21
下一篇:
Java TemplateLoader类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap