• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gwoodhouse/BottomNavigation: Android Material Design "BottomNavigation&quot ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

gwoodhouse/BottomNavigation

开源软件地址(OpenSource Url):

https://github.com/gwoodhouse/BottomNavigation

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Bottom Navigation

An implementation of the "Bottom Navigation" component from Google Material Design spec.

Please look here to view the full component specification.

This library does not implement the "Left Navigation" as per the Tablet specification.

This library does not implement text/icon tinting as of yet.

Default usage

To be placed as the final View in a CoordinatorLayout:

<ca.gcastle.bottomnavigation.view.BottomNavigationView
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_height="56dp"
    android:layout_gravity="bottom"
    app:layout_behavior="ca.gcastle.bottomnavigation.behaviour.BottomNavigationBehavior">

    <ca.gcastle.bottomnavigation.view.BottomNavigationTabView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/tab1"
        app:tabImage="@drawable/ic_home_white_24dp"
        app:tabText="tab1"
        app:tabColor="@color/colorPrimary"/>

    <ca.gcastle.bottomnavigation.view.BottomNavigationTabView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/tab2"
        app:tabImage="@drawable/ic_search_white_24dp"
        app:tabText="tab2"
        app:tabColor="@color/colorAccent"/>

    <ca.gcastle.bottomnavigation.view.BottomNavigationTabView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/tab3"
        app:tabImage="@drawable/ic_help_white_24dp"
        app:tabText="tab3"
        app:tabColor="#00BCD4"/>

</ca.gcastle.bottomnavigation.view.BottomNavigationView>

The above implementation gives the following behaviour:

Optional parameters

BottomNavigationView

[Optional]

app:navGrowTabs="false"

If you don't want the tabs to grow when selected use "false". Either "true" or "false, defaults to true.

app:navGrowthModifier="32dp"

The amount a tab grows when selected. Default value is 64dp. Is ignored if navGrowTabs is set to false.

app:navShowCircleReveal="false"

Decide if you want a circular reveal effect on the background colour, or whether to simply switch colours.

BottomNavigationTabView

Required

app:tabImage="@drawable/icon1"

The drawable to display for this tab

app:tabText="@string/tab1"

The text to display for this tab.

app:tabColor="#0000FF

The colour background for this tab - used by BottonNavigationView in it's circular reveal

[Optional]

app:alwaysShowText="true"

Ensure text is always visible. Defaults to false.

app:unselectedAlpha="0.2"

Customise the opacity of unselected items. Between 0 and 1. Defaults to 0.8

How to use

Maven

<dependency>
  <groupId>ca.gcastle</groupId>
  <artifactId>BottomNavigation</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Gradle

compile 'ca.gcastle:BottomNavigation:1.0.0'

Ivy

<dependency org='ca.gcastle' name='BottomNavigation' rev='1.0.0'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>

Thanks

Thanks go to:

  • Adam McNeilly for his sample application - View his other contributions to the open source community here: http://adammcneilly.com/100days/
  • Eric Cugota for his documentation on how to publish a library to jcenter which is available here
  • The members of Android/room-15 on StackOverflow for their support critiquing code and offering support.

License

My work is distributed under the Apache License.

Bottom Navigation library for Android
Copyright (c) 2016 Graeme Castle (https://github.com/gwoodhouse/BottomNavigation).

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.

This library uses modified source for the Coordinator Layout Behaviour from Nikola Despotoski

BottomNavigationLayout library for Android
Copyright (c) 2016. Nikola Despotoski (http://github.com/NikolaDespotoski).
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.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap