https://github.com/anoop44/awesomenavigation
AwesomeNavigation is a collection of navigation components that can be used as bottom navigations as well as top navigation(Tab bar)
https://github.com/anoop44/awesomenavigation
android-library bottomnavigationview navigationbar
Last synced: 5 days ago
JSON representation
AwesomeNavigation is a collection of navigation components that can be used as bottom navigations as well as top navigation(Tab bar)
- Host: GitHub
- URL: https://github.com/anoop44/awesomenavigation
- Owner: anoop44
- Created: 2019-12-09T11:27:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-30T05:11:49.000Z (about 6 years ago)
- Last Synced: 2025-11-05T22:02:00.795Z (4 months ago)
- Topics: android-library, bottomnavigationview, navigationbar
- Language: Kotlin
- Homepage:
- Size: 731 KB
- Stars: 26
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AwesomeNavigation [  ](https://bintray.com/anoop44/maven/awesome-navigation/1.2.0/link) 
AwesomeNavigation is a collection of navigation components(styles) that can be used as bottom navigations as well as top navigation(Tab bar). Not all components in this are suitable for tab bar. As of now there is only two components, but more components will be added soon and option to choose the type you wanted to use will be added soon
Each navigation component is referred as a style(style1, style2 etc). Which style to be used can be selected via the navStyle attribute in layout xml. Its takes values like `style1`, `style2` etc.
### style1

### style2

## Adding to project
### Gradle
Add below code to your **root** `build.gradle` file (if you have multiple modules and only one of them require `AwesomeNavigation`, add the `jcenter()` repository only in that module's `build.gradle`).
```gradle
allprojects {
repositories {
jcenter()
}
}
```
And add the following dependency code to your **module**'s `build.gradle` file.
```gradle
dependencies {
implementation "ss.anoop:awesome-navigation:${latest-version}"
}
```
AwesomeNavigation can be included in your layout xml like any other view. Below is a simple example
## Usage
```xml
```
### Customization
Table below describes the properties available to customize the AwesomeNavigation. Some options are applicable to only certain styles
| Property Name | Format | Description | Styles applicable |
|------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
| navItems | reference | It refers to a menu xml which contains list of items to be added in the navigation. Currently it reads `title`, `icon`, `selectedIcon` and `id` from a single item in the menu. `selectedIcon` may not be used by all navigation components. | all styles |
| textColor | color | defines the color of the text shown on each navigation item | all styles |
| textSize | dimension | defines the size of the text shown on each navigation item. As any other text size mention it in `sp` | all styles|
| iconSize | dimension | defines the size of icon in every navigation item | all styles |
| spacing | dimension | defines the space between text and icon | all styles |
| itemChangeDuration | integer | defines the duration of animation | all styles |
| selectedColor | color | defines the color of selected tab background | style 2 |
| cornerRadius | dimension | defines corner radius of selection background | style 2|
### Change Listener
AwesomeNavigation offers an `OnNavigationSelectedListener` that informs when selected tab is changed or same item is re-selected. The callback has two parameters, `id` and `position`.
```kotlin
bottomNavigation.setOnNavigationSelectedListener(object : OnNavigationSelectedListener {
override fun onSelectNavigation(id: Int, position: Int) {
changeContent(id, position)
}
override fun onReselectNavigation(id: Int, position: Int) {
scrollToTop()
}
})
```
## Find this library useful? :heart:
Support it by joining __[stargazers](https://github.com/anoop44/AwesomeNavigation/stargazers)__ for this repository. :star:
# License
```
Copyright 2020 anoop44 (Anoop)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```