Giter Club home page Giter Club logo

micbottombar's Introduction

MICBottomBar

传统国产 App 底栏

用 Kotlin 写的,功能简单,没什么技术含量,只是最近正在尝试 Kotlin 所以写着玩儿的

能干嘛

  • 定义图标大小 (如果图标不是正方形,则以宽为准进行等比缩放)
  • 定义选中图标和未选中图标
  • 定义字体大小
  • 定义字体选中颜色和未选中颜色
  • 定义底栏上下内边距
  • 底栏高度是自适应的,定义了也没用

属性

属性 描述
bb_icon_size 图标大小 (默认 24dp)
bb_text_size 字体大小 (默认 12sp)
bb_select_text_color 选中的字体颜色 (默认 #FF222222)
bb_text_color 未选中的字体颜色 (默认使用 #60选中的字体颜色)
bb_padding 底栏上下内边距 (默认 5dp)
bb_current_position 选中的 item 下标, 从 0 开始 (默认 0)

使用

Layout

<moe.yukinoneko.micbottombar.MICBottomBar
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/white" />

Kotlin

bottomBar.addNavigationItems(
        MICBottomBar.NavigationItem(unSelectIconId, selectIconId, title),
        MICBottomBar.NavigationItem(unSelectIconId, selectIconId, title),
        MICBottomBar.NavigationItem(unSelectIconId, selectIconId, title)
)

bottomBar.setOnNavigationItemClickListener(object : MICBottomBar.OnNavigationItemClickListener {
    override fun onItemClick(view: View, position: Int) {

    }
})

License

Copyright 2017 SamuelGjk. https://github.com/SamuelGjk

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.

micbottombar's People

Contributors

samuelgjk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.