{"id":13644827,"url":"https://github.com/RoyWallace/BottomNavigationBar","last_synced_at":"2025-04-21T10:34:36.565Z","repository":{"id":82312223,"uuid":"54253506","full_name":"RoyWallace/BottomNavigationBar","owner":"RoyWallace","description":"Material design 更新的BottomNavigationbar的开源实现","archived":false,"fork":false,"pushed_at":"2017-09-12T02:47:57.000Z","size":1123,"stargazers_count":329,"open_issues_count":10,"forks_count":59,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-09T17:42:27.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RoyWallace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-19T07:34:05.000Z","updated_at":"2024-09-20T02:57:23.000Z","dependencies_parsed_at":"2023-06-26T19:48:00.627Z","dependency_job_id":null,"html_url":"https://github.com/RoyWallace/BottomNavigationBar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyWallace%2FBottomNavigationBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyWallace%2FBottomNavigationBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyWallace%2FBottomNavigationBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyWallace%2FBottomNavigationBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyWallace","download_url":"https://codeload.github.com/RoyWallace/BottomNavigationBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040878,"owners_count":21365176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:14.361Z","updated_at":"2025-04-21T10:34:31.544Z","avatar_url":"https://github.com/RoyWallace.png","language":"Java","funding_links":[],"categories":["BottomNavigation"],"sub_categories":[],"readme":"#开发过程中遇到问题可以加群讨论，Android讨论群：295456349\n\n# BottomNavigationBar\nMaterial design 更新的BottomNavigationbar的开源实现\n\n目前版本最新版本是v0.3，还在努力完善中，有兴趣的朋友可以关注。如果发现问题请写在issue，我会定期查看和修复。\n\n###version\n\nv0.1 基础版本\n\nv0.2 支持修改tab selected 情况下的width scale 属性\n\nv0.3 支持设置tab text 在unselected情况下是否隐藏\n\n###Demo修改\n有童鞋反应说要如何实现像新规范里面NavigationBar透明的样式，所以这里把项目的Demo修改一下，实现Navigationbar透明并且覆盖在BottomNavigationBar上面。（目前这种实现方式还不够完善，会导致statusBar也不占位的问题。如果有网友有更好的实现方式，不妨提出来，大家一起探讨和分享。）\nps:最近碰上公司项目比较赶，所以暂停了BottomNavigationBar的开源进度。\n\n具体实现：\ndemo基础上\n\n        setContentView(R.layout.activity_main);\n        if (Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.KITKAT) {\n            Window window = getWindow();\n            // Translucent status bar\n            window.setFlags(\n                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,\n                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n            // Translucent navigation bar\n            window.setFlags(\n                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,\n                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        }\n去掉所有的xml中的所有android:fitsSystemWindows=\"true\"\n\n    \u003candroid.support.design.widget.AppBarLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:theme=\"@style/AppTheme.AppBarOverlay\"\u003e\n\n        \u003cView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"24dp\"/\u003e\n\n        \u003candroid.support.v7.widget.Toolbar\n            android:id=\"@+id/toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"?attr/actionBarSize\"\n            android:background=\"#33000000\"\n            app:layout_scrollFlags=\"scroll\"\n            app:popupTheme=\"@style/AppTheme.PopupOverlay\"/\u003e\n\n    \u003c/android.support.design.widget.AppBarLayout\u003e\n\n#####补个图\n\n ![image](https://github.com/RoyWallace/BottomNavigationBar/blob/master/gif/v0.3.1.gif?raw=true)\n\n\n###TODO\n\n 支持 bar background 不随tab选中而变化\n 支持 tab textColor selector\n\n\n[bottom navigation bars的规范在这里](https://www.google.com/design/spec/components/bottom-navigation.html)\n\n###Show\n\n![image](https://github.com/RoyWallace/BottomNavigationBar/blob/master/gif/v0.2.gif?raw=true)\n![image](https://github.com/RoyWallace/BottomNavigationBar/blob/master/gif/v0.3.gif?raw=true)\n\n####How to use\n[![](https://jitpack.io/v/RoyWallace/BottomNavigationBar.svg)](https://jitpack.io/#RoyWallace/BottomNavigationBar)\n\n**Step 1**. Add the JitPack repository to your build file\nAdd it in your root build.gradle at the end of repositories:\n\n    allprojects {\n        repositories {\n            ...\n            maven { url \"https://jitpack.io\" }\n        }\n    }\n**Step 2.** Add the dependency\n\n    dependencies {\n            compile 'com.github.RoyWallace:BottomNavigationBar:v0.1'\n    }\n\n**Step 3.**  use it in your layout xml\n\n    \u003cetong.bottomnavigation.lib.BottomNavigationBar\n        android:id=\"@+id/bottomLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"?attr/actionBarSize\"\n        android:layout_gravity=\"bottom\"/\u003e\n**Step 4.** add tab and tabSelected listener\n\n    bottomLayout = (BottomNavigationBar) findViewById(R.id.bottomLayout);\n    //params: int icon,String text,int color\n    bottomLayout.addTab(R.mipmap.ic_local_movies_white_48dp, \"Movies \u0026 Tv\", 0xff4a5965);\n    bottomLayout.setOnTabListener(new BottomNavigationBar.TabListener() {\n        @Override\n        public void onSelected(int position) {\n            //...\n        }\n    });\nand you can also use the **BottomNavigationBehavior** with **CoordinatorLayout** \n\n    \u003cetong.bottomnavigation.lib.BottomNavigationBar\n        android:id=\"@+id/bottomLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"?attr/actionBarSize\"\n        android:layout_gravity=\"bottom\"\n        app:layout_behavior=\"etong.bottomnavigation.lib.BottomNavigationBehavior\"/\u003e\n\n####Set tab selected width( bottomLayout.setTabWidthSelectedScale(1.5f);\n####Set tab text default visible\n    bottomLayout.setTextDefaultVisible(true);\n    \n \n\n#License\nBottomNavigationBar for Android\nThe MIT License (MIT)\n\nCopyright (c) 2016 恶童历险记(https://github.com/RoyWallace)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRoyWallace%2FBottomNavigationBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRoyWallace%2FBottomNavigationBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRoyWallace%2FBottomNavigationBar/lists"}