Giter Site home page Giter Site logo

wechatbottomnavigation's Introduction

WeChatBottomNavigation

高仿微信底部导航栏动画,几乎一毛一样。

动画演示

动画演示

如何使用

布局添加TabView

        <com.uni.wechatbottomnavigation.view.TabView
            android:id="@+id/tab_profile"
            bxll:tabImage="@mipmap/profile_normal"
            bxll:tabColor="#FF11E53F"
            bxll:tabSelectedImage="@mipmap/profile_pressed"
            bxll:tabTitle=""
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

tabImage属性代表默认显示的图片

tabSelectedImage属性代表选中时的图片

tabColor属性代表颜色变换的最终颜色

tabTitle代表标题

Activity中控制进度

        mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
                // 左边TabView进行动画
                mTabViews.get(position).setXPercentage(1 - positionOffset);
                // 右边TabView进行动画
                if (positionOffset > 0) {
                    mTabViews.get(position + 1).setXPercentage(positionOffset);
                }
            }
        });

ViewPager监听滑动事件,向TabView传入一个进度值,从而控制TabView的动画

联系我

  1. blog: https://juejin.im/post/5d5365876fb9a06b130f1aa6
  2. QQ Email: [email protected]
  3. Gmail: [email protected]

wechatbottomnavigation's People

Contributors

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