{"id":20373130,"url":"https://github.com/st235/expandablebottombar","last_synced_at":"2025-04-08T10:18:05.261Z","repository":{"id":41466250,"uuid":"173377910","full_name":"st235/ExpandableBottomBar","owner":"st235","description":"A new way to implement navigation in your app 🏎","archived":false,"fork":false,"pushed_at":"2024-01-07T08:26:43.000Z","size":28408,"stargazers_count":788,"open_issues_count":2,"forks_count":58,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-01T08:42:18.381Z","etag":null,"topics":["android","bottombar","hacktoberfest","hacktoberfest2023","kotlin","menu","navigation"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/st235.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-01T22:46:24.000Z","updated_at":"2025-03-06T01:59:13.000Z","dependencies_parsed_at":"2024-05-03T15:36:45.196Z","dependency_job_id":null,"html_url":"https://github.com/st235/ExpandableBottomBar","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FExpandableBottomBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FExpandableBottomBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FExpandableBottomBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FExpandableBottomBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st235","download_url":"https://codeload.github.com/st235/ExpandableBottomBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819940,"owners_count":21001394,"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":["android","bottombar","hacktoberfest","hacktoberfest2023","kotlin","menu","navigation"],"created_at":"2024-11-15T01:16:44.483Z","updated_at":"2025-04-08T10:18:05.241Z","avatar_url":"https://github.com/st235.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"/images/video.gif\" width=\"600\" height=\"205\"\u003e\n\n# ExpandableBottomBar\n\n![Min Android Sdk](https://img.shields.io/badge/minSdkVersion-19-FF4081.svg)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.st235/expandablebottombar.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.st235%22%20AND%20a:%22expandablebottombar%22)\n[![CircleCI](https://circleci.com/gh/st235/ExpandableBottomBar.svg?style=svg)](https://circleci.com/gh/st235/ExpandableBottomBar)\n\nA new way to improve navigation in your app\n\nIts really easy integrate to your project\n\n## take it, faster, faster\n\n__Important: library was migrated from JCenter to MavenCentral__ \n\nIt means that it may be necessary to add __mavenCentral__ repository to your repositories list\n\n```groovy\nallprojects {\n    repositories {\n        // your repositories\n\n        mavenCentral()\n    }\n}\n```\n\n- Maven\n\n```text\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.st235\u003c/groupId\u003e\n  \u003cartifactId\u003eexpandablebottombar\u003c/artifactId\u003e\n  \u003cversion\u003eX.X\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n- Gradle\n\n```text\nimplementation 'com.github.st235:expandablebottombar:X.X'\n```\n\n- Ivy\n\n```text\n\u003cdependency org='com.github.st235' name='expandablebottombar' rev='X.X'\u003e\n  \u003cartifact name='expandablebottombar' ext='pom' \u003e\u003c/artifact\u003e\n\u003c/dependency\u003e\n```\n\nP.S.: Check out latest version code in badge at the top of this page.\n\n## Usage\n\nReally simple as I wrote earlier\n\nFirstly, you should declare your view in xml file\n\n```xml\n    \u003cgithub.com.st235.lib_expandablebottombar.ExpandableBottomBar\n        android:id=\"@+id/expandable_bottom_bar\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"20dp\"\n        app:exb_backgroundCornerRadius=\"25dp\"\n        app:exb_backgroundColor=\"#2e2e2e\"\n        app:exb_itemInactiveColor=\"#fff\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\" /\u003e\n```\n\nThen you should add menu items to your navigation menu\nTo access menu call `bottomBar.menu` on your navigation view\n\n```kotlin\n        val bottomBar: ExpandableBottomBar = findViewById(R.id.expandable_bottom_bar)\n        val menu = bottomBar.menu\n\n        menu.add(\n            MenuItemDescriptor.Builder(\n                this,\n                R.id.icon_home,\n                R.drawable.ic_home,\n                R.string.text, \n                Color.GRAY\n            )\n                .build()\n        )\n\n        bottomBar.onItemSelectedListener = { view, menuItem -\u003e\n            /**\n             * handle menu item clicks here,\n             * but clicks on already selected item will not affect this callback\n             */\n        }\n        \n        bottomBar.onItemReselectedListener = { view, menuItem -\u003e\n            /**\n             * handle here all the click in already selected items\n             */\n        }\n```\n\n## Xml menu declaration\n\nIf your menu is constantly, you may specify it from xml\n\nFirstly, you should declare menu items in xml\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmenu xmlns:app=\"http://schemas.android.com/apk/res-auto\" xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n    \u003citem\n        android:id=\"@+id/home\"\n        android:title=\"@string/text\"\n        android:icon=\"@drawable/ic_home\"\n        app:exb_color=\"#FF8888\" /\u003e\n\n    \u003citem\n        android:id=\"@+id/settings\"\n        android:title=\"@string/text4\"\n        android:icon=\"@drawable/ic_settings\"\n        app:exb_color=\"@color/colorSettings\" /\u003e\n\n    \u003citem\n        android:id=\"@+id/bookmarks\"\n        android:title=\"@string/text3\"\n        android:icon=\"@drawable/ic_bookmarks\"\n        app:exb_color=\"#fa2\" /\u003e\n\u003c/menu\u003e\n```\n\neach item tag has following attributes:\n\n| property | type | description |\n| ----- | ----- | ----- |\n| **id** | reference | an id of menu item |\n| **exb_color** | reference/color | color of element, it may be color reference or color |\n| **icon** | reference | icon reference (vector drawables supported) |\n| **title** | reference/text | item title |\n| **exb_badgeColor** | color | notification badge background color. **It will override the color from layout attribute** |\n| **exb_badgeTextColor** | color | notification badge text color. **It will override the color from layout attribute** |\n\nJust like any Android menu 😉\n\nThen you should reference this xml file at the view attributes\n\n```xml\n    \u003cgithub.com.st235.lib_expandablebottombar.ExpandableBottomBar\n        android:id=\"@+id/expandable_bottom_bar\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"20dp\"\n        app:exb_backgroundCornerRadius=\"25dp\"\n        app:exb_itemInactiveColor=\"#fff\"\n        app:exb_items=\"@menu/bottom_bar\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\" /\u003e\n```\n\n## Xml attributes\n\n| property | type | description |\n| ----- | ----- | ----- |\n| **exb_elevation** | dimen | component elevation (important: api 21+) |\n| **exb_backgroundColor** | color | bottom bar background color |\n| **exb_transitionDuration** | integer | time between one item collapsed and another item expanded |\n| **exb_backgroundCornerRadius** | dimen | bottom bar background corners radius |\n| **exb_itemInactiveColor** | color | item menu color, when its inactive |\n| **exb_itemBackgroundCornerRadius** | dimen | item background corner radius |\n| **exb_itemStyle** | enum: normal, outline, stroke | controls the style of items. **normal** = items are filled with solid color; **outline** = no fill, only border; **stroke** = fill + border |\n| **exb_itemBackgroundOpacity** | float | item background opacity (important: final color alpha calculates by next formulae alpha = opacity * 255) |\n| **exb_item_vertical_margin** | dimen | top \u0026 bottom item margins |\n| **exb_item_horizontal_margin** | dimen | left \u0026 right item margins |\n| **exb_item_vertical_padding** | dimen | top \u0026 bottom item padding |\n| **exb_item_horizontal_padding** | dimen | left \u0026 right item padding |\n| **exb_items** | reference | xml supported menu format |\n| **exb_notificationBadgeBackgroundColor** | color | notification badge background color. **Will be applied to all menu items** |\n| **exb_notificationBadgeTextColor** | color | notification badge text color. **Will be applied to all menu items** |\n\n## Notification badges\n\n```kotlin\n    /**\n     * Returns notification object\n     */\n    val menu = bottomBar.menu\n    val notification = menu.findItemById(i.itemId).notification() // itemId is R.id.action_id\n\n   notification.show() // shows simple dot-notification\n   notification.show(\"string literal\") // shows notification with counter. Counter could not exceed the 4 symbols length\n\n  notification.clear() // removes notification badge from menu item\n```\n\n## Navigation Components support\n\nUsually Drawer or BottomNavigationView attached to navigation controller with `NavigationUI.setupWithNavController(view, navController)`, but this system is not applicable\nto customview components. That's why ExpandableBottomBar offers it's own `ExpandableBottomBarNavigationUI`\n\nTo attach ExpandableBottomBar to your navigation components you should use the same approach\n\n```kotlin\n    ExpandableBottomBarNavigationUI.setupWithNavController(bottomNavigation, navigationController)\n```\n\n## Coordinator Layout support\n\nDo you waiting for Coordinator Layout support - and it is already here! Fabs and Snackbars aligned by bottom bar! Hooray 🎉\n\nAvailable without registration and SMS, starting from **0.8** version. Seriously, everything is already working out of the box - nothing needs to be done.\n\nBut... if you need to support hiding the menu by list/grid scroll - then you are really lucky!\n\nThis functionality is very simple to implement. You need to redeclare custom `Coordinator Layout Behavoir` to `ExpandableBottomBarScrollableBehavior`.\n\n```xml\n    \u003cgithub.com.st235.lib_expandablebottombar.ExpandableBottomBar\n            android:id=\"@+id/expandable_bottom_bar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"bottom\"\n            app:layout_behavior=\"github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior\"\n            app:items=\"@menu/bottom_bar\" /\u003e\n```\n\nReally easy ;D \n\nAfter integration this behavior should looks like:\n\n\u003cimg src=\"/images/coordinator_layout.gif\" width=\"270\" height=\"480\"\u003e\n\n## Migration guide\n\nYou may found all necessary info about migration from old versions [here](https://github.com/st235/ExpandableBottomBar/wiki/Migration)\n\n## Screens\n\n\u003cimg src=\"/images/ordinary.png\" width=\"270\" height=\"480\"\u003e \u003cimg src=\"/images/small_rounded.png\" width=\"270\" height=\"480\"\u003e \u003cimg src=\"/images/hard_rounded.png\" width=\"270\" height=\"480\"\u003e \u003cimg src=\"/images/night_like.png\" width=\"270\" height=\"480\"\u003e \u003cimg src=\"/images/styles.png\" width=\"270\" height=\"480\"\u003e\n\n\n### License\n\n```text\nMIT License\n\nCopyright (c) 2019 - present, Alexander Dadukin\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fexpandablebottombar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst235%2Fexpandablebottombar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fexpandablebottombar/lists"}