@@ -3,55 +3,74 @@ A simple & curved & material bottom navigation for Android written in **Kotlin**
33
44![ ] ( https://github.com/shetmobile/MeowBottomNavigation/raw/master/resources/Preview.gif )
55
6-
7- > CAUTION : if you are ** Java** developer and have problems with Kotlin, so check this link: https://github.com/oneHamidreza/MeowBottomNavigationJava
8-
96## Download
10- build.gradle (project path)
7+
8+ Update your ` build.gradle ` (project path) like below :
9+
1110``` groovy
1211buildscript {
1312 repositories {
1413 jcenter()
1514 }
1615}
1716```
18- build.gradle (module path)
17+
18+ Update your ` build.gradle ` (module path) like below :
19+
1920``` groovy
2021dependencies {
21- implementation 'com.etebarian:meow-bottom-navigation:1.2 .0'
22+ implementation 'com.etebarian:meow-bottom-navigation:1.3 .0'
2223}
2324```
24- Use androidx by adding this lines to gradle.properties. if you want more info, just google ** AndroidX** .
25+
26+ Use androidx by adding this lines to ` gradle.properties ` . If you want more info, just google ** AndroidX** .
27+
2528``` properties
2629android.useAndroidX =true
2730android.enableJetifier =true
2831```
29- If you want to add this library to a JAVA Project, you must add kotlin library to build.gradle.
32+
33+ If you want to add this library to a JAVA Project, you must add kotlin library to ` build.gradle ` .
34+
3035``` groovy
3136dependencies {
3237 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61"
3338}
3439```
40+ ## 😍 Donate & Support
41+
42+ We are developing this framework in open source community without financial planning but the maintenance & preparing updates at periodic times is Time-consuming.
43+ If you like this project and you want to give us peace of mind, you can support us by clicking this button :
44+
45+ <p >
46+ <a href =" https://paypal.me/imehrzadm " >
47+ <img width =" 20% " src =" https://raw.githubusercontent.com/oneHamidreza/Meow-Framework-MVVM/master/Resources/img_support.png " />
48+ </a >
49+ </p >
3550
3651## Usage
37- Add Meow Bottom Navigation in xml
52+
53+ Add Meow Bottom Navigation in you layout xml file.
54+
3855``` xml
39- <com .etebarian .meowbottomnavigation.MeowBottomNavigation
40- android : layout_width =" match_parent"
41- android : layout_height =" wrap_content" />
56+ <meow .meowbottomnavigation.MeowBottomNavigation
57+ android : layout_width =" match_parent"
58+ android : layout_height =" wrap_content" />
4259```
4360
4461Add menu items in code.
62+
4563``` kotlin
4664val bottomNavigation = findView(R .id.bottomNavigation)
4765bottomNavigation.add(MeowBottomNavigation .Model (1 , R .drawable.ic_home))
4866bottomNavigation.add(MeowBottomNavigation .Model (2 , R .drawable.ic_explore))
4967bottomNavigation.add(MeowBottomNavigation .Model (3 , R .drawable.ic_message))
5068```
51- Remember that icons must be vector drawable.
52- Add vectorDrawables.useSupportLibrary = true to your build.gradle inside defaultConfig{ ... }
69+
70+ Add vectorDrawables.useSupportLibrary = true to your build.gradle inside ` defaultConfig{ ... } ` to use vector drawable icons.
5371
5472## Customization
73+
5574``` xml
5675<com .etebarian.meowbottomnavigation.MeowBottomNavigation
5776 android : layout_width =" match_parent"
@@ -66,20 +85,29 @@ Add vectorDrawables.useSupportLibrary = true to your build.gradle inside default
6685 app : mbn_selectedIconColor =" #3c415e"
6786 app : mbn_shadowColor =" #1f212121" />
6887```
88+
6989- You can change this properties in ** Kotlin/Java** Realtime⌚.
7090
7191## Listeners
72- kotlin
92+
93+ Use ` setOnShowListener() ` function to access when a cell has been shown.
94+
7395``` kotlin
7496bottomNavigation.setOnShowListener {
7597 // YOUR CODES
7698}
77-
99+ ```
100+
101+ Use ` setOnClickMenuListener() ` function to access when a cell has been clicked.
102+
103+ ``` kotlin
78104bottomNavigation.setOnClickMenuListener {
79105 // YOUR CODES
80106}
81107```
82- java
108+
109+ If you are Java Developer, use this examples :
110+
83111``` java
84112bottomNavigation. setOnClickMenuListener(new Function1<MeowBottomNavigation . Model , Unit >() {
85113 @Override
@@ -99,23 +127,29 @@ bottomNavigation.setOnShowListener(new Function1<MeowBottomNavigation.Model, Uni
99127```
100128
101129## Counter Badge
102- Setting One Tab
130+
131+ Set counter badge on a specific cell by ` setCount(Int,String) ` .
132+
103133``` kotlin
104- bottomNavigation.setCount(TAB_ID , STRING )
134+ bottomNavigation.setCount(CELL_ID , YOUR_STRING )
105135```
106136
107- Clearing One Tab
137+ Clear counter badge on a specific cell by ` clearCount(Int) ` .
138+
108139``` kotlin
109- bottomNavigation.clearCount(TAB_ID )
140+ bottomNavigation.clearCount(CELL_ID )
110141```
111142
112- Clearing All Tabs
143+ Clear all counter badges on a specific cell by ` clearCount(Int) ` .
144+
113145``` kotlin
114146bottomNavigation.clearAllCounts(TAB_ID )
115147```
116148
117- ## Set Default Tab
118- Use this function
149+ ## Set Default CELL
150+
151+ Use this function :
152+
119153``` kotlin
120- bottomNavigation.show(TAB_ID )
154+ bottomNavigation.show(CELL_ID )
121155```
0 commit comments