├── sample
├── .gitignore
├── src
│ ├── main
│ │ ├── assets
│ │ │ └── fonts
│ │ │ │ ├── Noh_bold.ttf
│ │ │ │ └── Noh_normal.ttf
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_book_black_24dp.xml
│ │ │ │ ├── ic_favorite_black_24dp.xml
│ │ │ │ ├── ic_mic_black_24dp.xml
│ │ │ │ └── github_circle.xml
│ │ │ └── layout
│ │ │ │ ├── fragment_blank.xml
│ │ │ │ └── activity_main.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── luseen
│ │ │ └── myapplication
│ │ │ └── MainActivity.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── luseen
│ │ │ └── myapplication
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── luseen
│ │ └── myapplication
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── .idea
├── .name
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── runConfigurations.xml
├── modules.xml
├── compiler.xml
├── gradle.xml
└── misc.xml
├── BottomNavigationViewLibrary
├── .gitignore
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── luseen
│ │ │ └── luseenbottomnavigation
│ │ │ └── BottomNavigation
│ │ │ ├── OnBottomNavigationItemClickListener.java
│ │ │ ├── BottomNavigationItem.java
│ │ │ ├── BottomNavigationUtils.java
│ │ │ └── BottomNavigationView.java
│ │ └── res
│ │ ├── drawable
│ │ └── shadow.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ └── attrs.xml
│ │ └── layout
│ │ └── bottom_navigation.xml
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── ScreenShots
├── gifView.gif
├── gifView2.gif
├── gifView3.gif
├── gifView4.gif
├── screen1.png
├── screen2.png
├── screen3.png
└── screen4.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── gradlew.bat
├── gradlew
└── README.md
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | LuseenBottomNavigation
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':BottomNavigationViewLibrary'
2 |
--------------------------------------------------------------------------------
/ScreenShots/gifView.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/gifView.gif
--------------------------------------------------------------------------------
/ScreenShots/gifView2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/gifView2.gif
--------------------------------------------------------------------------------
/ScreenShots/gifView3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/gifView3.gif
--------------------------------------------------------------------------------
/ScreenShots/gifView4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/gifView4.gif
--------------------------------------------------------------------------------
/ScreenShots/screen1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/screen1.png
--------------------------------------------------------------------------------
/ScreenShots/screen2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/screen2.png
--------------------------------------------------------------------------------
/ScreenShots/screen3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/screen3.png
--------------------------------------------------------------------------------
/ScreenShots/screen4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/ScreenShots/screen4.png
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/sample/src/main/assets/fonts/Noh_bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/assets/fonts/Noh_bold.ttf
--------------------------------------------------------------------------------
/sample/src/main/assets/fonts/Noh_normal.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/assets/fonts/Noh_normal.ttf
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/armcha/LuseenBottomNavigation/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Application
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 10dp
6 | 12dp
7 |
8 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/java/com/luseen/luseenbottomnavigation/BottomNavigation/OnBottomNavigationItemClickListener.java:
--------------------------------------------------------------------------------
1 | package com.luseen.luseenbottomnavigation.BottomNavigation;
2 |
3 | /**
4 | * Created by Chatikyan on 31.03.2016.
5 | */
6 | public interface OnBottomNavigationItemClickListener {
7 | void onNavigationItemClick(int index);
8 | }
9 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/res/drawable/shadow.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2196F3
4 | #FFFFFF
5 | #e7e6e7
6 | #757575
7 | #ffffff
8 |
9 |
--------------------------------------------------------------------------------
/sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/test/java/com/luseen/myapplication/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.luseen.myapplication;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | #00BCD4
7 | #E91E63
8 | #FF5722
9 | #4CAF50
10 |
11 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/androidTest/java/com/luseen/myapplication/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.luseen.myapplication;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_book_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_favorite_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_mic_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\Chatikyan\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\Chatikyan\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.0"
6 |
7 | defaultConfig {
8 | applicationId "com.luseen.myapplication"
9 | minSdkVersion 15
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 | vectorDrawables.useSupportLibrary = true
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | compile fileTree(dir: 'libs', include: ['*.jar'])
25 | testCompile 'junit:junit:4.12'
26 | compile project(':BottomNavigationViewLibrary')
27 | compile 'com.android.support:appcompat-v7:24.0.0'
28 | compile 'com.android.support:support-v4:24.0.0'
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_blank.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/github_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.novoda.bintray-release'
3 |
4 | android {
5 | compileSdkVersion 24
6 | buildToolsVersion "24.0.0"
7 |
8 | defaultConfig {
9 | minSdkVersion 15
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 | vectorDrawables.useSupportLibrary = true
14 | }
15 | buildTypes {
16 | release {
17 | tasks.withType(Javadoc).all { enabled = false }
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | compile 'com.android.support:appcompat-v7:24.0.0'
27 | }
28 |
29 | publish {
30 | groupId = 'com.github.armcha'
31 | artifactId = 'LuseenBottomNavigation'
32 | publishVersion = '1.8.2'
33 | desc = 'Material Bottom Navigation'
34 | licences = ['MIT']
35 | website = 'https://github.com/armcha/LuseenBottomNavigation'
36 | }
37 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 8dp
3 | 8dp
4 | 4dp
5 | 104dp
6 | 168dp
7 | 56dp
8 | 1dp
9 | 24dp
10 | 5dp
11 | 9dp
12 | 16dp
13 | 7dp
14 | 12dp
15 | 12dp
16 | 14sp
17 | 12sp
18 |
19 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
30 |
31 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/java/com/luseen/luseenbottomnavigation/BottomNavigation/BottomNavigationItem.java:
--------------------------------------------------------------------------------
1 | package com.luseen.luseenbottomnavigation.BottomNavigation;
2 |
3 | public class BottomNavigationItem {
4 |
5 | private String title;
6 | private int color;
7 | private int imageResource;
8 | private int imageResourceActive = 0;
9 |
10 | public BottomNavigationItem(String title, int color, int imageResource) {
11 | this.title = title;
12 | this.color = color;
13 | this.imageResource = imageResource;
14 | }
15 | public int getImageResource() {
16 | return imageResource;
17 | }
18 |
19 | public void setImageResource(int imageResource) {
20 | this.imageResource = imageResource;
21 | }
22 |
23 | public int getColor() {
24 | return color;
25 | }
26 |
27 | public void setColor(int color) {
28 | this.color = color;
29 | }
30 |
31 | public String getTitle() {
32 | return title;
33 | }
34 |
35 | public void setTitle(String title) {
36 | this.title = title;
37 | }
38 |
39 | public int getImageResourceActive() {
40 | return imageResourceActive;
41 | }
42 |
43 | public void setImageResourceActive(int imageResourceActive) {
44 | this.imageResourceActive = imageResourceActive;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/res/layout/bottom_navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
24 |
25 |
34 |
35 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.8
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/luseen/myapplication/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.luseen.myapplication;
2 |
3 | import android.graphics.Typeface;
4 | import android.os.Bundle;
5 | import android.support.v4.content.ContextCompat;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.TextView;
10 |
11 | import com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationItem;
12 | import com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView;
13 | import com.luseen.luseenbottomnavigation.BottomNavigation.OnBottomNavigationItemClickListener;
14 |
15 | public class MainActivity extends AppCompatActivity {
16 |
17 | private BottomNavigationView bottomNavigationView;
18 |
19 | private TextView textView;
20 |
21 | private Button button;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_main);
27 | textView = (TextView) findViewById(R.id.textView);
28 | button = (Button) findViewById(R.id.button);
29 | bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigation);
30 |
31 | int[] image = {R.drawable.ic_mic_black_24dp, R.drawable.ic_favorite_black_24dp,
32 | R.drawable.ic_book_black_24dp, R.drawable.github_circle};
33 | int[] color = {ContextCompat.getColor(this, R.color.firstColor), ContextCompat.getColor(this, R.color.secondColor),
34 | ContextCompat.getColor(this, R.color.thirdColor), ContextCompat.getColor(this, R.color.fourthColor)};
35 |
36 | if (bottomNavigationView != null) {
37 | bottomNavigationView.isWithText(false);
38 | // bottomNavigationView.activateTabletMode();
39 | bottomNavigationView.isColoredBackground(true);
40 | bottomNavigationView.setTextActiveSize(getResources().getDimension(R.dimen.text_active));
41 | bottomNavigationView.setTextInactiveSize(getResources().getDimension(R.dimen.text_inactive));
42 | bottomNavigationView.setItemActiveColorWithoutColoredBackground(ContextCompat.getColor(this, R.color.firstColor));
43 | bottomNavigationView.setFont(Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/Noh_normal.ttf"));
44 | }
45 |
46 | BottomNavigationItem bottomNavigationItem = new BottomNavigationItem
47 | ("Record", color[0], image[0]);
48 | BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem
49 | ("Like", color[1], image[1]);
50 | BottomNavigationItem bottomNavigationItem2 = new BottomNavigationItem
51 | ("Books", color[2], image[2]);
52 | BottomNavigationItem bottomNavigationItem3 = new BottomNavigationItem
53 | ("GitHub", color[3], image[3]);
54 |
55 |
56 | bottomNavigationView.addTab(bottomNavigationItem);
57 | bottomNavigationView.addTab(bottomNavigationItem1);
58 | bottomNavigationView.addTab(bottomNavigationItem2);
59 | bottomNavigationView.addTab(bottomNavigationItem3);
60 |
61 | bottomNavigationView.setOnBottomNavigationItemClickListener(new OnBottomNavigationItemClickListener() {
62 | @Override
63 | public void onNavigationItemClick(int index) {
64 | switch (index) {
65 | case 0:
66 | textView.setText("Record");
67 | break;
68 | case 1:
69 | textView.setText("Like");
70 | break;
71 | case 2:
72 | textView.setText("Books");
73 | break;
74 | case 3:
75 | textView.setText("GitHub");
76 | break;
77 | }
78 | }
79 | });
80 |
81 | button.setOnClickListener(new View.OnClickListener() {
82 | @Override
83 | public void onClick(View v) {
84 | bottomNavigationView.selectTab(2);
85 | }
86 | });
87 | }
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/java/com/luseen/luseenbottomnavigation/BottomNavigation/BottomNavigationUtils.java:
--------------------------------------------------------------------------------
1 | package com.luseen.luseenbottomnavigation.BottomNavigation;
2 |
3 | import android.animation.ArgbEvaluator;
4 | import android.animation.ValueAnimator;
5 | import android.content.Context;
6 | import android.content.res.Resources;
7 | import android.util.DisplayMetrics;
8 | import android.util.TypedValue;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | class BottomNavigationUtils {
15 |
16 | static void changeImageColorFilter(final ImageView image, int fromColor, int toColor) {
17 | ValueAnimator imageColorChangeAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), fromColor, toColor);
18 | imageColorChangeAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
19 | @Override
20 | public void onAnimationUpdate(ValueAnimator animator) {
21 | image.setColorFilter((Integer) animator.getAnimatedValue());
22 | }
23 | });
24 | imageColorChangeAnimation.setDuration(150);
25 | imageColorChangeAnimation.start();
26 | }
27 |
28 | static void changeViewBackgroundColor(final View view, int fromColor, int toColor) {
29 | ValueAnimator imageColorChangeAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), fromColor, toColor);
30 | imageColorChangeAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
31 | @Override
32 | public void onAnimationUpdate(ValueAnimator animator) {
33 | view.setBackgroundColor((Integer) animator.getAnimatedValue());
34 | }
35 | });
36 | imageColorChangeAnimation.setDuration(150);
37 | imageColorChangeAnimation.start();
38 | }
39 |
40 | static void changeViewTopPadding(final View view, int fromPadding, int toPadding) {
41 | ValueAnimator animator = ValueAnimator.ofFloat(fromPadding, toPadding);
42 | animator.setDuration(150);
43 | animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
44 | @Override
45 | public void onAnimationUpdate(ValueAnimator valueAnimator) {
46 | float animatedValue = (float) valueAnimator.getAnimatedValue();
47 | view.setPadding(view.getPaddingLeft(),
48 | (int) animatedValue,
49 | view.getPaddingRight(),
50 | view.getPaddingBottom());
51 | }
52 | });
53 | animator.start();
54 | }
55 |
56 | static void changeRightPadding(final View view, int fromPadding, int toPadding) {
57 | ValueAnimator animator = ValueAnimator.ofFloat(fromPadding, toPadding);
58 | animator.setDuration(150);
59 | animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
60 | @Override
61 | public void onAnimationUpdate(ValueAnimator valueAnimator) {
62 | float animatedValue = (float) valueAnimator.getAnimatedValue();
63 | view.setPadding(view.getPaddingLeft(),
64 | view.getPaddingTop(),
65 | (int) animatedValue,
66 | view.getPaddingBottom());
67 | }
68 | });
69 | animator.start();
70 | }
71 |
72 | static void changeViewLeftPadding(final View view, int fromMargin, int toMargin) {
73 | ValueAnimator animator = ValueAnimator.ofFloat(fromMargin, toMargin);
74 | animator.setDuration(3000);
75 | animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
76 | @Override
77 | public void onAnimationUpdate(ValueAnimator valueAnimator) {
78 | float animatedValue = (float) valueAnimator.getAnimatedValue();
79 | view.setPadding((int) animatedValue,
80 | view.getPaddingTop(),
81 | view.getPaddingRight(),
82 | view.getPaddingBottom());
83 | view.requestLayout();
84 |
85 | }
86 | });
87 | animator.start();
88 | }
89 |
90 | static void changeTextSize(final TextView textView, float from, float to) {
91 | ValueAnimator textSizeChangeAnimator = ValueAnimator.ofFloat(from, to);
92 | textSizeChangeAnimator.setDuration(150);
93 | textSizeChangeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
94 | @Override
95 | public void onAnimationUpdate(ValueAnimator valueAnimator) {
96 | textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, (float) valueAnimator.getAnimatedValue());
97 | }
98 | });
99 | textSizeChangeAnimator.start();
100 | }
101 |
102 | static void changeTextColor(final TextView textView, int fromColor, int toColor) {
103 | ValueAnimator changeTextColorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), fromColor, toColor);
104 | changeTextColorAnimation.setDuration(150);
105 | changeTextColorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
106 | @Override
107 | public void onAnimationUpdate(ValueAnimator animator) {
108 | textView.setTextColor((Integer) animator.getAnimatedValue());
109 | }
110 | });
111 | changeTextColorAnimation.start();
112 | }
113 |
114 | static int getActionbarSize(Context context) {
115 | int actionbarSize = -1;
116 | TypedValue typedValue = new TypedValue();
117 | if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, typedValue, true)) {
118 | actionbarSize = TypedValue.complexToDimensionPixelSize(typedValue.data, context.getResources().getDisplayMetrics());
119 | }
120 | return actionbarSize;
121 | }
122 |
123 | public static int pxToDp(int px, Context context) {
124 | DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
125 | int dp = Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
126 | return dp;
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Material Bottom Navigation
2 | # DEPRECATED
3 | Use offical [Bottom Navigation](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.html)
4 |
5 | [](https://android-arsenal.com/details/1/3337)
6 |
7 | BottomNavigationView
8 |
9 | Designed according Google [guideLine][1]
10 | [1]: https://www.google.com/design/spec/components/bottom-navigation.html#bottom-navigation-usage
11 | [2]: http://luseen.com/
12 | [3]: http://fir.im/luseen?release_id=56feaea800fc741d61000000
13 | By [Luseen][2] Technologies
14 |
15 | [Download simple apk][3]
16 |
17 |
18 |
19 | 
20 | 
21 |
22 |
23 | Download
24 | --------
25 |
26 | Gradle:
27 | ```groovy
28 | compile 'com.github.armcha:LuseenBottomNavigation:1.8.2'
29 | ```
30 | Maven:
31 | ```xml
32 |
33 | com.github.armcha
34 | LuseenBottomNavigation
35 | 1.8.2
36 | pom
37 |
38 | ```
39 | Usage
40 | -----
41 |
42 | Add the BottomNavigationView to your layout
43 |
44 | ```xml
45 |
50 | ```
51 |
52 | Add BottomNavigation items
53 |
54 | ```java
55 | BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigation);
56 |
57 | BottomNavigationItem bottomNavigationItem = new BottomNavigationItem
58 | ("Record", ContextCompat.getColor(this, R.color.firstColor), R.drawable.ic_mic_black_24dp);
59 | BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem
60 | ("Like", ContextCompat.getColor(this, R.color.secondColor), R.drawable.ic_favorite_black_24dp);
61 | bottomNavigationView.addTab(bottomNavigationItem);
62 | bottomNavigationView.addTab(bottomNavigationItem1);
63 | ```
64 |
65 | Then set your `OnBottomNavigationItemClickListener`
66 |
67 | ```java
68 |
69 | bottomNavigationView.setOnBottomNavigationItemClickListener(new OnBottomNavigationItemClickListener() {
70 | @Override
71 | public void onNavigationItemClick(int index) {
72 | Toast.makeText(MainActivity.this, "Item " +index +" clicked", Toast.LENGTH_SHORT).show();
73 | }
74 | });
75 | ```
76 | If you are using a `ViewPager` , you can connect to the `BottomNavigationView`,
77 | Set color in this way, when using view pager:
78 |
79 | ```java
80 | ContextCompat.getColor(context, R.color.firstColor)
81 | bottomNavigationView.setUpWithViewPager(yourPager , colorResources , imageResources);
82 | ```
83 | You can disable slide animation when using viewPager
84 | ```java
85 | bottomNavigationView.disableViewPagerSlide();
86 | ```
87 |
88 | If your activity/fragment will not recreate and bottom navigation items doubled on orientation change,
89 | just can call this method
90 |
91 | ```java
92 | bottomNavigationView.willNotRecreate(true);
93 | ```
94 |
95 |
96 | Customize
97 | ---------
98 |
99 | Customize with xml
100 |
101 | ```xml
102 |
115 | ```
116 |
117 | or programmatically
118 |
119 |
120 | You can activate tablet mode
121 | ```java
122 | bottomNavigationView.activateTabletMode();
123 | ```
124 | 
125 |
126 | ```java
127 | bottomNavigationView.isWithText(true);
128 | ```
129 | 
130 | ```java
131 | bottomNavigationView.isColoredBackground(false);
132 | bottomNavigationView.setItemActiveColorWithoutColoredBackground(yourColor);
133 | ```
134 | 
135 |
136 | Change text active or inactive size
137 | ```java
138 | bottomNavigationView.setTextActiveSize(float yoursize);
139 | bottomNavigationView.setTextInactiveSize(float yoursize);
140 | ```
141 |
142 | Change tab programmatically
143 | ```java
144 | bottomNavigationView.selectTab(int position);
145 | ```
146 |
147 | You can just disable BottomNavigationView shadow by calling
148 | ```java
149 | bottomNavigationView.disableShadow();
150 | ```
151 |
152 | You can set your custom font for item text.
153 | assets/fonts/your_font.ttf
154 | ```java
155 | bottomNavigationView.setFont(Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/your_font.ttf"));
156 | ```
157 |
158 | ## Contact
159 |
160 | Pull requests are more than welcome.
161 |
162 | Please fell free to contact me if there is any problem when using the library.
163 |
164 | - **email**: armcha01@gmail.com
165 | - **facebook**: https://web.facebook.com/chatikyana
166 | - **website**: http://luseen.com/
167 |
168 | License
169 | --------
170 |
171 |
172 | Copyright 2016 Arman Chatikyan
173 |
174 | Licensed under the Apache License, Version 2.0 (the "License");
175 | you may not use this file except in compliance with the License.
176 | You may obtain a copy of the License at
177 |
178 | http://www.apache.org/licenses/LICENSE-2.0
179 |
180 | Unless required by applicable law or agreed to in writing, software
181 | distributed under the License is distributed on an "AS IS" BASIS,
182 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183 | See the License for the specific language governing permissions and
184 | limitations under the License.
185 |
186 |
--------------------------------------------------------------------------------
/BottomNavigationViewLibrary/src/main/java/com/luseen/luseenbottomnavigation/BottomNavigation/BottomNavigationView.java:
--------------------------------------------------------------------------------
1 | package com.luseen.luseenbottomnavigation.BottomNavigation;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorListenerAdapter;
5 | import android.content.Context;
6 | import android.content.res.Resources;
7 | import android.content.res.TypedArray;
8 | import android.graphics.Typeface;
9 | import android.os.Build;
10 | import android.support.v4.content.ContextCompat;
11 | import android.support.v4.view.ViewPager;
12 | import android.util.AttributeSet;
13 | import android.util.TypedValue;
14 | import android.view.LayoutInflater;
15 | import android.view.View;
16 | import android.view.ViewAnimationUtils;
17 | import android.view.ViewGroup;
18 | import android.widget.FrameLayout;
19 | import android.widget.ImageView;
20 | import android.widget.LinearLayout;
21 | import android.widget.RelativeLayout;
22 | import android.widget.TextView;
23 |
24 | import com.luseen.luseenbottomnavigation.R;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class BottomNavigationView extends RelativeLayout {
30 |
31 | private OnBottomNavigationItemClickListener onBottomNavigationItemClickListener;
32 |
33 | private Context context;
34 |
35 | private final int NAVIGATION_HEIGHT = (int) getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_height);
36 |
37 | private final int NAVIGATION_LINE_WIDTH = (int) getResources().getDimension(R.dimen.bottom_navigation_line_width);
38 |
39 | private float textActiveSize;
40 |
41 | private float textInactiveSize;
42 |
43 | private List bottomNavigationItems = new ArrayList<>();
44 |
45 | private List viewList = new ArrayList<>();
46 |
47 | private int itemActiveColorWithoutColoredBackground = -1;
48 |
49 | private static int currentItem = 0;
50 |
51 | private int navigationWidth;
52 |
53 | private int shadowHeight;
54 |
55 | private int itemInactiveColor;
56 |
57 | private int itemWidth;
58 |
59 | private int itemHeight;
60 |
61 | private boolean withText;
62 |
63 | private boolean coloredBackground;
64 |
65 | private boolean disableShadow;
66 |
67 | private boolean isTablet;
68 |
69 | private boolean viewPagerSlide;
70 |
71 | private boolean isCustomFont = false;
72 |
73 | private boolean willNotRecreate = true;
74 |
75 | private FrameLayout container;
76 |
77 | private View backgroundColorTemp;
78 |
79 | private ViewPager mViewPager;
80 |
81 | private Typeface font;
82 |
83 |
84 | public BottomNavigationView(Context context) {
85 | this(context, null);
86 | }
87 |
88 | public BottomNavigationView(Context context, AttributeSet attrs) {
89 | this(context, attrs, 0);
90 | }
91 |
92 | public BottomNavigationView(Context context, AttributeSet attrs, int defStyleAttr) {
93 | super(context, attrs, defStyleAttr);
94 | this.context = context;
95 | init(attrs);
96 | }
97 |
98 | private void init(AttributeSet attrs) {
99 | if (attrs != null) {
100 | Resources res = getResources();
101 |
102 | TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.BottomNavigationView);
103 | withText = array.getBoolean(R.styleable.BottomNavigationView_bnv_with_text, true);
104 | coloredBackground = array.getBoolean(R.styleable.BottomNavigationView_bnv_colored_background, true);
105 | disableShadow = array.getBoolean(R.styleable.BottomNavigationView_bnv_shadow, false);
106 | isTablet = array.getBoolean(R.styleable.BottomNavigationView_bnv_tablet, false);
107 | viewPagerSlide = array.getBoolean(R.styleable.BottomNavigationView_bnv_viewpager_slide, true);
108 | itemActiveColorWithoutColoredBackground = array.getColor(R.styleable.BottomNavigationView_bnv_active_color, -1);
109 | textActiveSize = array.getDimensionPixelSize(R.styleable.BottomNavigationView_bnv_active_text_size, res.getDimensionPixelSize(R.dimen.bottom_navigation_text_size_active));
110 | textInactiveSize = array.getDimensionPixelSize(R.styleable.BottomNavigationView_bnv_inactive_text_size, res.getDimensionPixelSize(R.dimen.bottom_navigation_text_size_inactive));
111 |
112 | array.recycle();
113 | }
114 | }
115 |
116 | @Override
117 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
118 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
119 |
120 | navigationWidth = BottomNavigationUtils.getActionbarSize(context);
121 | ViewGroup.LayoutParams params = getLayoutParams();
122 | if (coloredBackground) {
123 | itemActiveColorWithoutColoredBackground = ContextCompat.getColor(context, com.luseen.luseenbottomnavigation.R.color.colorActive);
124 | itemInactiveColor = ContextCompat.getColor(context, com.luseen.luseenbottomnavigation.R.color.colorInactive);
125 | shadowHeight = (int) getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_shadow_height);
126 | } else {
127 | if (itemActiveColorWithoutColoredBackground == -1)
128 | itemActiveColorWithoutColoredBackground = ContextCompat.getColor(context, com.luseen.luseenbottomnavigation.R.color.itemActiveColorWithoutColoredBackground);
129 | itemInactiveColor = ContextCompat.getColor(context, com.luseen.luseenbottomnavigation.R.color.withoutColoredBackground);
130 | shadowHeight = (int) getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_shadow_height_without_colored_background);
131 | }
132 | if (isTablet) {
133 | params.width = navigationWidth + NAVIGATION_LINE_WIDTH;
134 | params.height = ViewGroup.LayoutParams.MATCH_PARENT;
135 | } else {
136 | params.width = ViewGroup.LayoutParams.MATCH_PARENT;
137 | params.height = disableShadow ? NAVIGATION_HEIGHT : NAVIGATION_HEIGHT + shadowHeight;
138 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
139 | setElevation(getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_elevation));
140 | }
141 | }
142 | setLayoutParams(params);
143 |
144 |
145 | }
146 |
147 |
148 | @Override
149 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
150 | super.onSizeChanged(w, h, oldw, oldh);
151 |
152 | if (willNotRecreate)
153 | removeAllViews();
154 | if (currentItem < 0 || currentItem > (bottomNavigationItems.size() - 1)) {
155 | throw new IndexOutOfBoundsException(currentItem < 0 ? "Position must be 0 or greater than 0, current is " + currentItem
156 | : "Position must be less or equivalent than items size, items size is " + (bottomNavigationItems.size() - 1) + " current is " + currentItem);
157 | }
158 | if (bottomNavigationItems.size() == 0) {
159 | throw new NullPointerException("You need at least one item");
160 | }
161 | LayoutParams containerParams, params, lineParams;
162 | int white = ContextCompat.getColor(context, com.luseen.luseenbottomnavigation.R.color.white);
163 | backgroundColorTemp = new View(context);
164 | viewList.clear();
165 | if (isTablet) {
166 | itemWidth = LayoutParams.MATCH_PARENT;
167 | itemHeight = navigationWidth;
168 | } else {
169 | itemWidth = getWidth() / bottomNavigationItems.size();
170 | itemHeight = LayoutParams.MATCH_PARENT;
171 | }
172 | container = new FrameLayout(context);
173 | View shadow = new View(context);
174 | View line = new View(context);
175 | LinearLayout items = new LinearLayout(context);
176 | items.setOrientation(isTablet ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL);
177 | LayoutParams shadowParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, shadowHeight);
178 | if (isTablet) {
179 | line.setBackgroundColor(ContextCompat.getColor(context, R.color.colorInactive));
180 | containerParams = new LayoutParams(navigationWidth, ViewGroup.LayoutParams.MATCH_PARENT);
181 | lineParams = new LayoutParams(NAVIGATION_LINE_WIDTH, ViewGroup.LayoutParams.MATCH_PARENT);
182 | lineParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
183 | params = new LayoutParams(navigationWidth, ViewGroup.LayoutParams.MATCH_PARENT);
184 | items.setPadding(0, itemHeight / 2, 0, 0);
185 | addView(line, lineParams);
186 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
187 | LayoutParams backgroundLayoutParams = new LayoutParams(
188 | navigationWidth, ViewGroup.LayoutParams.MATCH_PARENT);
189 | backgroundLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
190 | container.addView(backgroundColorTemp, backgroundLayoutParams);
191 | }
192 | } else {
193 | params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, NAVIGATION_HEIGHT);
194 | containerParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, NAVIGATION_HEIGHT);
195 | shadowParams.addRule(RelativeLayout.ABOVE, container.getId());
196 | shadow.setBackgroundResource(com.luseen.luseenbottomnavigation.R.drawable.shadow);
197 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
198 | LayoutParams backgroundLayoutParams = new LayoutParams(
199 | ViewGroup.LayoutParams.MATCH_PARENT, NAVIGATION_HEIGHT);
200 | backgroundLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
201 | container.addView(backgroundColorTemp, backgroundLayoutParams);
202 | }
203 | }
204 | containerParams.addRule(isTablet ? RelativeLayout.ALIGN_PARENT_LEFT : RelativeLayout.ALIGN_PARENT_BOTTOM);
205 | addView(shadow, shadowParams);
206 | addView(container, containerParams);
207 | container.addView(items, params);
208 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
209 |
210 | for (int i = 0; i < bottomNavigationItems.size(); i++) {
211 | final int index = i;
212 |
213 | if (!coloredBackground)
214 | bottomNavigationItems.get(i).setColor(white);
215 |
216 | int textActivePaddingTop = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_active);
217 | int viewInactivePaddingTop = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_inactive);
218 | int viewInactivePaddingTopWithoutText = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_inactive_without_text);
219 | final View view = inflater.inflate(com.luseen.luseenbottomnavigation.R.layout.bottom_navigation, this, false);
220 | ImageView icon = (ImageView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_icon);
221 | TextView title = (TextView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_title);
222 |
223 | if (isCustomFont)
224 | title.setTypeface(font);
225 |
226 | if (isTablet)
227 | title.setVisibility(GONE);
228 |
229 | title.setTextColor(itemInactiveColor);
230 | viewList.add(view);
231 |
232 | if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
233 | if (i == currentItem)
234 | icon.setImageResource(bottomNavigationItems.get(i).getImageResourceActive());
235 | else
236 | bottomNavigationItems.get(i).getImageResource();
237 | } else {
238 | icon.setImageResource(bottomNavigationItems.get(i).getImageResource());
239 | icon.setColorFilter(i == currentItem ? itemActiveColorWithoutColoredBackground : itemInactiveColor);
240 | }
241 |
242 | if (i == currentItem) {
243 | container.setBackgroundColor(bottomNavigationItems.get(index).getColor());
244 | title.setTextColor(itemActiveColorWithoutColoredBackground);
245 | icon.setScaleX((float) 1.1);
246 | icon.setScaleY((float) 1.1);
247 | }
248 |
249 | if (isTablet)
250 | view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), i == currentItem ? textActivePaddingTop : withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText,
251 | view.getPaddingBottom());
252 | else
253 | view.setPadding(view.getPaddingLeft(), i == currentItem ? textActivePaddingTop : withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText, view.getPaddingRight(),
254 | view.getPaddingBottom());
255 |
256 | title.setTextSize(TypedValue.COMPLEX_UNIT_PX, i == currentItem ?
257 | textActiveSize :
258 | withText ? textInactiveSize : 0);
259 | title.setText(bottomNavigationItems.get(i).getTitle());
260 | LayoutParams itemParams = new LayoutParams(itemWidth, itemHeight);
261 | items.addView(view, itemParams);
262 | view.setOnClickListener(new OnClickListener() {
263 | @Override
264 | public void onClick(View v) {
265 | onBottomNavigationItemClick(index);
266 | }
267 | });
268 |
269 | }
270 | }
271 |
272 | private void onBottomNavigationItemClick(final int itemIndex) {
273 |
274 | if (currentItem == itemIndex) {
275 | return;
276 | }
277 |
278 | int viewActivePaddingTop = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_active);
279 | int viewInactivePaddingTop = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_inactive);
280 | int viewInactivePaddingTopWithoutText = (int) context.getResources().getDimension(com.luseen.luseenbottomnavigation.R.dimen.bottom_navigation_padding_top_inactive_without_text);
281 | int centerX;
282 | int centerY;
283 | for (int i = 0; i < viewList.size(); i++) {
284 | if (i == itemIndex) {
285 | View view = viewList.get(itemIndex).findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_container);
286 | final TextView title = (TextView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_title);
287 | final ImageView icon = (ImageView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_icon);
288 | BottomNavigationUtils.changeTextColor(title, itemInactiveColor, itemActiveColorWithoutColoredBackground);
289 | BottomNavigationUtils.changeTextSize(title, withText ? textInactiveSize : 0, textActiveSize);
290 |
291 | if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
292 | icon.setImageResource((bottomNavigationItems.get(i).getImageResourceActive()));
293 | } else {
294 | BottomNavigationUtils.changeImageColorFilter(icon, itemInactiveColor, itemActiveColorWithoutColoredBackground);
295 | }
296 |
297 | if (isTablet)
298 | BottomNavigationUtils.changeRightPadding(view, withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText, viewActivePaddingTop);
299 | else {
300 | BottomNavigationUtils.changeViewTopPadding(view, withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText, viewActivePaddingTop);
301 | }
302 |
303 | icon.animate()
304 | .setDuration(150)
305 | .scaleX((float) 1.1)
306 | .scaleY((float) 1.1)
307 | .start();
308 |
309 | if (isTablet) {
310 | centerX = viewList.get(itemIndex).getWidth() / 2;
311 | centerY = (int) viewList.get(itemIndex).getY() + viewList.get(itemIndex).getHeight() / 2;
312 | } else {
313 | centerX = (int) viewList.get(itemIndex).getX() + viewList.get(itemIndex).getWidth() / 2;
314 | centerY = viewList.get(itemIndex).getHeight() / 2;
315 | }
316 |
317 | int finalRadius = Math.max(getWidth(), getHeight());
318 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
319 | backgroundColorTemp.setBackgroundColor(bottomNavigationItems.get(itemIndex).getColor());
320 | Animator changeBackgroundColor = ViewAnimationUtils.createCircularReveal(backgroundColorTemp, centerX, centerY, 0, finalRadius);
321 | changeBackgroundColor.addListener(new AnimatorListenerAdapter() {
322 | @Override
323 | public void onAnimationEnd(Animator animation) {
324 | super.onAnimationEnd(animation);
325 | container.setBackgroundColor(bottomNavigationItems.get(itemIndex).getColor());
326 | }
327 | });
328 | changeBackgroundColor.start();
329 | } else {
330 | BottomNavigationUtils.changeViewBackgroundColor
331 | (container, bottomNavigationItems.get(currentItem).getColor(), bottomNavigationItems.get(itemIndex).getColor());
332 | }
333 |
334 | } else if (i == currentItem) {
335 | View view = viewList.get(i).findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_container);
336 | final TextView title = (TextView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_title);
337 | final ImageView icon = (ImageView) view.findViewById(com.luseen.luseenbottomnavigation.R.id.bottom_navigation_item_icon);
338 |
339 | if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
340 | icon.setImageResource((bottomNavigationItems.get(i).getImageResource()));
341 | } else {
342 | BottomNavigationUtils.changeImageColorFilter(icon, itemActiveColorWithoutColoredBackground, itemInactiveColor);
343 | }
344 |
345 | BottomNavigationUtils.changeTextColor(title, itemActiveColorWithoutColoredBackground, itemInactiveColor);
346 | BottomNavigationUtils.changeTextSize(title, textActiveSize, withText ? textInactiveSize : 0);
347 |
348 | if (isTablet)
349 | BottomNavigationUtils.changeRightPadding(view, viewActivePaddingTop, withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText);
350 | else
351 | BottomNavigationUtils.changeViewTopPadding(view, viewActivePaddingTop, withText ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText);
352 |
353 | icon.animate()
354 | .setDuration(150)
355 | .scaleX((float) 0.9)
356 | .scaleY((float) 0.9)
357 | .start();
358 | }
359 | }
360 |
361 | if (mViewPager != null)
362 | mViewPager.setCurrentItem(itemIndex, viewPagerSlide);
363 |
364 | if (onBottomNavigationItemClickListener != null)
365 | onBottomNavigationItemClickListener.onNavigationItemClick(itemIndex);
366 | currentItem = itemIndex;
367 | }
368 |
369 | /**
370 | * Creates a connection between this navigation view and a ViewPager
371 | *
372 | * @param pager pager to connect to
373 | * @param colorResources color resources for every item in the ViewPager adapter
374 | * @param imageResources images resources for every item in the ViewPager adapter
375 | */
376 |
377 | public void setUpWithViewPager(ViewPager pager, int[] colorResources, int[] imageResources) {
378 | this.mViewPager = pager;
379 | if (pager.getAdapter().getCount() != colorResources.length || pager.getAdapter().getCount() != imageResources.length)
380 | throw new IllegalArgumentException("colorResources and imageResources must be equal to the ViewPager items : " + pager.getAdapter().getCount());
381 |
382 | for (int i = 0; i < pager.getAdapter().getCount(); i++)
383 | addTab(new BottomNavigationItem(pager.getAdapter().getPageTitle(i).toString(), colorResources[i], imageResources[i]));
384 | }
385 |
386 | /**
387 | * Add item for BottomNavigation
388 | *
389 | * @param item item to add
390 | */
391 | public void addTab(BottomNavigationItem item) {
392 | bottomNavigationItems.add(item);
393 | }
394 |
395 | /**
396 | * Activate BottomNavigation tablet mode
397 | */
398 | public void activateTabletMode() {
399 | isTablet = true;
400 | }
401 |
402 | /**
403 | * Change text visibility
404 | *
405 | * @param withText disable or enable item text
406 | */
407 | public void isWithText(boolean withText) {
408 | this.withText = withText;
409 | }
410 |
411 | /**
412 | * Item Active Color if isColoredBackground(false)
413 | *
414 | * @param itemActiveColorWithoutColoredBackground active item color
415 | */
416 | public void setItemActiveColorWithoutColoredBackground(int itemActiveColorWithoutColoredBackground) {
417 | this.itemActiveColorWithoutColoredBackground = itemActiveColorWithoutColoredBackground;
418 | }
419 |
420 | /**
421 | * With this BottomNavigation background will be white
422 | *
423 | * @param coloredBackground disable or enable background color
424 | */
425 | public void isColoredBackground(boolean coloredBackground) {
426 | this.coloredBackground = coloredBackground;
427 | }
428 |
429 | /**
430 | * Change tab programmatically
431 | *
432 | * @param position selected tab position
433 | */
434 | public void selectTab(int position) {
435 | onBottomNavigationItemClick(position);
436 | currentItem = position;
437 | }
438 |
439 | /**
440 | * Disable shadow of BottomNavigationView
441 | */
442 | public void disableShadow() {
443 | disableShadow = true;
444 | }
445 |
446 | /**
447 | * Disable slide animation when using ViewPager
448 | */
449 | public void disableViewPagerSlide() {
450 | viewPagerSlide = false;
451 | }
452 |
453 | /**
454 | * Change Active text size
455 | *
456 | * @param textActiveSize size
457 | */
458 | public void setTextActiveSize(float textActiveSize) {
459 | this.textActiveSize = textActiveSize;
460 | }
461 |
462 | /**
463 | * Change Inactive text size
464 | *
465 | * @param textInactiveSize size
466 | */
467 | public void setTextInactiveSize(float textInactiveSize) {
468 | this.textInactiveSize = textInactiveSize;
469 | }
470 |
471 | /**
472 | * Setup interface for item onClick
473 | */
474 | public void setOnBottomNavigationItemClickListener(OnBottomNavigationItemClickListener onBottomNavigationItemClickListener) {
475 | this.onBottomNavigationItemClickListener = onBottomNavigationItemClickListener;
476 | }
477 |
478 | /**
479 | * Returns the item that is currently selected
480 | *
481 | * @return Currently selected item
482 | */
483 | public int getCurrentItem() {
484 | return currentItem;
485 | }
486 |
487 | /**
488 | * If your activity/fragment will not recreate
489 | * you can call this method
490 | *
491 | * @param willNotRecreate set true if will not recreate
492 | */
493 | public void willNotRecreate(boolean willNotRecreate) {
494 | this.willNotRecreate = willNotRecreate;
495 | }
496 |
497 | /**
498 | * set custom font for item texts
499 | *
500 | * @param font custom font
501 | */
502 | public void setFont(Typeface font) {
503 | isCustomFont = true;
504 | this.font = font;
505 | }
506 |
507 | /**
508 | * get item text size on active status
509 | *
510 | * @return font size
511 | */
512 | public float getTextActiveSize() {
513 | return textActiveSize;
514 | }
515 |
516 | /**
517 | * get item text size on inactive status
518 | *
519 | * @return font size
520 | */
521 | public float getTextInactiveSize() {
522 | return textInactiveSize;
523 | }
524 |
525 |
526 | public BottomNavigationItem getItem(int position) {
527 | onBottomNavigationItemClick(position);
528 | return bottomNavigationItems.get(position);
529 | }
530 | }
531 |
--------------------------------------------------------------------------------