Giter Site home page Giter Site logo

android-tabindicator's Introduction

TabIndicator for Android

English 中文

Tab Indicator is a powerful bottom navigation widget, It provides some configuration options and good control the appearance and operational requirements.

simple example
TabIndicator Simple Demo

Page navigation example
TabIndicator Simple Demo

Enhanced Page navigation example
TabIndicator Simple Demo

Using TabIndicator in your application

If you are building with Gradle, simply add the following line to the dependencies section of your build.gradle file:

	compile 'com.kevin:tabindicator:1.0.2'

Simple Usage

Configured as View in layout.xml

To add the LoopView to your application, specify com.kevin.tabindicator.TabIndicator in your layout XML.

<com.kevin.tabindicator.TabIndicator
    android:id="@+id/tab_indicator_act_ti"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:background="@drawable/tabbg"
    kevin:tabSelectedColor="#3F51B5"
    kevin:tabSelectedIcons="@array/qq_selected_icon"
    kevin:tabTextSize="12sp"
    kevin:tabUnselectedColor="#555555"
    kevin:tabUnselectedIcons="@array/qq_normal_icon" />

Configured Programmatically

TabIndicator mTabIndicator = (TabIndicator) this.findViewById(R.id.tab_indicator_act_ti);
mTabIndicator.setOnTabSelectedListener(new TabPageIndicatorEx.OnTabSelectedListener() {

    @Override
    public void onTabSelected(int index) {
        mTextView.setText("Page"+(index+1));
        }
    });

More configuration Usage

XML Usage

If you decide to use TabIndicator as a view, you can define it in your xml layout like this:

<declare-styleable name="TabIndicator">
    <!-- Icon array, application in a single icon gradient -->
    <attr name="tabIcons" format="reference" />
    <!-- Selected icon array -->
    <attr name="tabSelectedIcons" format="reference" />
    <!-- unselected icon array -->
    <attr name="tabUnselectedIcons" format="reference" />
    <!-- Text array -->
    <attr name="tabLabels" format="reference" />
    <!-- Selected color -->
    <attr name="tabSelectedColor" format="reference|color" />
    <!-- unselected color -->
    <attr name="tabUnselectedColor" format="reference|color" />
    <!-- Text font size -->
    <attr name="tabTextSize" format="dimension" />
    <!-- The item padding -->
    <attr name="tabItemPadding" format="dimension" />
    <!-- Whether the gradient switch -->
    <attr name="tabGradualChange" format="boolean" />
    <!-- Indicator size -->
    <attr name="TabIndicatorSize" format="dimension" />
</declare-styleable>

Programme Usage

// set ViewPager
mTabPageIndicatorEx.setViewPager(mViewPager);
// Setting specifies the position indicator to show whether or not the point
mTabPageIndicatorEx.setIndicateDisplay(2, true);
// Monitor switch settings
mTabPageIndicatorEx.setOnTabSelectedListener(new TabPageIndicatorEx.OnTabSelectedListener() {

    @Override
    public void onTabSelected(int index) {
            mViewPager.setCurrentItem(index, false);
    }
});

License

Copyright 2015 Kevin zhou

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.

android-tabindicator's People

Contributors

wenkaizhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

android-tabindicator's Issues

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.