# LuseenBottomNavigation **Repository Path**: ts_ohos/LuseenBottomNavigation ## Basic Information - **Project Name**: LuseenBottomNavigation - **Description**: 底部导航栏的基本设置。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-19 - **Last Updated**: 2024-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Material Bottom Navigation 本项目是基于开源项目LuseenBottomNavigation进行harmonyos化的移植和开发的,可以通过项目标签以及 [github地址](https://github.com/armcha/LuseenBottomNavigation) 移植版本:源master1.8.2版本 ## 项目介绍 ### 项目名称:LuseenBottomNavigation ### 所属系列:harmonyos的第三方组件适配移植 ### 功能: 底部导航栏的基本设置。 ### 项目移植状态:完全移植 ### 调用差异:基本没有使用差异,请参照demo使用 ### 原项目Doc地址:https://github.com/armcha/LuseenBottomNavigation ### 编程语言:java ### 项目截图(涉及文件仅供demo测试使用) ![image初始界面](art/art.png) ![demo效果](art/demo.gif) ## 安装教程 #### 方案一 可以先下载项目,将项目中的BottomNavigationViewLibrary库提取出来放在所需项目中通过build配置 ```Java dependencies { implementation project(":BottomNavigationViewLibrary") } ``` #### 方案二 - 1.项目根目录的build.gradle中的repositories添加: ```groovy buildscript { repositories { ... mavenCentral() } ... } allprojects { repositories { ... mavenCentral() } } ``` - 2.开发者在自己的项目中添加依赖 ```groovy dependencies { implementation 'com.gitee.ts_ohos:bottomNavigationView:1.0.0' } ``` # How to use Add the BottomNavigationView to your layout ```xml ``` Add BottomNavigation items ```java BottomNavigationView bottomNavigationView = (BottomNavigationView) findComponentById(ResourceTable.Id_bottomNavigation); BottomNavigationItem bottomNavigationItem = new BottomNavigationItem ("Record", color[0], image[0]); BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem ("Like", color[1], image[1]); bottomNavigationView.addTab(bottomNavigationItem); bottomNavigationView.addTab(bottomNavigationItem1); ``` Then set your `OnBottomNavigationItemClickListener` ```java bottomNavigationView.setOnBottomNavigationItemClickListener(new OnBottomNavigationItemClickListener() { @Override public void onNavigationItemClick(int index) { switch (index) { case 0: textView.setText("Record"); break; case 1: textView.setText("Like"); break; case 2: textView.setText("Books"); break; case 3: textView.setText("GitHub"); break; } } }); ``` Customize --------- programmatically You can set the text display style ```java bottomNavigationView.isWithText(true); ``` Change text active or inactive size ```java bottomNavigationView.setTextActiveSize(float yoursize); bottomNavigationView.setTextInactiveSize(float yoursize); ``` Change tab programmatically ```java bottomNavigationView.selectTab(int position); ``` You can just disable BottomNavigationView shadow by calling ```java bottomNavigationView.disableShadow(); ``` License -------- Copyright 2016 Arman Chatikyan 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.