Coder Social home page Coder Social logo

yippeeapp / foldingtabbar.android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tosslife/foldingtabbar.android

0.0 3.0 0.0 2.16 MB

folding tabbar menu for Android. This is a menu library.You can easily add a nice animated tab menu to your app.

Home Page: https://github.com/tosslife

License: MIT License

Java 100.00%

foldingtabbar.android's Introduction

FoldingTabBar.Android

folding tabbar menu for Android. This is a menu library.You can easily add a nice animated tab menu to your app.

Inspired by this project on Dribbble

Simple Apk

Apk Download

Screenshot

screenshot

How to use (参考MainActivity)

Maven

        <dependency>
            <groupId>com.github.tosslife</groupId>
            <artifactId>foldingtabbar</artifactId>
            <version>1.0.0</version>
            <type>aar</type>
        </dependency>

Gradle

add in build.gradle:

        //Wait bintray audit ...
        compile 'com.github.tosslife:foldingtabbar:1.0.0'

Xml

After adding the gradle dependencies from above you can go to your xml layout and add the following code for a TabBarView:

         <com.srx.widget.TabBarView
            android:id="@+id/tabBarView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" />

Java

To set some basic settings use the following java-code:

       //获取TabBarView
       TabBarView tabBarView = (TabBarView) findViewById(R.id.tabBarView);

       //设置主按钮图标
       tabBarView.setMainBitmap(R.drawable.icon_main);

       //设置菜单对应位置按钮图标及两侧图标
       tabBarView.bindBtnsForPage(0, R.drawable.icon_menu, R.drawable.icon_left, R.drawable.icon_right);

       //设置初始默认选中
       tabBarView.initializePage(0);

       //添加监听
        tabBarView.setOnTabBarClickListener(onTabBarClickListener);

       //监听回调
       private OnTabBarClickListener onTabBarClickListener = new OnTabBarClickListener() {

               @Override
               public void onMainBtnsClick(int position, int[] clickLocation) {
                    //点击菜单
               }

               @Override
               public void onMainBtnsClick(int position) {
                    //点击菜单
               }

               @Override
               public void onLeftBtnClick(int page) {
                    //点击对应菜单的左侧按钮
               }

               @Override
               public void onRightBtnClick(int page) {
                    //点击对应菜单的右侧按钮
               }

           };


       //

foldingtabbar.android's People

Contributors

tosslife avatar

Watchers

Chew Chit Siang avatar James Cloos 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.