GithubHelp home page GithubHelp logo

blueflychief / alphatabsindicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yinglannull/alphatabsindicator

0.0 2.0 0.0 4.61 MB

高仿微信底部状态栏的轻量级库,没有MagicIndicator那么臃肿,符合大多数BottomTab应用需求

Java 100.00%

alphatabsindicator's Introduction

AlphaTabsIndicator

高仿微信底部状态栏的轻量级库

Abstract 摘要

仿微信底部tab标签,滑动的时候颜色渐变,增加角标功能, 使用极其简单,只需要两行代码。

Gif 动画

1

Screenshot 截图

1 2 3 4

Demo 下载APK体验

Download Demo

Usage 使用方法

Step 1

Gradle 配置

dependencies {
    compile 'com.yinglan.alphatabs:library:1.0.2'
}

Step 2

In Layout

	        <com.yinglan.alphatabs.AlphaTabsIndicator
                android:id="@+id/alphaIndicator"
                android:layout_width="match_parent"
                android:layout_height="55dp"
                android:orientation="horizontal">

                <com.yinglan.alphatabs.AlphaTabView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:padding="5dp"

                    app:tabIconNormal=""
                    app:tabIconSelected=""
                    app:tabText=""
                    app:tabTextSize=""
                    app:textColorNormal=""
                    app:textColorSelected=""
                    app:badgeBackgroundColor=""/>

                <com.yinglan.alphatabs.AlphaTabView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:padding="5dp"

                    app:tabIconNormal=""
                    app:tabIconSelected=""
                    app:tabText=""
                    app:tabTextSize=""
                    app:textColorNormal=""
                    app:textColorSelected=""
                    app:badgeBackgroundColor=""/>

                    、、、、
                    、、、、

            </com.yinglan.alphatabs.AlphaTabsIndicator>                                //模式

功能与参数定义

配置参数 参数含义
tabIconNormal 未选中的图标
tabIconSelected 已经选中的图标
tabText tab标签的文字
tabTextSize tab标签的文字大小
textColorNormal 未选中的文字颜色
textColorSelected 已选中的文字颜色
badgeBackgroundColor 角标背景色,默认红色

In Code

#####AlphaTabView 主要方法

        mAlphaTabView.showNumber(int i); //显示数子角标
        mAlphaTabView.showPoint();       //显示小红点
        mAlphaTabView.removeShow();      //移除角标

#####AlphaTabsIndicator 主要方法

        mAlphaTabsIndicator.setViewPager(ViewPager mViewPger);                     //设置ViewPager
        mAlphaTabsIndicator.setOnTabChangedListner(OnTabChangedListner listner);   //设置底部tab点击监听
        mAlphaTabsIndicator.removeAllBadge();                                      //移除所有tab的角标

####Instructions - 说明 本库是在征得jeasonlzy的许可后,在其AlphaIndicatorView基础上做的易用性改进,感谢,现持续开源。 ##改进项主要有:

  1. 增加角标,使其更接近微信底部tab;
  2. 对角标的大小进行动态控制,会根据tab高度自适应;
  3. 对使用要求限制适当降低,可以在不绑定viewpager的情况下使用。
  4. 增加点击tab的监听回调。
  5. 增加在代码mViewPager.setCurrentItem(i)控制状态下tab联动。

alphatabsindicator's People

Contributors

yinglannull 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.