Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ifmvo/BottomTabView

Open more actions menu

Repository files navigation

BottomTabView

可以直接复制代码

BottomTabView.java

view_tab_item.xml

使用方法

初始化数据

ArrayList<BottomTabView.TabItemView> tabItemViews = new ArrayList<>();
tabItemViews.add(new BottomTabView.TabItemView(this, "标题1", R.color.colorPrimary, R.color.colorAccent, R.mipmap.ic_launcher, R.mipmap.ic_launcher_round));
tabItemViews.add(new BottomTabView.TabItemView(this, "标题2", R.color.colorPrimary, R.color.colorAccent, R.mipmap.ic_launcher, R.mipmap.ic_launcher_round));
tabItemViews.add(new BottomTabView.TabItemView(this, "标题3", R.color.colorPrimary, R.color.colorAccent, R.mipmap.ic_launcher, R.mipmap.ic_launcher_round));
tabItemViews.add(new BottomTabView.TabItemView(this, "标题4", R.color.colorPrimary, R.color.colorAccent, R.mipmap.ic_launcher, R.mipmap.ic_launcher_round));

设置数据

bottomTabView.setTabItemViews(tabItemViews);

连接 ViewPager

bottomTabView.setUpWithViewPager(viewPager);

设置 Item 选择监听

bottomTabView.setOnTabItemSelectListener(new BottomTabView.OnTabItemSelectListener() {
    @Override
    public void onTabItemSelect(int position) {
        //viewPager.setCurrentItem(position, true);
        //...
    }
});

已经被选中,再次点击的监听

bottomTabView.setOnSecondSelectListener(new BottomTabView.OnSecondSelectListener() {
    @Override
    public void onSecondSelect(int position) {
        //refresh();
    }
});

更多高级使用方法请看MatthewBases

About

停止维护。自定义实现主流底部 Tab 菜单 View。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.