GithubHelp home page GithubHelp logo

navbar's Introduction

#底部导航

简介

为了实现快速开发以及频繁的需求变更,为此而封装一个扩展性高的底部导航控件。

应用截图

gif

简单用例

####1、在 build.gradle 中添加依赖

dependencies {
    ...
    implementation 'com.fen.origin:navbarlib:1.0.0'
}

####2、xml的使用

 <com.zft.navbarlib.FtTabLayout
        android:id="@+id/tab1"
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:background="#ffffff"
        android:orientation="horizontal">

        <com.zft.navbarlib.FtTab
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:tab_img_height="30dp"
            app:tab_img_src="@drawable/home"
            app:tab_name="首页"
            app:tab_text_color="@drawable/home_text"
            app:tab_text_size="12sp" />

        <com.zft.navbarlib.FtTab
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            app:tab_img_height="30dp"
            app:tab_anim_type="trans"
            app:tab_img_src="@drawable/chat"
            app:tab_name="咨询"
            app:tab_text_color="@drawable/home_text"
            app:tab_text_size="12sp" />
</com.zft.navbarlib.FtTabLayout>

####3、Java代码中的使用

          FtTabLayout  mTab1 = (FtTabLayout) findViewById(R.id.tab1);
          mTab1.setOnSelectedChangeListener(new FtTabLayout.OnSelectedChangeListener() {
                 @Override
                 public void onSelectedChange(View view, int index) {
          //                选择tab时触发该回调
                      }
                 });
          mTab1.setOnAgainClickListener(new FtTabLayout.OnAgainClickListener() {
                 @Override
                 public void onAgainClicked(View view, int index) {
          //                再次点击已选择的tab时触发该回调
                      }
                  });
;

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.