Coder Social home page Coder Social logo

yinglannull / alphatabsindicator Goto Github PK

View Code? Open in Web Editor NEW
1.1K 23.0 222.0 4.61 MB

高仿微信底部状态栏的轻量级库,非MagicIndicator那么功能庞大,简化功能符合大多数BottomTabBar应用设计需求, Lightweight Library of high imitation WeChat bottom status bar

Java 100.00%
wechat bottombar indicator

alphatabsindicator's Introduction

AlphaTabsIndicator

High imitation microblogging at the bottom of the status bar of the lightweight library for most of the bottom status bar application requirements.

Abstract

Imitation WeChat at the bottom of the tab label, slide the color gradient, increase the angle mark function, the use of extremely simple, only two lines of code.

Chinese Documents

查看中文文档

Gif

1

Screenshot

1 2 3 4

Demo

Download Demo

Usage

Step 1

Gradle

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

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=""
                    app:paddingTexwithIcon=""/>

                <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=""
                    app:paddingTexwithIcon=""/>

                    、、、、
                    、、、、

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

Function and parameter definition

Parameters Meaning
tabIconNormal Unselected icon
tabIconSelected Already selected icon
tabText Tab tag text
tabTextSize Tab The size of the label
textColorNormal Unchecked text color
textColorSelected Selected text color
badgeBackgroundColor Corner background color, default red
paddingTexwithIcon The distance between the icon and text

In Code

AlphaTabView Main Method
        mAlphaTabView.showNumber(int i); //Display digital remind
        mAlphaTabView.showPoint();       //Show little red dot
        mAlphaTabView.removeShow();      //Remove the digital remind
AlphaTabsIndicator Main Method
        mAlphaTabsIndicator.setViewPager(ViewPager mViewPger);                     //Set ViewPager
        mAlphaTabsIndicator.setOnTabChangedListner(OnTabChangedListner listner);   //Settings TAB at the bottom click to monitor
        mAlphaTabsIndicator.removeAllBadge();                                      //Remove all remind the TAB
        mAlphaTabsIndicator.setTabCurrenItem(int tabIndex);                        //Settings TAB option

Instructions

The library is in the permission of the Mr jeasonlzy permission,on the basis of his AlphaIndicatorView do usability improvements, thank you, now continue to open source.

The main improvement:

  1. Increase the Angle of standard, make it more close to WeChat TAB at the bottom;
  2. The diagonal mark size for dynamic control, adaptive according to the height of the TAB;
  3. Limit the appropriate to reduce to use requirement, can be used in the case of not binding viewpager;
  4. When without binding ViewPager Settings TAB option;
  5. The distance between the icon and text can be configured, the default is 5;
  6. Increase click on the TAB to monitor the callback;
  7. Increase in code mViewPager. SetCurrentItem (i) TAB linkage control condition;
  8. Repair is not set in a state of not click Tab.

alphatabsindicator's People

Contributors

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

Watchers

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

alphatabsindicator's Issues

java.lang.IllegalArgumentException

MainActivity launchMode="singleTask",按home键app去后台,然后开几个耗内存的应用,这时候列表页面会被回收,触发onSaveInstanceState方法,然后再点击app,切回前台,又进入列表页的onRestoreInstanceState方法,就会触发这个bug。

wechatimg106

相邻tab销毁问题

我发现滑动过程中,如果滑到第3个tab,再滑到第一个tab,则第一个tab会重新创建,这时候fragment里的所有内容会重新加载,请问可以定制不重新加载吗?

Fragment的生命周期

点击底部的tab或者滑动,每个Fragment的生命周期都会重新调用,这样很消耗性能和资源。本人小白一枚

java.lang.NullPointerException bug

Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object
java.util.List.get(int)' on a null object reference
at com.yinglan.alphatabs.AlphaTabsIndicator.onRestoreInstanceState(AlphaTabsIndicator.java:202)
at android.view.View.dispatchRestoreInstanceState(View.java:15781) # @yingLanNull

点击效果不起作用

我把项目集成到我的应用里,没有点击效果
通过compile 'com.yinglan.alphatabs:library:1.0.2'集成的

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.