MCPcopy Index your code
hub / github.com/RoyWallace/BottomNavigationBar

github.com/RoyWallace/BottomNavigationBar @0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3 ↗ · + Follow
84 symbols 149 edges 13 files 8 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

BottomNavigationBar

Material design 更新的BottomNavigationbar的开源实现

目前版本最新版本是v0.3,还在努力完善中,有兴趣的朋友可以关注。如果发现问题请写在issue,我会定期查看和修复。

version

v0.1 基础版本

v0.2 支持修改tab selected 情况下的width scale 属性

v0.3 支持设置tab text 在unselected情况下是否隐藏

TODO

支持 bar background 不随tab选中而变化 支持 tab textColor selector

bottom navigation bars的规范在这里

Show

image image

How to use

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Step 2. Add the dependency

dependencies {
        compile 'com.github.RoyWallace:BottomNavigationBar:v0.1'
}

Step 3. use it in your layout xml

<etong.bottomnavigation.lib.BottomNavigationBar
    android:id="@+id/bottomLayout"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_gravity="bottom"/>

Step 4. add tab and tabSelected listener

bottomLayout = (BottomNavigationBar) findViewById(R.id.bottomLayout);
//params: int icon,String text,int color
bottomLayout.addTab(R.mipmap.ic_local_movies_white_48dp, "Movies & Tv", 0xff4a5965);
bottomLayout.setOnTabListener(new BottomNavigationBar.TabListener() {
    @Override
    public void onSelected(int position) {
        //...
    }
});

and you can also use the BottomNavigationBehavior with CoordinatorLayout

<etong.bottomnavigation.lib.BottomNavigationBar
    android:id="@+id/bottomLayout"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_gravity="bottom"
    app:layout_behavior="etong.bottomnavigation.lib.BottomNavigationBehavior"/>

Set tab selected width

bottomLayout.setTabWidthSelectedScale(1.0f);

Set tab text default visible

bottomLayout.setTextDefaultVisible(true);

License

BottomNavigationBar for Android The MIT License (MIT)

Copyright (c) 2016 恶童历险记(https://github.com/RoyWallace)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Extension points exported contracts — how you extend this code

TabListener (Interface)
(no doc) [1 implementers]
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomNavigationBar.java

Core symbols most depended-on inside this repo

setSelected
called by 6
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java
addTab
called by 4
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomNavigationBar.java
drawCircle
called by 3
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomNavigationBar.java
newInstance
called by 3
app/src/main/java/etong/bottomnavigation/demo/MoviesFragment.java
isSelected
called by 2
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java
widthAnimator
called by 2
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java
textScaleAnimator
called by 2
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java
imageTranslationAnimator
called by 2
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java

Shape

Method 66
Class 17
Interface 1

Languages

Java100%

Modules by API surface

bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomNavigationBar.java19 symbols
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomBarTab.java12 symbols
app/src/main/java/etong/bottomnavigation/demo/NewsstandFragment.java10 symbols
app/src/main/java/etong/bottomnavigation/demo/BooksFragment.java10 symbols
app/src/main/java/etong/bottomnavigation/demo/MainActivity.java9 symbols
bottomnavigationlayout/src/main/java/etong/bottomnavigation/lib/BottomNavigationBehavior.java6 symbols
app/src/main/java/etong/bottomnavigation/demo/MusicFragment.java4 symbols
app/src/main/java/etong/bottomnavigation/demo/MoviesFragment.java4 symbols
bottomnavigationlayout/src/test/java/etong/bottomnavigation/lib/ExampleUnitTest.java2 symbols
bottomnavigationlayout/src/androidTest/java/etong/bottomnavigation/lib/ApplicationTest.java2 symbols
app/src/test/java/etong/bottomnavigation/demo/ExampleUnitTest.java2 symbols
app/src/main/java/etong/bottomnavigation/demo/BottomNavigationBean.java2 symbols

For agents

$ claude mcp add BottomNavigationBar \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact