[
  {
    "path": ".gitignore",
    "content": ".gradle\n/local.properties\nbuild\n.idea\n*.iml\n.DS_Store\n"
  },
  {
    "path": "CHNAGELOG.md",
    "content": "#Change Log\nVersion 1.1.2 *(2015-10-14)*\n----------------------------\n* add method setViewPager(ViewPager vp, String[] titles)  for the condition that you do not want set titles in page adapter \n\nVersion 1.1.4 *(2015-10-16)*\n----------------------------\n* fix bug: indicator not show if you do not call viewpager's setCurrentItem method during initialization.\n\nVersion 1.1.6 *(2015-10-18)*\n----------------------------\n* add method setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList<Fragment> fragments)\n  for the condition that you even do not want to instantiate page adapter by yourself\n* add listener OnTabSelectedListener\n\nVersion 1.1.8 *(2015-10-19)*\n----------------------------\n* add block indicator\n\nVersion 1.2.0 *(2015-10-20)*\n----------------------------\n* add unread msg dot (TipView)\n\nVersion 1.3.0 *(2015-10-22)*\n----------------------------\n* new added View: CommonTabLayout is a tablayout without dependence of ViewPager\n\nVersion 1.3.2 *(2015-10-28)*\n----------------------------\n* extract common attributes\n\nVersion 1.3.4 *(2015-11-5)*\n----------------------------\n* replace TipView with RoundTextView\n\nVersion 1.3.6 *(2015-11-10)*\n----------------------------\n* new add attr tl_indicator_width_equal_title\n\nVersion 1.4.0 *(2015-11-11)*\n----------------------------\n* fix bug: attr tl_indicator_width_equal_title sometime invalid\n\nVersion 1.4.2 *(2015-12-9)*\n----------------------------\n* new added tablayout\n\nVersion 1.4.4 *(2015-12-11)*\n----------------------------\n* fix bug: CommonTabLayout first setCurrentTab() cause indicator not show\n\nVersion 1.4.6 *(2015-12-11)*\n----------------------------\n* fix bug: CommonTabLayout first setCurrentTab() cause indicator not show\n\nVersion 1.5.0 *(2015-12-11)*\n----------------------------\n* change code style\n\nVersion 2.0.0 *(2016.3.1)*\n----------------------------\n* remove the dependence of FlycoRoundView\n* new added method getIconView and getTitleView\n\nVersion 2.0.2 *(2016.4.23)*\n----------------------------\n* remove the dependence of NineOldAnimation(only support 3.0+)\n\nVersion 2.0.6 *(2016.5.21)*\n----------------------------\n* remove CustomTabProvider in SlidingTabLayout\n* new added method 'addNewTab(String title)' for SlidingTabLayout\n\nVersion 2.0.8 *(2016.7.26)*\n---------------------------\n* Fix #27，#31(new added method 'setCurrentTab(int currentTab, boolean smoothScroll)' for SlidingTabLayout and redefine attr 'tl_textBold')\n\nVersion 2.1.0 *(2016.10.28)*\n----------------------------\n* remove Application label in manifest\n* add method to make viewpager snap on tab click\n\nVersion 2.1.2 *(2017.1.23)*\n----------------------------\n* update compileSdkVersion to 25, buildToolsVersion to \"25.0.2\"\n\nVersion 3.0.0 *(2021.09.30)*\n----------------------------\n* AndroidX & publish on Maven Central\n\n\n"
  },
  {
    "path": "FlycoTabLayout_Lib/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "FlycoTabLayout_Lib/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion rootProject.ext.compileSdkVersion\n    buildToolsVersion rootProject.ext.buildToolsVersion\n\n    defaultConfig {\n        minSdkVersion rootProject.ext.minSdkVersion\n        targetSdkVersion rootProject.ext.targetSdkVersion\n        versionCode rootProject.ext.versionCode\n        versionName rootProject.ext.versionName\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_1_8\n        targetCompatibility = JavaVersion.VERSION_1_8\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation support.appcompat\n    implementation support.v4\n    implementation support.design\n}\n\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0'\n    }\n}\n\nallprojects {\n    plugins.withId(\"com.vanniktech.maven.publish\") {\n        mavenPublish {\n            sonatypeHost = \"S01\"\n        }\n    }\n}\n\napply plugin: \"com.vanniktech.maven.publish\""
  },
  {
    "path": "FlycoTabLayout_Lib/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/lihui/work/AndroidStudio/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/AndroidManifest.xml",
    "content": "<manifest\n    package=\"com.flyco.tablayout\">\n</manifest>\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/CommonTabLayout.java",
    "content": "package com.flyco.tablayout;\n\nimport android.animation.TypeEvaluator;\nimport android.animation.ValueAnimator;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.Rect;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Bundle;\nimport android.os.Parcelable;\nimport android.util.AttributeSet;\nimport android.util.SparseArray;\nimport android.util.TypedValue;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.OvershootInterpolator;\nimport android.widget.FrameLayout;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentActivity;\n\nimport com.flyco.tablayout.listener.CustomTabEntity;\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.utils.FragmentChangeManager;\nimport com.flyco.tablayout.utils.UnreadMsgUtils;\nimport com.flyco.tablayout.widget.MsgView;\n\nimport java.util.ArrayList;\n\n/** 没有继承HorizontalScrollView不能滑动,对于ViewPager无依赖 */\npublic class CommonTabLayout extends FrameLayout implements ValueAnimator.AnimatorUpdateListener {\n    private Context mContext;\n    private ArrayList<CustomTabEntity> mTabEntitys = new ArrayList<>();\n    private LinearLayout mTabsContainer;\n    private int mCurrentTab;\n    private int mLastTab;\n    private int mTabCount;\n    /** 用于绘制显示器 */\n    private Rect mIndicatorRect = new Rect();\n    private GradientDrawable mIndicatorDrawable = new GradientDrawable();\n\n    private Paint mRectPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mDividerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mTrianglePaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Path mTrianglePath = new Path();\n    private static final int STYLE_NORMAL = 0;\n    private static final int STYLE_TRIANGLE = 1;\n    private static final int STYLE_BLOCK = 2;\n    private int mIndicatorStyle = STYLE_NORMAL;\n\n    private float mTabPadding;\n    private boolean mTabSpaceEqual;\n    private float mTabWidth;\n\n    /** indicator */\n    private int mIndicatorColor;\n    private float mIndicatorHeight;\n    private float mIndicatorWidth;\n    private float mIndicatorCornerRadius;\n    private float mIndicatorMarginLeft;\n    private float mIndicatorMarginTop;\n    private float mIndicatorMarginRight;\n    private float mIndicatorMarginBottom;\n    private long mIndicatorAnimDuration;\n    private boolean mIndicatorAnimEnable;\n    private boolean mIndicatorBounceEnable;\n    private int mIndicatorGravity;\n\n    /** underline */\n    private int mUnderlineColor;\n    private float mUnderlineHeight;\n    private int mUnderlineGravity;\n\n    /** divider */\n    private int mDividerColor;\n    private float mDividerWidth;\n    private float mDividerPadding;\n\n    /** title */\n    private static final int TEXT_BOLD_NONE = 0;\n    private static final int TEXT_BOLD_WHEN_SELECT = 1;\n    private static final int TEXT_BOLD_BOTH = 2;\n    private float mTextsize;\n    private int mTextSelectColor;\n    private int mTextUnselectColor;\n    private int mTextBold;\n    private boolean mTextAllCaps;\n\n    /** icon */\n    private boolean mIconVisible;\n    private int mIconGravity;\n    private float mIconWidth;\n    private float mIconHeight;\n    private float mIconMargin;\n\n    private int mHeight;\n\n    /** anim */\n    private ValueAnimator mValueAnimator;\n    private OvershootInterpolator mInterpolator = new OvershootInterpolator(1.5f);\n\n    private FragmentChangeManager mFragmentChangeManager;\n\n    public CommonTabLayout(Context context) {\n        this(context, null, 0);\n    }\n\n    public CommonTabLayout(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public CommonTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        setWillNotDraw(false);//重写onDraw方法,需要调用这个方法来清除flag\n        setClipChildren(false);\n        setClipToPadding(false);\n\n        this.mContext = context;\n        mTabsContainer = new LinearLayout(context);\n        addView(mTabsContainer);\n\n        obtainAttributes(context, attrs);\n\n        //get layout_height\n        String height = attrs.getAttributeValue(\"http://schemas.android.com/apk/res/android\", \"layout_height\");\n\n        //create ViewPager\n        if (height.equals(ViewGroup.LayoutParams.MATCH_PARENT + \"\")) {\n        } else if (height.equals(ViewGroup.LayoutParams.WRAP_CONTENT + \"\")) {\n        } else {\n            int[] systemAttrs = {android.R.attr.layout_height};\n            TypedArray a = context.obtainStyledAttributes(attrs, systemAttrs);\n            mHeight = a.getDimensionPixelSize(0, ViewGroup.LayoutParams.WRAP_CONTENT);\n            a.recycle();\n        }\n\n        mValueAnimator = ValueAnimator.ofObject(new PointEvaluator(), mLastP, mCurrentP);\n        mValueAnimator.addUpdateListener(this);\n    }\n\n    private void obtainAttributes(Context context, AttributeSet attrs) {\n        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.CommonTabLayout);\n\n        mIndicatorStyle = ta.getInt(R.styleable.CommonTabLayout_tl_indicator_style, 0);\n        mIndicatorColor = ta.getColor(R.styleable.CommonTabLayout_tl_indicator_color, Color.parseColor(mIndicatorStyle == STYLE_BLOCK ? \"#4B6A87\" : \"#ffffff\"));\n        mIndicatorHeight = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_height,\n                dp2px(mIndicatorStyle == STYLE_TRIANGLE ? 4 : (mIndicatorStyle == STYLE_BLOCK ? -1 : 2)));\n        mIndicatorWidth = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_width, dp2px(mIndicatorStyle == STYLE_TRIANGLE ? 10 : -1));\n        mIndicatorCornerRadius = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_corner_radius, dp2px(mIndicatorStyle == STYLE_BLOCK ? -1 : 0));\n        mIndicatorMarginLeft = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_margin_left, dp2px(0));\n        mIndicatorMarginTop = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_margin_top, dp2px(mIndicatorStyle == STYLE_BLOCK ? 7 : 0));\n        mIndicatorMarginRight = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_margin_right, dp2px(0));\n        mIndicatorMarginBottom = ta.getDimension(R.styleable.CommonTabLayout_tl_indicator_margin_bottom, dp2px(mIndicatorStyle == STYLE_BLOCK ? 7 : 0));\n        mIndicatorAnimEnable = ta.getBoolean(R.styleable.CommonTabLayout_tl_indicator_anim_enable, true);\n        mIndicatorBounceEnable = ta.getBoolean(R.styleable.CommonTabLayout_tl_indicator_bounce_enable, true);\n        mIndicatorAnimDuration = ta.getInt(R.styleable.CommonTabLayout_tl_indicator_anim_duration, -1);\n        mIndicatorGravity = ta.getInt(R.styleable.CommonTabLayout_tl_indicator_gravity, Gravity.BOTTOM);\n\n        mUnderlineColor = ta.getColor(R.styleable.CommonTabLayout_tl_underline_color, Color.parseColor(\"#ffffff\"));\n        mUnderlineHeight = ta.getDimension(R.styleable.CommonTabLayout_tl_underline_height, dp2px(0));\n        mUnderlineGravity = ta.getInt(R.styleable.CommonTabLayout_tl_underline_gravity, Gravity.BOTTOM);\n\n        mDividerColor = ta.getColor(R.styleable.CommonTabLayout_tl_divider_color, Color.parseColor(\"#ffffff\"));\n        mDividerWidth = ta.getDimension(R.styleable.CommonTabLayout_tl_divider_width, dp2px(0));\n        mDividerPadding = ta.getDimension(R.styleable.CommonTabLayout_tl_divider_padding, dp2px(12));\n\n        mTextsize = ta.getDimension(R.styleable.CommonTabLayout_tl_textsize, sp2px(13f));\n        mTextSelectColor = ta.getColor(R.styleable.CommonTabLayout_tl_textSelectColor, Color.parseColor(\"#ffffff\"));\n        mTextUnselectColor = ta.getColor(R.styleable.CommonTabLayout_tl_textUnselectColor, Color.parseColor(\"#AAffffff\"));\n        mTextBold = ta.getInt(R.styleable.CommonTabLayout_tl_textBold, TEXT_BOLD_NONE);\n        mTextAllCaps = ta.getBoolean(R.styleable.CommonTabLayout_tl_textAllCaps, false);\n\n        mIconVisible = ta.getBoolean(R.styleable.CommonTabLayout_tl_iconVisible, true);\n        mIconGravity = ta.getInt(R.styleable.CommonTabLayout_tl_iconGravity, Gravity.TOP);\n        mIconWidth = ta.getDimension(R.styleable.CommonTabLayout_tl_iconWidth, dp2px(0));\n        mIconHeight = ta.getDimension(R.styleable.CommonTabLayout_tl_iconHeight, dp2px(0));\n        mIconMargin = ta.getDimension(R.styleable.CommonTabLayout_tl_iconMargin, dp2px(2.5f));\n\n        mTabSpaceEqual = ta.getBoolean(R.styleable.CommonTabLayout_tl_tab_space_equal, true);\n        mTabWidth = ta.getDimension(R.styleable.CommonTabLayout_tl_tab_width, dp2px(-1));\n        mTabPadding = ta.getDimension(R.styleable.CommonTabLayout_tl_tab_padding, mTabSpaceEqual || mTabWidth > 0 ? dp2px(0) : dp2px(10));\n\n        ta.recycle();\n    }\n\n    public void setTabData(ArrayList<CustomTabEntity> tabEntitys) {\n        if (tabEntitys == null || tabEntitys.size() == 0) {\n            throw new IllegalStateException(\"TabEntitys can not be NULL or EMPTY !\");\n        }\n\n        this.mTabEntitys.clear();\n        this.mTabEntitys.addAll(tabEntitys);\n\n        notifyDataSetChanged();\n    }\n\n    /** 关联数据支持同时切换fragments */\n    public void setTabData(ArrayList<CustomTabEntity> tabEntitys, FragmentActivity fa, int containerViewId, ArrayList<Fragment> fragments) {\n        mFragmentChangeManager = new FragmentChangeManager(fa.getSupportFragmentManager(), containerViewId, fragments);\n        setTabData(tabEntitys);\n    }\n\n    /** 更新数据 */\n    public void notifyDataSetChanged() {\n        mTabsContainer.removeAllViews();\n        this.mTabCount = mTabEntitys.size();\n        View tabView;\n        for (int i = 0; i < mTabCount; i++) {\n            if (mIconGravity == Gravity.LEFT) {\n                tabView = View.inflate(mContext, R.layout.layout_tab_left, null);\n            } else if (mIconGravity == Gravity.RIGHT) {\n                tabView = View.inflate(mContext, R.layout.layout_tab_right, null);\n            } else if (mIconGravity == Gravity.BOTTOM) {\n                tabView = View.inflate(mContext, R.layout.layout_tab_bottom, null);\n            } else {\n                tabView = View.inflate(mContext, R.layout.layout_tab_top, null);\n            }\n\n            tabView.setTag(i);\n            addTab(i, tabView);\n        }\n\n        updateTabStyles();\n    }\n\n    /** 创建并添加tab */\n    private void addTab(final int position, View tabView) {\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        tv_tab_title.setText(mTabEntitys.get(position).getTabTitle());\n        ImageView iv_tab_icon = (ImageView) tabView.findViewById(R.id.iv_tab_icon);\n        iv_tab_icon.setImageResource(mTabEntitys.get(position).getTabUnselectedIcon());\n\n        tabView.setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int position = (Integer) v.getTag();\n                if (mCurrentTab != position) {\n                    setCurrentTab(position);\n                    if (mListener != null) {\n                        mListener.onTabSelect(position);\n                    }\n                } else {\n                    if (mListener != null) {\n                        mListener.onTabReselect(position);\n                    }\n                }\n            }\n        });\n\n        /** 每一个Tab的布局参数 */\n        LinearLayout.LayoutParams lp_tab = mTabSpaceEqual ?\n                new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f) :\n                new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);\n        if (mTabWidth > 0) {\n            lp_tab = new LinearLayout.LayoutParams((int) mTabWidth, LayoutParams.MATCH_PARENT);\n        }\n        mTabsContainer.addView(tabView, position, lp_tab);\n    }\n\n    private void updateTabStyles() {\n        for (int i = 0; i < mTabCount; i++) {\n            View tabView = mTabsContainer.getChildAt(i);\n            tabView.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);\n            TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);\n            tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);\n//            tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);\n            if (mTextAllCaps) {\n                tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());\n            }\n\n            if (mTextBold == TEXT_BOLD_BOTH) {\n                tv_tab_title.getPaint().setFakeBoldText(true);\n            } else if (mTextBold == TEXT_BOLD_NONE) {\n                tv_tab_title.getPaint().setFakeBoldText(false);\n            }\n\n            ImageView iv_tab_icon = (ImageView) tabView.findViewById(R.id.iv_tab_icon);\n            if (mIconVisible) {\n                iv_tab_icon.setVisibility(View.VISIBLE);\n                CustomTabEntity tabEntity = mTabEntitys.get(i);\n                iv_tab_icon.setImageResource(i == mCurrentTab ? tabEntity.getTabSelectedIcon() : tabEntity.getTabUnselectedIcon());\n                LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n                        mIconWidth <= 0 ? LinearLayout.LayoutParams.WRAP_CONTENT : (int) mIconWidth,\n                        mIconHeight <= 0 ? LinearLayout.LayoutParams.WRAP_CONTENT : (int) mIconHeight);\n                if (mIconGravity == Gravity.LEFT) {\n                    lp.rightMargin = (int) mIconMargin;\n                } else if (mIconGravity == Gravity.RIGHT) {\n                    lp.leftMargin = (int) mIconMargin;\n                } else if (mIconGravity == Gravity.BOTTOM) {\n                    lp.topMargin = (int) mIconMargin;\n                } else {\n                    lp.bottomMargin = (int) mIconMargin;\n                }\n\n                iv_tab_icon.setLayoutParams(lp);\n            } else {\n                iv_tab_icon.setVisibility(View.GONE);\n            }\n        }\n    }\n\n    private void updateTabSelection(int position) {\n        for (int i = 0; i < mTabCount; ++i) {\n            View tabView = mTabsContainer.getChildAt(i);\n            final boolean isSelect = i == position;\n            TextView tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            tab_title.setTextColor(isSelect ? mTextSelectColor : mTextUnselectColor);\n            ImageView iv_tab_icon = (ImageView) tabView.findViewById(R.id.iv_tab_icon);\n            CustomTabEntity tabEntity = mTabEntitys.get(i);\n            iv_tab_icon.setImageResource(isSelect ? tabEntity.getTabSelectedIcon() : tabEntity.getTabUnselectedIcon());\n            if (mTextBold == TEXT_BOLD_WHEN_SELECT) {\n                tab_title.getPaint().setFakeBoldText(isSelect);\n            }\n        }\n    }\n\n    private void calcOffset() {\n        final View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        mCurrentP.left = currentTabView.getLeft();\n        mCurrentP.right = currentTabView.getRight();\n\n        final View lastTabView = mTabsContainer.getChildAt(this.mLastTab);\n        mLastP.left = lastTabView.getLeft();\n        mLastP.right = lastTabView.getRight();\n\n//        Log.d(\"AAA\", \"mLastP--->\" + mLastP.left + \"&\" + mLastP.right);\n//        Log.d(\"AAA\", \"mCurrentP--->\" + mCurrentP.left + \"&\" + mCurrentP.right);\n        if (mLastP.left == mCurrentP.left && mLastP.right == mCurrentP.right) {\n            invalidate();\n        } else {\n            mValueAnimator.setObjectValues(mLastP, mCurrentP);\n            if (mIndicatorBounceEnable) {\n                mValueAnimator.setInterpolator(mInterpolator);\n            }\n\n            if (mIndicatorAnimDuration < 0) {\n                mIndicatorAnimDuration = mIndicatorBounceEnable ? 500 : 250;\n            }\n            mValueAnimator.setDuration(mIndicatorAnimDuration);\n            mValueAnimator.start();\n        }\n    }\n\n    private void calcIndicatorRect() {\n        View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        float left = currentTabView.getLeft();\n        float right = currentTabView.getRight();\n\n        mIndicatorRect.left = (int) left;\n        mIndicatorRect.right = (int) right;\n\n        if (mIndicatorWidth < 0) {   //indicatorWidth小于0时,原jpardogo's PagerSlidingTabStrip\n\n        } else {//indicatorWidth大于0时,圆角矩形以及三角形\n            float indicatorLeft = currentTabView.getLeft() + (currentTabView.getWidth() - mIndicatorWidth) / 2;\n\n            mIndicatorRect.left = (int) indicatorLeft;\n            mIndicatorRect.right = (int) (mIndicatorRect.left + mIndicatorWidth);\n        }\n    }\n\n    @Override\n    public void onAnimationUpdate(ValueAnimator animation) {\n        View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        IndicatorPoint p = (IndicatorPoint) animation.getAnimatedValue();\n        mIndicatorRect.left = (int) p.left;\n        mIndicatorRect.right = (int) p.right;\n\n        if (mIndicatorWidth < 0) {   //indicatorWidth小于0时,原jpardogo's PagerSlidingTabStrip\n\n        } else {//indicatorWidth大于0时,圆角矩形以及三角形\n            float indicatorLeft = p.left + (currentTabView.getWidth() - mIndicatorWidth) / 2;\n\n            mIndicatorRect.left = (int) indicatorLeft;\n            mIndicatorRect.right = (int) (mIndicatorRect.left + mIndicatorWidth);\n        }\n        invalidate();\n    }\n\n    private boolean mIsFirstDraw = true;\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n\n        if (isInEditMode() || mTabCount <= 0) {\n            return;\n        }\n\n        int height = getHeight();\n        int paddingLeft = getPaddingLeft();\n        // draw divider\n        if (mDividerWidth > 0) {\n            mDividerPaint.setStrokeWidth(mDividerWidth);\n            mDividerPaint.setColor(mDividerColor);\n            for (int i = 0; i < mTabCount - 1; i++) {\n                View tab = mTabsContainer.getChildAt(i);\n                canvas.drawLine(paddingLeft + tab.getRight(), mDividerPadding, paddingLeft + tab.getRight(), height - mDividerPadding, mDividerPaint);\n            }\n        }\n\n        // draw underline\n        if (mUnderlineHeight > 0) {\n            mRectPaint.setColor(mUnderlineColor);\n            if (mUnderlineGravity == Gravity.BOTTOM) {\n                canvas.drawRect(paddingLeft, height - mUnderlineHeight, mTabsContainer.getWidth() + paddingLeft, height, mRectPaint);\n            } else {\n                canvas.drawRect(paddingLeft, 0, mTabsContainer.getWidth() + paddingLeft, mUnderlineHeight, mRectPaint);\n            }\n        }\n\n        //draw indicator line\n        if (mIndicatorAnimEnable) {\n            if (mIsFirstDraw) {\n                mIsFirstDraw = false;\n                calcIndicatorRect();\n            }\n        } else {\n            calcIndicatorRect();\n        }\n\n\n        if (mIndicatorStyle == STYLE_TRIANGLE) {\n            if (mIndicatorHeight > 0) {\n                mTrianglePaint.setColor(mIndicatorColor);\n                mTrianglePath.reset();\n                mTrianglePath.moveTo(paddingLeft + mIndicatorRect.left, height);\n                mTrianglePath.lineTo(paddingLeft + mIndicatorRect.left / 2 + mIndicatorRect.right / 2, height - mIndicatorHeight);\n                mTrianglePath.lineTo(paddingLeft + mIndicatorRect.right, height);\n                mTrianglePath.close();\n                canvas.drawPath(mTrianglePath, mTrianglePaint);\n            }\n        } else if (mIndicatorStyle == STYLE_BLOCK) {\n            if (mIndicatorHeight < 0) {\n                mIndicatorHeight = height - mIndicatorMarginTop - mIndicatorMarginBottom;\n            } else {\n\n            }\n\n            if (mIndicatorHeight > 0) {\n                if (mIndicatorCornerRadius < 0 || mIndicatorCornerRadius > mIndicatorHeight / 2) {\n                    mIndicatorCornerRadius = mIndicatorHeight / 2;\n                }\n\n                mIndicatorDrawable.setColor(mIndicatorColor);\n                mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                        (int) mIndicatorMarginTop, (int) (paddingLeft + mIndicatorRect.right - mIndicatorMarginRight),\n                        (int) (mIndicatorMarginTop + mIndicatorHeight));\n                mIndicatorDrawable.setCornerRadius(mIndicatorCornerRadius);\n                mIndicatorDrawable.draw(canvas);\n            }\n        } else {\n               /* mRectPaint.setColor(mIndicatorColor);\n                calcIndicatorRect();\n                canvas.drawRect(getPaddingLeft() + mIndicatorRect.left, getHeight() - mIndicatorHeight,\n                        mIndicatorRect.right + getPaddingLeft(), getHeight(), mRectPaint);*/\n\n            if (mIndicatorHeight > 0) {\n                mIndicatorDrawable.setColor(mIndicatorColor);\n                if (mIndicatorGravity == Gravity.BOTTOM) {\n                    mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                            height - (int) mIndicatorHeight - (int) mIndicatorMarginBottom,\n                            paddingLeft + mIndicatorRect.right - (int) mIndicatorMarginRight,\n                            height - (int) mIndicatorMarginBottom);\n                } else {\n                    mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                            (int) mIndicatorMarginTop,\n                            paddingLeft + mIndicatorRect.right - (int) mIndicatorMarginRight,\n                            (int) mIndicatorHeight + (int) mIndicatorMarginTop);\n                }\n                mIndicatorDrawable.setCornerRadius(mIndicatorCornerRadius);\n                mIndicatorDrawable.draw(canvas);\n            }\n        }\n    }\n\n    //setter and getter\n    public void setCurrentTab(int currentTab) {\n        mLastTab = this.mCurrentTab;\n        this.mCurrentTab = currentTab;\n        updateTabSelection(currentTab);\n        if (mFragmentChangeManager != null) {\n            mFragmentChangeManager.setFragments(currentTab);\n        }\n        if (mIndicatorAnimEnable) {\n            calcOffset();\n        } else {\n            invalidate();\n        }\n    }\n\n    public void setIndicatorStyle(int indicatorStyle) {\n        this.mIndicatorStyle = indicatorStyle;\n        invalidate();\n    }\n\n    public void setTabPadding(float tabPadding) {\n        this.mTabPadding = dp2px(tabPadding);\n        updateTabStyles();\n    }\n\n    public void setTabSpaceEqual(boolean tabSpaceEqual) {\n        this.mTabSpaceEqual = tabSpaceEqual;\n        updateTabStyles();\n    }\n\n    public void setTabWidth(float tabWidth) {\n        this.mTabWidth = dp2px(tabWidth);\n        updateTabStyles();\n    }\n\n    public void setIndicatorColor(int indicatorColor) {\n        this.mIndicatorColor = indicatorColor;\n        invalidate();\n    }\n\n    public void setIndicatorHeight(float indicatorHeight) {\n        this.mIndicatorHeight = dp2px(indicatorHeight);\n        invalidate();\n    }\n\n    public void setIndicatorWidth(float indicatorWidth) {\n        this.mIndicatorWidth = dp2px(indicatorWidth);\n        invalidate();\n    }\n\n    public void setIndicatorCornerRadius(float indicatorCornerRadius) {\n        this.mIndicatorCornerRadius = dp2px(indicatorCornerRadius);\n        invalidate();\n    }\n\n    public void setIndicatorGravity(int indicatorGravity) {\n        this.mIndicatorGravity = indicatorGravity;\n        invalidate();\n    }\n\n    public void setIndicatorMargin(float indicatorMarginLeft, float indicatorMarginTop,\n                                   float indicatorMarginRight, float indicatorMarginBottom) {\n        this.mIndicatorMarginLeft = dp2px(indicatorMarginLeft);\n        this.mIndicatorMarginTop = dp2px(indicatorMarginTop);\n        this.mIndicatorMarginRight = dp2px(indicatorMarginRight);\n        this.mIndicatorMarginBottom = dp2px(indicatorMarginBottom);\n        invalidate();\n    }\n\n    public void setIndicatorAnimDuration(long indicatorAnimDuration) {\n        this.mIndicatorAnimDuration = indicatorAnimDuration;\n    }\n\n    public void setIndicatorAnimEnable(boolean indicatorAnimEnable) {\n        this.mIndicatorAnimEnable = indicatorAnimEnable;\n    }\n\n    public void setIndicatorBounceEnable(boolean indicatorBounceEnable) {\n        this.mIndicatorBounceEnable = indicatorBounceEnable;\n    }\n\n    public void setUnderlineColor(int underlineColor) {\n        this.mUnderlineColor = underlineColor;\n        invalidate();\n    }\n\n    public void setUnderlineHeight(float underlineHeight) {\n        this.mUnderlineHeight = dp2px(underlineHeight);\n        invalidate();\n    }\n\n    public void setUnderlineGravity(int underlineGravity) {\n        this.mUnderlineGravity = underlineGravity;\n        invalidate();\n    }\n\n    public void setDividerColor(int dividerColor) {\n        this.mDividerColor = dividerColor;\n        invalidate();\n    }\n\n    public void setDividerWidth(float dividerWidth) {\n        this.mDividerWidth = dp2px(dividerWidth);\n        invalidate();\n    }\n\n    public void setDividerPadding(float dividerPadding) {\n        this.mDividerPadding = dp2px(dividerPadding);\n        invalidate();\n    }\n\n    public void setTextsize(float textsize) {\n        this.mTextsize = sp2px(textsize);\n        updateTabStyles();\n    }\n\n    public void setTextSelectColor(int textSelectColor) {\n        this.mTextSelectColor = textSelectColor;\n        updateTabStyles();\n    }\n\n    public void setTextUnselectColor(int textUnselectColor) {\n        this.mTextUnselectColor = textUnselectColor;\n        updateTabStyles();\n    }\n\n    public void setTextBold(int textBold) {\n        this.mTextBold = textBold;\n        updateTabStyles();\n    }\n\n    public void setIconVisible(boolean iconVisible) {\n        this.mIconVisible = iconVisible;\n        updateTabStyles();\n    }\n\n    public void setIconGravity(int iconGravity) {\n        this.mIconGravity = iconGravity;\n        notifyDataSetChanged();\n    }\n\n    public void setIconWidth(float iconWidth) {\n        this.mIconWidth = dp2px(iconWidth);\n        updateTabStyles();\n    }\n\n    public void setIconHeight(float iconHeight) {\n        this.mIconHeight = dp2px(iconHeight);\n        updateTabStyles();\n    }\n\n    public void setIconMargin(float iconMargin) {\n        this.mIconMargin = dp2px(iconMargin);\n        updateTabStyles();\n    }\n\n    public void setTextAllCaps(boolean textAllCaps) {\n        this.mTextAllCaps = textAllCaps;\n        updateTabStyles();\n    }\n\n\n    public int getTabCount() {\n        return mTabCount;\n    }\n\n    public int getCurrentTab() {\n        return mCurrentTab;\n    }\n\n    public int getIndicatorStyle() {\n        return mIndicatorStyle;\n    }\n\n    public float getTabPadding() {\n        return mTabPadding;\n    }\n\n    public boolean isTabSpaceEqual() {\n        return mTabSpaceEqual;\n    }\n\n    public float getTabWidth() {\n        return mTabWidth;\n    }\n\n    public int getIndicatorColor() {\n        return mIndicatorColor;\n    }\n\n    public float getIndicatorHeight() {\n        return mIndicatorHeight;\n    }\n\n    public float getIndicatorWidth() {\n        return mIndicatorWidth;\n    }\n\n    public float getIndicatorCornerRadius() {\n        return mIndicatorCornerRadius;\n    }\n\n    public float getIndicatorMarginLeft() {\n        return mIndicatorMarginLeft;\n    }\n\n    public float getIndicatorMarginTop() {\n        return mIndicatorMarginTop;\n    }\n\n    public float getIndicatorMarginRight() {\n        return mIndicatorMarginRight;\n    }\n\n    public float getIndicatorMarginBottom() {\n        return mIndicatorMarginBottom;\n    }\n\n    public long getIndicatorAnimDuration() {\n        return mIndicatorAnimDuration;\n    }\n\n    public boolean isIndicatorAnimEnable() {\n        return mIndicatorAnimEnable;\n    }\n\n    public boolean isIndicatorBounceEnable() {\n        return mIndicatorBounceEnable;\n    }\n\n    public int getUnderlineColor() {\n        return mUnderlineColor;\n    }\n\n    public float getUnderlineHeight() {\n        return mUnderlineHeight;\n    }\n\n    public int getDividerColor() {\n        return mDividerColor;\n    }\n\n    public float getDividerWidth() {\n        return mDividerWidth;\n    }\n\n    public float getDividerPadding() {\n        return mDividerPadding;\n    }\n\n    public float getTextsize() {\n        return mTextsize;\n    }\n\n    public int getTextSelectColor() {\n        return mTextSelectColor;\n    }\n\n    public int getTextUnselectColor() {\n        return mTextUnselectColor;\n    }\n\n    public int getTextBold() {\n        return mTextBold;\n    }\n\n    public boolean isTextAllCaps() {\n        return mTextAllCaps;\n    }\n\n    public int getIconGravity() {\n        return mIconGravity;\n    }\n\n    public float getIconWidth() {\n        return mIconWidth;\n    }\n\n    public float getIconHeight() {\n        return mIconHeight;\n    }\n\n    public float getIconMargin() {\n        return mIconMargin;\n    }\n\n    public boolean isIconVisible() {\n        return mIconVisible;\n    }\n\n\n    public ImageView getIconView(int tab) {\n        View tabView = mTabsContainer.getChildAt(tab);\n        ImageView iv_tab_icon = (ImageView) tabView.findViewById(R.id.iv_tab_icon);\n        return iv_tab_icon;\n    }\n\n    public TextView getTitleView(int tab) {\n        View tabView = mTabsContainer.getChildAt(tab);\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        return tv_tab_title;\n    }\n\n    //setter and getter\n\n    // show MsgTipView\n    private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private SparseArray<Boolean> mInitSetMap = new SparseArray<>();\n\n    /**\n     * 显示未读消息\n     *\n     * @param position 显示tab位置\n     * @param num      num小于等于0显示红点,num大于0显示数字\n     */\n    public void showMsg(int position, int num) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            UnreadMsgUtils.show(tipView, num);\n\n            if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {\n                return;\n            }\n\n            if (!mIconVisible) {\n                setMsgMargin(position, 2, 2);\n            } else {\n                setMsgMargin(position, 0,\n                        mIconGravity == Gravity.LEFT || mIconGravity == Gravity.RIGHT ? 4 : 0);\n            }\n\n            mInitSetMap.put(position, true);\n        }\n    }\n\n    /**\n     * 显示未读红点\n     *\n     * @param position 显示tab位置\n     */\n    public void showDot(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        showMsg(position, 0);\n    }\n\n    public void hideMsg(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            tipView.setVisibility(View.GONE);\n        }\n    }\n\n    /**\n     * 设置提示红点偏移,注意\n     * 1.控件为固定高度:参照点为tab内容的右上角\n     * 2.控件高度不固定(WRAP_CONTENT):参照点为tab内容的右上角,此时高度已是红点的最高显示范围,所以这时bottomPadding其实就是topPadding\n     */\n    public void setMsgMargin(int position, float leftPadding, float bottomPadding) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            mTextPaint.setTextSize(mTextsize);\n            float textWidth = mTextPaint.measureText(tv_tab_title.getText().toString());\n            float textHeight = mTextPaint.descent() - mTextPaint.ascent();\n            MarginLayoutParams lp = (MarginLayoutParams) tipView.getLayoutParams();\n\n            float iconH = mIconHeight;\n            float margin = 0;\n            if (mIconVisible) {\n                if (iconH <= 0) {\n                    iconH = mContext.getResources().getDrawable(mTabEntitys.get(position).getTabSelectedIcon()).getIntrinsicHeight();\n                }\n                margin = mIconMargin;\n            }\n\n            if (mIconGravity == Gravity.TOP || mIconGravity == Gravity.BOTTOM) {\n                lp.leftMargin = dp2px(leftPadding);\n                lp.topMargin = mHeight > 0 ? (int) (mHeight - textHeight - iconH - margin) / 2 - dp2px(bottomPadding) : dp2px(bottomPadding);\n            } else {\n                lp.leftMargin = dp2px(leftPadding);\n                lp.topMargin = mHeight > 0 ? (int) (mHeight - Math.max(textHeight, iconH)) / 2 - dp2px(bottomPadding) : dp2px(bottomPadding);\n            }\n\n            tipView.setLayoutParams(lp);\n        }\n    }\n\n    /** 当前类只提供了少许设置未读消息属性的方法,可以通过该方法获取MsgView对象从而各种设置 */\n    public MsgView getMsgView(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        return tipView;\n    }\n\n    private OnTabSelectListener mListener;\n\n    public void setOnTabSelectListener(OnTabSelectListener listener) {\n        this.mListener = listener;\n    }\n\n\n    @Override\n    protected Parcelable onSaveInstanceState() {\n        Bundle bundle = new Bundle();\n        bundle.putParcelable(\"instanceState\", super.onSaveInstanceState());\n        bundle.putInt(\"mCurrentTab\", mCurrentTab);\n        return bundle;\n    }\n\n    @Override\n    protected void onRestoreInstanceState(Parcelable state) {\n        if (state instanceof Bundle) {\n            Bundle bundle = (Bundle) state;\n            mCurrentTab = bundle.getInt(\"mCurrentTab\");\n            state = bundle.getParcelable(\"instanceState\");\n            if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {\n                updateTabSelection(mCurrentTab);\n            }\n        }\n        super.onRestoreInstanceState(state);\n    }\n\n    class IndicatorPoint {\n        public float left;\n        public float right;\n    }\n\n    private IndicatorPoint mCurrentP = new IndicatorPoint();\n    private IndicatorPoint mLastP = new IndicatorPoint();\n\n    class PointEvaluator implements TypeEvaluator<IndicatorPoint> {\n        @Override\n        public IndicatorPoint evaluate(float fraction, IndicatorPoint startValue, IndicatorPoint endValue) {\n            float left = startValue.left + fraction * (endValue.left - startValue.left);\n            float right = startValue.right + fraction * (endValue.right - startValue.right);\n            IndicatorPoint point = new IndicatorPoint();\n            point.left = left;\n            point.right = right;\n            return point;\n        }\n    }\n\n\n    protected int dp2px(float dp) {\n        final float scale = mContext.getResources().getDisplayMetrics().density;\n        return (int) (dp * scale + 0.5f);\n    }\n\n    protected int sp2px(float sp) {\n        final float scale = this.mContext.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scale + 0.5f);\n    }\n\n}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/SegmentTabLayout.java",
    "content": "package com.flyco.tablayout;\n\nimport android.animation.TypeEvaluator;\nimport android.animation.ValueAnimator;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Bundle;\nimport android.os.Parcelable;\nimport android.util.AttributeSet;\nimport android.util.SparseArray;\nimport android.util.TypedValue;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.OvershootInterpolator;\nimport android.widget.FrameLayout;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentActivity;\n\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.utils.FragmentChangeManager;\nimport com.flyco.tablayout.utils.UnreadMsgUtils;\nimport com.flyco.tablayout.widget.MsgView;\n\nimport java.util.ArrayList;\n\npublic class SegmentTabLayout extends FrameLayout implements ValueAnimator.AnimatorUpdateListener {\n    private Context mContext;\n    private String[] mTitles;\n    private LinearLayout mTabsContainer;\n    private int mCurrentTab;\n    private int mLastTab;\n    private int mTabCount;\n    /** 用于绘制显示器 */\n    private Rect mIndicatorRect = new Rect();\n    private GradientDrawable mIndicatorDrawable = new GradientDrawable();\n    private GradientDrawable mRectDrawable = new GradientDrawable();\n\n    private Paint mDividerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n\n    private float mTabPadding;\n    private boolean mTabSpaceEqual;\n    private float mTabWidth;\n\n    /** indicator */\n    private int mIndicatorColor;\n    private float mIndicatorHeight;\n    private float mIndicatorCornerRadius;\n    private float mIndicatorMarginLeft;\n    private float mIndicatorMarginTop;\n    private float mIndicatorMarginRight;\n    private float mIndicatorMarginBottom;\n    private long mIndicatorAnimDuration;\n    private boolean mIndicatorAnimEnable;\n    private boolean mIndicatorBounceEnable;\n\n    /** divider */\n    private int mDividerColor;\n    private float mDividerWidth;\n    private float mDividerPadding;\n\n    /** title */\n    private static final int TEXT_BOLD_NONE = 0;\n    private static final int TEXT_BOLD_WHEN_SELECT = 1;\n    private static final int TEXT_BOLD_BOTH = 2;\n    private float mTextsize;\n    private int mTextSelectColor;\n    private int mTextUnselectColor;\n    private int mTextBold;\n    private boolean mTextAllCaps;\n\n    private int mBarColor;\n    private int mBarStrokeColor;\n    private float mBarStrokeWidth;\n\n    private int mHeight;\n\n    /** anim */\n    private ValueAnimator mValueAnimator;\n    private OvershootInterpolator mInterpolator = new OvershootInterpolator(0.8f);\n\n    private FragmentChangeManager mFragmentChangeManager;\n    private float[] mRadiusArr = new float[8];\n\n    public SegmentTabLayout(Context context) {\n        this(context, null, 0);\n    }\n\n    public SegmentTabLayout(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public SegmentTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        setWillNotDraw(false);//重写onDraw方法,需要调用这个方法来清除flag\n        setClipChildren(false);\n        setClipToPadding(false);\n\n        this.mContext = context;\n        mTabsContainer = new LinearLayout(context);\n        addView(mTabsContainer);\n\n        obtainAttributes(context, attrs);\n\n        //get layout_height\n        String height = attrs.getAttributeValue(\"http://schemas.android.com/apk/res/android\", \"layout_height\");\n\n        //create ViewPager\n        if (height.equals(ViewGroup.LayoutParams.MATCH_PARENT + \"\")) {\n        } else if (height.equals(ViewGroup.LayoutParams.WRAP_CONTENT + \"\")) {\n        } else {\n            int[] systemAttrs = {android.R.attr.layout_height};\n            TypedArray a = context.obtainStyledAttributes(attrs, systemAttrs);\n            mHeight = a.getDimensionPixelSize(0, ViewGroup.LayoutParams.WRAP_CONTENT);\n            a.recycle();\n        }\n\n        mValueAnimator = ValueAnimator.ofObject(new PointEvaluator(), mLastP, mCurrentP);\n        mValueAnimator.addUpdateListener(this);\n    }\n\n    private void obtainAttributes(Context context, AttributeSet attrs) {\n        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SegmentTabLayout);\n\n        mIndicatorColor = ta.getColor(R.styleable.SegmentTabLayout_tl_indicator_color, Color.parseColor(\"#222831\"));\n        mIndicatorHeight = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_height, -1);\n        mIndicatorCornerRadius = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_corner_radius, -1);\n        mIndicatorMarginLeft = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_margin_left, dp2px(0));\n        mIndicatorMarginTop = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_margin_top, 0);\n        mIndicatorMarginRight = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_margin_right, dp2px(0));\n        mIndicatorMarginBottom = ta.getDimension(R.styleable.SegmentTabLayout_tl_indicator_margin_bottom, 0);\n        mIndicatorAnimEnable = ta.getBoolean(R.styleable.SegmentTabLayout_tl_indicator_anim_enable, false);\n        mIndicatorBounceEnable = ta.getBoolean(R.styleable.SegmentTabLayout_tl_indicator_bounce_enable, true);\n        mIndicatorAnimDuration = ta.getInt(R.styleable.SegmentTabLayout_tl_indicator_anim_duration, -1);\n\n        mDividerColor = ta.getColor(R.styleable.SegmentTabLayout_tl_divider_color, mIndicatorColor);\n        mDividerWidth = ta.getDimension(R.styleable.SegmentTabLayout_tl_divider_width, dp2px(1));\n        mDividerPadding = ta.getDimension(R.styleable.SegmentTabLayout_tl_divider_padding, 0);\n\n        mTextsize = ta.getDimension(R.styleable.SegmentTabLayout_tl_textsize, sp2px(13f));\n        mTextSelectColor = ta.getColor(R.styleable.SegmentTabLayout_tl_textSelectColor, Color.parseColor(\"#ffffff\"));\n        mTextUnselectColor = ta.getColor(R.styleable.SegmentTabLayout_tl_textUnselectColor, mIndicatorColor);\n        mTextBold = ta.getInt(R.styleable.SegmentTabLayout_tl_textBold, TEXT_BOLD_NONE);\n        mTextAllCaps = ta.getBoolean(R.styleable.SegmentTabLayout_tl_textAllCaps, false);\n\n        mTabSpaceEqual = ta.getBoolean(R.styleable.SegmentTabLayout_tl_tab_space_equal, true);\n        mTabWidth = ta.getDimension(R.styleable.SegmentTabLayout_tl_tab_width, dp2px(-1));\n        mTabPadding = ta.getDimension(R.styleable.SegmentTabLayout_tl_tab_padding, mTabSpaceEqual || mTabWidth > 0 ? dp2px(0) : dp2px(10));\n\n        mBarColor = ta.getColor(R.styleable.SegmentTabLayout_tl_bar_color, Color.TRANSPARENT);\n        mBarStrokeColor = ta.getColor(R.styleable.SegmentTabLayout_tl_bar_stroke_color, mIndicatorColor);\n        mBarStrokeWidth = ta.getDimension(R.styleable.SegmentTabLayout_tl_bar_stroke_width, dp2px(1));\n\n        ta.recycle();\n    }\n\n    public void setTabData(String[] titles) {\n        if (titles == null || titles.length == 0) {\n            throw new IllegalStateException(\"Titles can not be NULL or EMPTY !\");\n        }\n\n        this.mTitles = titles;\n\n        notifyDataSetChanged();\n    }\n\n    /** 关联数据支持同时切换fragments */\n    public void setTabData(String[] titles, FragmentActivity fa, int containerViewId, ArrayList<Fragment> fragments) {\n        mFragmentChangeManager = new FragmentChangeManager(fa.getSupportFragmentManager(), containerViewId, fragments);\n        setTabData(titles);\n    }\n\n    /** 更新数据 */\n    public void notifyDataSetChanged() {\n        mTabsContainer.removeAllViews();\n        this.mTabCount = mTitles.length;\n        View tabView;\n        for (int i = 0; i < mTabCount; i++) {\n            tabView = View.inflate(mContext, R.layout.layout_tab_segment, null);\n            tabView.setTag(i);\n            addTab(i, tabView);\n        }\n\n        updateTabStyles();\n    }\n\n    /** 创建并添加tab */\n    private void addTab(final int position, View tabView) {\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        tv_tab_title.setText(mTitles[position]);\n\n        tabView.setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int position = (Integer) v.getTag();\n                if (mCurrentTab != position) {\n                    setCurrentTab(position);\n                    if (mListener != null) {\n                        mListener.onTabSelect(position);\n                    }\n                } else {\n                    if (mListener != null) {\n                        mListener.onTabReselect(position);\n                    }\n                }\n            }\n        });\n\n        /** 每一个Tab的布局参数 */\n        LinearLayout.LayoutParams lp_tab = mTabSpaceEqual ?\n                new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f) :\n                new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);\n        if (mTabWidth > 0) {\n            lp_tab = new LinearLayout.LayoutParams((int) mTabWidth, LayoutParams.MATCH_PARENT);\n        }\n        mTabsContainer.addView(tabView, position, lp_tab);\n    }\n\n    private void updateTabStyles() {\n        for (int i = 0; i < mTabCount; i++) {\n            View tabView = mTabsContainer.getChildAt(i);\n            tabView.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);\n            TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);\n            tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);\n//            tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);\n            if (mTextAllCaps) {\n                tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());\n            }\n\n            if (mTextBold == TEXT_BOLD_BOTH) {\n                tv_tab_title.getPaint().setFakeBoldText(true);\n            } else if (mTextBold == TEXT_BOLD_NONE) {\n                tv_tab_title.getPaint().setFakeBoldText(false);\n            }\n        }\n    }\n\n    private void updateTabSelection(int position) {\n        for (int i = 0; i < mTabCount; ++i) {\n            View tabView = mTabsContainer.getChildAt(i);\n            final boolean isSelect = i == position;\n            TextView tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            tab_title.setTextColor(isSelect ? mTextSelectColor : mTextUnselectColor);\n            if (mTextBold == TEXT_BOLD_WHEN_SELECT) {\n                tab_title.getPaint().setFakeBoldText(isSelect);\n            }\n        }\n    }\n\n    private void calcOffset() {\n        final View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        mCurrentP.left = currentTabView.getLeft();\n        mCurrentP.right = currentTabView.getRight();\n\n        final View lastTabView = mTabsContainer.getChildAt(this.mLastTab);\n        mLastP.left = lastTabView.getLeft();\n        mLastP.right = lastTabView.getRight();\n\n//        Log.d(\"AAA\", \"mLastP--->\" + mLastP.left + \"&\" + mLastP.right);\n//        Log.d(\"AAA\", \"mCurrentP--->\" + mCurrentP.left + \"&\" + mCurrentP.right);\n        if (mLastP.left == mCurrentP.left && mLastP.right == mCurrentP.right) {\n            invalidate();\n        } else {\n            mValueAnimator.setObjectValues(mLastP, mCurrentP);\n            if (mIndicatorBounceEnable) {\n                mValueAnimator.setInterpolator(mInterpolator);\n            }\n\n            if (mIndicatorAnimDuration < 0) {\n                mIndicatorAnimDuration = mIndicatorBounceEnable ? 500 : 250;\n            }\n            mValueAnimator.setDuration(mIndicatorAnimDuration);\n            mValueAnimator.start();\n        }\n    }\n\n    private void calcIndicatorRect() {\n        View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        float left = currentTabView.getLeft();\n        float right = currentTabView.getRight();\n\n        mIndicatorRect.left = (int) left;\n        mIndicatorRect.right = (int) right;\n\n        if (!mIndicatorAnimEnable) {\n            if (mCurrentTab == 0) {\n                /**The corners are ordered top-left, top-right, bottom-right, bottom-left*/\n                mRadiusArr[0] = mIndicatorCornerRadius;\n                mRadiusArr[1] = mIndicatorCornerRadius;\n                mRadiusArr[2] = 0;\n                mRadiusArr[3] = 0;\n                mRadiusArr[4] = 0;\n                mRadiusArr[5] = 0;\n                mRadiusArr[6] = mIndicatorCornerRadius;\n                mRadiusArr[7] = mIndicatorCornerRadius;\n            } else if (mCurrentTab == mTabCount - 1) {\n                /**The corners are ordered top-left, top-right, bottom-right, bottom-left*/\n                mRadiusArr[0] = 0;\n                mRadiusArr[1] = 0;\n                mRadiusArr[2] = mIndicatorCornerRadius;\n                mRadiusArr[3] = mIndicatorCornerRadius;\n                mRadiusArr[4] = mIndicatorCornerRadius;\n                mRadiusArr[5] = mIndicatorCornerRadius;\n                mRadiusArr[6] = 0;\n                mRadiusArr[7] = 0;\n            } else {\n                /**The corners are ordered top-left, top-right, bottom-right, bottom-left*/\n                mRadiusArr[0] = 0;\n                mRadiusArr[1] = 0;\n                mRadiusArr[2] = 0;\n                mRadiusArr[3] = 0;\n                mRadiusArr[4] = 0;\n                mRadiusArr[5] = 0;\n                mRadiusArr[6] = 0;\n                mRadiusArr[7] = 0;\n            }\n        } else {\n            /**The corners are ordered top-left, top-right, bottom-right, bottom-left*/\n            mRadiusArr[0] = mIndicatorCornerRadius;\n            mRadiusArr[1] = mIndicatorCornerRadius;\n            mRadiusArr[2] = mIndicatorCornerRadius;\n            mRadiusArr[3] = mIndicatorCornerRadius;\n            mRadiusArr[4] = mIndicatorCornerRadius;\n            mRadiusArr[5] = mIndicatorCornerRadius;\n            mRadiusArr[6] = mIndicatorCornerRadius;\n            mRadiusArr[7] = mIndicatorCornerRadius;\n        }\n    }\n\n    @Override\n    public void onAnimationUpdate(ValueAnimator animation) {\n        IndicatorPoint p = (IndicatorPoint) animation.getAnimatedValue();\n        mIndicatorRect.left = (int) p.left;\n        mIndicatorRect.right = (int) p.right;\n        invalidate();\n    }\n\n    private boolean mIsFirstDraw = true;\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n\n        if (isInEditMode() || mTabCount <= 0) {\n            return;\n        }\n\n        int height = getHeight();\n        int paddingLeft = getPaddingLeft();\n\n        if (mIndicatorHeight < 0) {\n            mIndicatorHeight = height - mIndicatorMarginTop - mIndicatorMarginBottom;\n        }\n\n        if (mIndicatorCornerRadius < 0 || mIndicatorCornerRadius > mIndicatorHeight / 2) {\n            mIndicatorCornerRadius = mIndicatorHeight / 2;\n        }\n\n        //draw rect\n        mRectDrawable.setColor(mBarColor);\n        mRectDrawable.setStroke((int) mBarStrokeWidth, mBarStrokeColor);\n        mRectDrawable.setCornerRadius(mIndicatorCornerRadius);\n        mRectDrawable.setBounds(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(), getHeight() - getPaddingBottom());\n        mRectDrawable.draw(canvas);\n\n        // draw divider\n        if (!mIndicatorAnimEnable && mDividerWidth > 0) {\n            mDividerPaint.setStrokeWidth(mDividerWidth);\n            mDividerPaint.setColor(mDividerColor);\n            for (int i = 0; i < mTabCount - 1; i++) {\n                View tab = mTabsContainer.getChildAt(i);\n                canvas.drawLine(paddingLeft + tab.getRight(), mDividerPadding, paddingLeft + tab.getRight(), height - mDividerPadding, mDividerPaint);\n            }\n        }\n\n\n        //draw indicator line\n        if (mIndicatorAnimEnable) {\n            if (mIsFirstDraw) {\n                mIsFirstDraw = false;\n                calcIndicatorRect();\n            }\n        } else {\n            calcIndicatorRect();\n        }\n\n        mIndicatorDrawable.setColor(mIndicatorColor);\n        mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                (int) mIndicatorMarginTop, (int) (paddingLeft + mIndicatorRect.right - mIndicatorMarginRight),\n                (int) (mIndicatorMarginTop + mIndicatorHeight));\n        mIndicatorDrawable.setCornerRadii(mRadiusArr);\n        mIndicatorDrawable.draw(canvas);\n\n    }\n\n    //setter and getter\n    public void setCurrentTab(int currentTab) {\n        mLastTab = this.mCurrentTab;\n        this.mCurrentTab = currentTab;\n        updateTabSelection(currentTab);\n        if (mFragmentChangeManager != null) {\n            mFragmentChangeManager.setFragments(currentTab);\n        }\n        if (mIndicatorAnimEnable) {\n            calcOffset();\n        } else {\n            invalidate();\n        }\n    }\n\n    public void setTabPadding(float tabPadding) {\n        this.mTabPadding = dp2px(tabPadding);\n        updateTabStyles();\n    }\n\n    public void setTabSpaceEqual(boolean tabSpaceEqual) {\n        this.mTabSpaceEqual = tabSpaceEqual;\n        updateTabStyles();\n    }\n\n    public void setTabWidth(float tabWidth) {\n        this.mTabWidth = dp2px(tabWidth);\n        updateTabStyles();\n    }\n\n    public void setIndicatorColor(int indicatorColor) {\n        this.mIndicatorColor = indicatorColor;\n        invalidate();\n    }\n\n    public void setIndicatorHeight(float indicatorHeight) {\n        this.mIndicatorHeight = dp2px(indicatorHeight);\n        invalidate();\n    }\n\n    public void setIndicatorCornerRadius(float indicatorCornerRadius) {\n        this.mIndicatorCornerRadius = dp2px(indicatorCornerRadius);\n        invalidate();\n    }\n\n    public void setIndicatorMargin(float indicatorMarginLeft, float indicatorMarginTop,\n                                   float indicatorMarginRight, float indicatorMarginBottom) {\n        this.mIndicatorMarginLeft = dp2px(indicatorMarginLeft);\n        this.mIndicatorMarginTop = dp2px(indicatorMarginTop);\n        this.mIndicatorMarginRight = dp2px(indicatorMarginRight);\n        this.mIndicatorMarginBottom = dp2px(indicatorMarginBottom);\n        invalidate();\n    }\n\n    public void setIndicatorAnimDuration(long indicatorAnimDuration) {\n        this.mIndicatorAnimDuration = indicatorAnimDuration;\n    }\n\n    public void setIndicatorAnimEnable(boolean indicatorAnimEnable) {\n        this.mIndicatorAnimEnable = indicatorAnimEnable;\n    }\n\n    public void setIndicatorBounceEnable(boolean indicatorBounceEnable) {\n        this.mIndicatorBounceEnable = indicatorBounceEnable;\n    }\n\n    public void setDividerColor(int dividerColor) {\n        this.mDividerColor = dividerColor;\n        invalidate();\n    }\n\n    public void setDividerWidth(float dividerWidth) {\n        this.mDividerWidth = dp2px(dividerWidth);\n        invalidate();\n    }\n\n    public void setDividerPadding(float dividerPadding) {\n        this.mDividerPadding = dp2px(dividerPadding);\n        invalidate();\n    }\n\n    public void setTextsize(float textsize) {\n        this.mTextsize = sp2px(textsize);\n        updateTabStyles();\n    }\n\n    public void setTextSelectColor(int textSelectColor) {\n        this.mTextSelectColor = textSelectColor;\n        updateTabStyles();\n    }\n\n    public void setTextUnselectColor(int textUnselectColor) {\n        this.mTextUnselectColor = textUnselectColor;\n        updateTabStyles();\n    }\n\n    public void setTextBold(int textBold) {\n        this.mTextBold = textBold;\n        updateTabStyles();\n    }\n\n    public void setTextAllCaps(boolean textAllCaps) {\n        this.mTextAllCaps = textAllCaps;\n        updateTabStyles();\n    }\n\n    public int getTabCount() {\n        return mTabCount;\n    }\n\n    public int getCurrentTab() {\n        return mCurrentTab;\n    }\n\n    public float getTabPadding() {\n        return mTabPadding;\n    }\n\n    public boolean isTabSpaceEqual() {\n        return mTabSpaceEqual;\n    }\n\n    public float getTabWidth() {\n        return mTabWidth;\n    }\n\n    public int getIndicatorColor() {\n        return mIndicatorColor;\n    }\n\n    public float getIndicatorHeight() {\n        return mIndicatorHeight;\n    }\n\n    public float getIndicatorCornerRadius() {\n        return mIndicatorCornerRadius;\n    }\n\n    public float getIndicatorMarginLeft() {\n        return mIndicatorMarginLeft;\n    }\n\n    public float getIndicatorMarginTop() {\n        return mIndicatorMarginTop;\n    }\n\n    public float getIndicatorMarginRight() {\n        return mIndicatorMarginRight;\n    }\n\n    public float getIndicatorMarginBottom() {\n        return mIndicatorMarginBottom;\n    }\n\n    public long getIndicatorAnimDuration() {\n        return mIndicatorAnimDuration;\n    }\n\n    public boolean isIndicatorAnimEnable() {\n        return mIndicatorAnimEnable;\n    }\n\n    public boolean isIndicatorBounceEnable() {\n        return mIndicatorBounceEnable;\n    }\n\n    public int getDividerColor() {\n        return mDividerColor;\n    }\n\n    public float getDividerWidth() {\n        return mDividerWidth;\n    }\n\n    public float getDividerPadding() {\n        return mDividerPadding;\n    }\n\n    public float getTextsize() {\n        return mTextsize;\n    }\n\n    public int getTextSelectColor() {\n        return mTextSelectColor;\n    }\n\n    public int getTextUnselectColor() {\n        return mTextUnselectColor;\n    }\n\n    public int getTextBold() {\n        return mTextBold;\n    }\n\n    public boolean isTextAllCaps() {\n        return mTextAllCaps;\n    }\n\n    public TextView getTitleView(int tab) {\n        View tabView = mTabsContainer.getChildAt(tab);\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        return tv_tab_title;\n    }\n\n    //setter and getter\n    // show MsgTipView\n    private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private SparseArray<Boolean> mInitSetMap = new SparseArray<>();\n\n    /**\n     * 显示未读消息\n     *\n     * @param position 显示tab位置\n     * @param num      num小于等于0显示红点,num大于0显示数字\n     */\n    public void showMsg(int position, int num) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            UnreadMsgUtils.show(tipView, num);\n\n            if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {\n                return;\n            }\n\n            setMsgMargin(position, 2, 2);\n\n            mInitSetMap.put(position, true);\n        }\n    }\n\n    /**\n     * 显示未读红点\n     *\n     * @param position 显示tab位置\n     */\n    public void showDot(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        showMsg(position, 0);\n    }\n\n    public void hideMsg(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            tipView.setVisibility(View.GONE);\n        }\n    }\n\n    /**\n     * 设置提示红点偏移,注意\n     * 1.控件为固定高度:参照点为tab内容的右上角\n     * 2.控件高度不固定(WRAP_CONTENT):参照点为tab内容的右上角,此时高度已是红点的最高显示范围,所以这时bottomPadding其实就是topPadding\n     */\n    public void setMsgMargin(int position, float leftPadding, float bottomPadding) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            mTextPaint.setTextSize(mTextsize);\n            float textWidth = mTextPaint.measureText(tv_tab_title.getText().toString());\n            float textHeight = mTextPaint.descent() - mTextPaint.ascent();\n            MarginLayoutParams lp = (MarginLayoutParams) tipView.getLayoutParams();\n\n            lp.leftMargin = dp2px(leftPadding);\n            lp.topMargin = mHeight > 0 ? (int) (mHeight - textHeight) / 2 - dp2px(bottomPadding) : dp2px(bottomPadding);\n\n            tipView.setLayoutParams(lp);\n        }\n    }\n\n    /** 当前类只提供了少许设置未读消息属性的方法,可以通过该方法获取MsgView对象从而各种设置 */\n    public MsgView getMsgView(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        return tipView;\n    }\n\n    private OnTabSelectListener mListener;\n\n    public void setOnTabSelectListener(OnTabSelectListener listener) {\n        this.mListener = listener;\n    }\n\n    @Override\n    protected Parcelable onSaveInstanceState() {\n        Bundle bundle = new Bundle();\n        bundle.putParcelable(\"instanceState\", super.onSaveInstanceState());\n        bundle.putInt(\"mCurrentTab\", mCurrentTab);\n        return bundle;\n    }\n\n    @Override\n    protected void onRestoreInstanceState(Parcelable state) {\n        if (state instanceof Bundle) {\n            Bundle bundle = (Bundle) state;\n            mCurrentTab = bundle.getInt(\"mCurrentTab\");\n            state = bundle.getParcelable(\"instanceState\");\n            if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {\n                updateTabSelection(mCurrentTab);\n            }\n        }\n        super.onRestoreInstanceState(state);\n    }\n\n    class IndicatorPoint {\n        public float left;\n        public float right;\n    }\n\n    private IndicatorPoint mCurrentP = new IndicatorPoint();\n    private IndicatorPoint mLastP = new IndicatorPoint();\n\n    class PointEvaluator implements TypeEvaluator<IndicatorPoint> {\n        @Override\n        public IndicatorPoint evaluate(float fraction, IndicatorPoint startValue, IndicatorPoint endValue) {\n            float left = startValue.left + fraction * (endValue.left - startValue.left);\n            float right = startValue.right + fraction * (endValue.right - startValue.right);\n            IndicatorPoint point = new IndicatorPoint();\n            point.left = left;\n            point.right = right;\n            return point;\n        }\n    }\n\n    protected int dp2px(float dp) {\n        final float scale = mContext.getResources().getDisplayMetrics().density;\n        return (int) (dp * scale + 0.5f);\n    }\n\n    protected int sp2px(float sp) {\n        final float scale = this.mContext.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scale + 0.5f);\n    }\n}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/SlidingTabLayout.java",
    "content": "package com.flyco.tablayout;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.Rect;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Bundle;\nimport android.os.Parcelable;\nimport android.util.AttributeSet;\nimport android.util.SparseArray;\nimport android.util.TypedValue;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.HorizontalScrollView;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentActivity;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentPagerAdapter;\nimport androidx.viewpager.widget.PagerAdapter;\nimport androidx.viewpager.widget.ViewPager;\n\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.utils.UnreadMsgUtils;\nimport com.flyco.tablayout.widget.MsgView;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\n\n/** 滑动TabLayout,对于ViewPager的依赖性强 */\npublic class SlidingTabLayout extends HorizontalScrollView implements ViewPager.OnPageChangeListener {\n    private Context mContext;\n    private ViewPager mViewPager;\n    private ArrayList<String> mTitles;\n    private LinearLayout mTabsContainer;\n    private int mCurrentTab;\n    private float mCurrentPositionOffset;\n    private int mTabCount;\n    /** 用于绘制显示器 */\n    private Rect mIndicatorRect = new Rect();\n    /** 用于实现滚动居中 */\n    private Rect mTabRect = new Rect();\n    private GradientDrawable mIndicatorDrawable = new GradientDrawable();\n\n    private Paint mRectPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mDividerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mTrianglePaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Path mTrianglePath = new Path();\n    private static final int STYLE_NORMAL = 0;\n    private static final int STYLE_TRIANGLE = 1;\n    private static final int STYLE_BLOCK = 2;\n    private int mIndicatorStyle = STYLE_NORMAL;\n\n    private float mTabPadding;\n    private boolean mTabSpaceEqual;\n    private float mTabWidth;\n\n    /** indicator */\n    private int mIndicatorColor;\n    private float mIndicatorHeight;\n    private float mIndicatorWidth;\n    private float mIndicatorCornerRadius;\n    private float mIndicatorMarginLeft;\n    private float mIndicatorMarginTop;\n    private float mIndicatorMarginRight;\n    private float mIndicatorMarginBottom;\n    private int mIndicatorGravity;\n    private boolean mIndicatorWidthEqualTitle;\n\n    /** underline */\n    private int mUnderlineColor;\n    private float mUnderlineHeight;\n    private int mUnderlineGravity;\n\n    /** divider */\n    private int mDividerColor;\n    private float mDividerWidth;\n    private float mDividerPadding;\n\n    /** title */\n    private static final int TEXT_BOLD_NONE = 0;\n    private static final int TEXT_BOLD_WHEN_SELECT = 1;\n    private static final int TEXT_BOLD_BOTH = 2;\n    private float mTextsize;\n    private int mTextSelectColor;\n    private int mTextUnselectColor;\n    private int mTextBold;\n    private boolean mTextAllCaps;\n\n    private int mLastScrollX;\n    private int mHeight;\n    private boolean mSnapOnTabClick;\n\n    public SlidingTabLayout(Context context) {\n        this(context, null, 0);\n    }\n\n    public SlidingTabLayout(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public SlidingTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        setFillViewport(true);//设置滚动视图是否可以伸缩其内容以填充视口\n        setWillNotDraw(false);//重写onDraw方法,需要调用这个方法来清除flag\n        setClipChildren(false);\n        setClipToPadding(false);\n\n        this.mContext = context;\n        mTabsContainer = new LinearLayout(context);\n        addView(mTabsContainer);\n\n        obtainAttributes(context, attrs);\n\n        //get layout_height\n        String height = attrs.getAttributeValue(\"http://schemas.android.com/apk/res/android\", \"layout_height\");\n\n        if (height.equals(ViewGroup.LayoutParams.MATCH_PARENT + \"\")) {\n        } else if (height.equals(ViewGroup.LayoutParams.WRAP_CONTENT + \"\")) {\n        } else {\n            int[] systemAttrs = {android.R.attr.layout_height};\n            TypedArray a = context.obtainStyledAttributes(attrs, systemAttrs);\n            mHeight = a.getDimensionPixelSize(0, ViewGroup.LayoutParams.WRAP_CONTENT);\n            a.recycle();\n        }\n    }\n\n    private void obtainAttributes(Context context, AttributeSet attrs) {\n        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SlidingTabLayout);\n\n        mIndicatorStyle = ta.getInt(R.styleable.SlidingTabLayout_tl_indicator_style, STYLE_NORMAL);\n        mIndicatorColor = ta.getColor(R.styleable.SlidingTabLayout_tl_indicator_color, Color.parseColor(mIndicatorStyle == STYLE_BLOCK ? \"#4B6A87\" : \"#ffffff\"));\n        mIndicatorHeight = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_height,\n                dp2px(mIndicatorStyle == STYLE_TRIANGLE ? 4 : (mIndicatorStyle == STYLE_BLOCK ? -1 : 2)));\n        mIndicatorWidth = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_width, dp2px(mIndicatorStyle == STYLE_TRIANGLE ? 10 : -1));\n        mIndicatorCornerRadius = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_corner_radius, dp2px(mIndicatorStyle == STYLE_BLOCK ? -1 : 0));\n        mIndicatorMarginLeft = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_margin_left, dp2px(0));\n        mIndicatorMarginTop = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_margin_top, dp2px(mIndicatorStyle == STYLE_BLOCK ? 7 : 0));\n        mIndicatorMarginRight = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_margin_right, dp2px(0));\n        mIndicatorMarginBottom = ta.getDimension(R.styleable.SlidingTabLayout_tl_indicator_margin_bottom, dp2px(mIndicatorStyle == STYLE_BLOCK ? 7 : 0));\n        mIndicatorGravity = ta.getInt(R.styleable.SlidingTabLayout_tl_indicator_gravity, Gravity.BOTTOM);\n        mIndicatorWidthEqualTitle = ta.getBoolean(R.styleable.SlidingTabLayout_tl_indicator_width_equal_title, false);\n\n        mUnderlineColor = ta.getColor(R.styleable.SlidingTabLayout_tl_underline_color, Color.parseColor(\"#ffffff\"));\n        mUnderlineHeight = ta.getDimension(R.styleable.SlidingTabLayout_tl_underline_height, dp2px(0));\n        mUnderlineGravity = ta.getInt(R.styleable.SlidingTabLayout_tl_underline_gravity, Gravity.BOTTOM);\n\n        mDividerColor = ta.getColor(R.styleable.SlidingTabLayout_tl_divider_color, Color.parseColor(\"#ffffff\"));\n        mDividerWidth = ta.getDimension(R.styleable.SlidingTabLayout_tl_divider_width, dp2px(0));\n        mDividerPadding = ta.getDimension(R.styleable.SlidingTabLayout_tl_divider_padding, dp2px(12));\n\n        mTextsize = ta.getDimension(R.styleable.SlidingTabLayout_tl_textsize, sp2px(14));\n        mTextSelectColor = ta.getColor(R.styleable.SlidingTabLayout_tl_textSelectColor, Color.parseColor(\"#ffffff\"));\n        mTextUnselectColor = ta.getColor(R.styleable.SlidingTabLayout_tl_textUnselectColor, Color.parseColor(\"#AAffffff\"));\n        mTextBold = ta.getInt(R.styleable.SlidingTabLayout_tl_textBold, TEXT_BOLD_NONE);\n        mTextAllCaps = ta.getBoolean(R.styleable.SlidingTabLayout_tl_textAllCaps, false);\n\n        mTabSpaceEqual = ta.getBoolean(R.styleable.SlidingTabLayout_tl_tab_space_equal, false);\n        mTabWidth = ta.getDimension(R.styleable.SlidingTabLayout_tl_tab_width, dp2px(-1));\n        mTabPadding = ta.getDimension(R.styleable.SlidingTabLayout_tl_tab_padding, mTabSpaceEqual || mTabWidth > 0 ? dp2px(0) : dp2px(20));\n\n        ta.recycle();\n    }\n\n    /** 关联ViewPager */\n    public void setViewPager(ViewPager vp) {\n        if (vp == null || vp.getAdapter() == null) {\n            throw new IllegalStateException(\"ViewPager or ViewPager adapter can not be NULL !\");\n        }\n\n        this.mViewPager = vp;\n\n        this.mViewPager.removeOnPageChangeListener(this);\n        this.mViewPager.addOnPageChangeListener(this);\n        notifyDataSetChanged();\n    }\n\n    /** 关联ViewPager,用于不想在ViewPager适配器中设置titles数据的情况 */\n    public void setViewPager(ViewPager vp, String[] titles) {\n        if (vp == null || vp.getAdapter() == null) {\n            throw new IllegalStateException(\"ViewPager or ViewPager adapter can not be NULL !\");\n        }\n\n        if (titles == null || titles.length == 0) {\n            throw new IllegalStateException(\"Titles can not be EMPTY !\");\n        }\n\n        if (titles.length != vp.getAdapter().getCount()) {\n            throw new IllegalStateException(\"Titles length must be the same as the page count !\");\n        }\n\n        this.mViewPager = vp;\n        mTitles = new ArrayList<>();\n        Collections.addAll(mTitles, titles);\n\n        this.mViewPager.removeOnPageChangeListener(this);\n        this.mViewPager.addOnPageChangeListener(this);\n        notifyDataSetChanged();\n    }\n\n    /** 关联ViewPager,用于连适配器都不想自己实例化的情况 */\n    public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList<Fragment> fragments) {\n        if (vp == null) {\n            throw new IllegalStateException(\"ViewPager can not be NULL !\");\n        }\n\n        if (titles == null || titles.length == 0) {\n            throw new IllegalStateException(\"Titles can not be EMPTY !\");\n        }\n\n        this.mViewPager = vp;\n        this.mViewPager.setAdapter(new InnerPagerAdapter(fa.getSupportFragmentManager(), fragments, titles));\n\n        this.mViewPager.removeOnPageChangeListener(this);\n        this.mViewPager.addOnPageChangeListener(this);\n        notifyDataSetChanged();\n    }\n\n    /** 更新数据 */\n    public void notifyDataSetChanged() {\n        mTabsContainer.removeAllViews();\n        this.mTabCount = mTitles == null ? mViewPager.getAdapter().getCount() : mTitles.size();\n        View tabView;\n        for (int i = 0; i < mTabCount; i++) {\n            tabView = View.inflate(mContext, R.layout.layout_tab, null);\n            CharSequence pageTitle = mTitles == null ? mViewPager.getAdapter().getPageTitle(i) : mTitles.get(i);\n            addTab(i, pageTitle.toString(), tabView);\n        }\n\n        updateTabStyles();\n    }\n\n    public void addNewTab(String title) {\n        View tabView = View.inflate(mContext, R.layout.layout_tab, null);\n        if (mTitles != null) {\n            mTitles.add(title);\n        }\n\n        CharSequence pageTitle = mTitles == null ? mViewPager.getAdapter().getPageTitle(mTabCount) : mTitles.get(mTabCount);\n        addTab(mTabCount, pageTitle.toString(), tabView);\n        this.mTabCount = mTitles == null ? mViewPager.getAdapter().getCount() : mTitles.size();\n\n        updateTabStyles();\n    }\n\n    /** 创建并添加tab */\n    private void addTab(final int position, String title, View tabView) {\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        if (tv_tab_title != null) {\n            if (title != null) tv_tab_title.setText(title);\n        }\n\n        tabView.setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int position = mTabsContainer.indexOfChild(v);\n                if (position != -1) {\n                    if (mViewPager.getCurrentItem() != position) {\n                        if (mSnapOnTabClick) {\n                            mViewPager.setCurrentItem(position, false);\n                        } else {\n                            mViewPager.setCurrentItem(position);\n                        }\n\n                        if (mListener != null) {\n                            mListener.onTabSelect(position);\n                        }\n                    } else {\n                        if (mListener != null) {\n                            mListener.onTabReselect(position);\n                        }\n                    }\n                }\n            }\n        });\n\n        /** 每一个Tab的布局参数 */\n        LinearLayout.LayoutParams lp_tab = mTabSpaceEqual ?\n                new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f) :\n                new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);\n        if (mTabWidth > 0) {\n            lp_tab = new LinearLayout.LayoutParams((int) mTabWidth, LayoutParams.MATCH_PARENT);\n        }\n\n        mTabsContainer.addView(tabView, position, lp_tab);\n    }\n\n    private void updateTabStyles() {\n        for (int i = 0; i < mTabCount; i++) {\n            View v = mTabsContainer.getChildAt(i);\n//            v.setPadding((int) mTabPadding, v.getPaddingTop(), (int) mTabPadding, v.getPaddingBottom());\n            TextView tv_tab_title = (TextView) v.findViewById(R.id.tv_tab_title);\n            if (tv_tab_title != null) {\n                tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);\n                tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);\n                tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);\n                if (mTextAllCaps) {\n                    tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());\n                }\n\n                if (mTextBold == TEXT_BOLD_BOTH) {\n                    tv_tab_title.getPaint().setFakeBoldText(true);\n                } else if (mTextBold == TEXT_BOLD_NONE) {\n                    tv_tab_title.getPaint().setFakeBoldText(false);\n                }\n            }\n        }\n    }\n\n    @Override\n    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n        /**\n         * position:当前View的位置\n         * mCurrentPositionOffset:当前View的偏移量比例.[0,1)\n         */\n        this.mCurrentTab = position;\n        this.mCurrentPositionOffset = positionOffset;\n        scrollToCurrentTab();\n        invalidate();\n    }\n\n    @Override\n    public void onPageSelected(int position) {\n        updateTabSelection(position);\n    }\n\n    @Override\n    public void onPageScrollStateChanged(int state) {\n    }\n\n    /** HorizontalScrollView滚到当前tab,并且居中显示 */\n    private void scrollToCurrentTab() {\n        if (mTabCount <= 0) {\n            return;\n        }\n\n        int offset = (int) (mCurrentPositionOffset * mTabsContainer.getChildAt(mCurrentTab).getWidth());\n        /**当前Tab的left+当前Tab的Width乘以positionOffset*/\n        int newScrollX = mTabsContainer.getChildAt(mCurrentTab).getLeft() + offset;\n\n        if (mCurrentTab > 0 || offset > 0) {\n            /**HorizontalScrollView移动到当前tab,并居中*/\n            newScrollX -= getWidth() / 2 - getPaddingLeft();\n            calcIndicatorRect();\n            newScrollX += ((mTabRect.right - mTabRect.left) / 2);\n        }\n\n        if (newScrollX != mLastScrollX) {\n            mLastScrollX = newScrollX;\n            /** scrollTo（int x,int y）:x,y代表的不是坐标点,而是偏移量\n             *  x:表示离起始位置的x水平方向的偏移量\n             *  y:表示离起始位置的y垂直方向的偏移量\n             */\n            scrollTo(newScrollX, 0);\n        }\n    }\n\n    private void updateTabSelection(int position) {\n        for (int i = 0; i < mTabCount; ++i) {\n            View tabView = mTabsContainer.getChildAt(i);\n            final boolean isSelect = i == position;\n            TextView tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n\n            if (tab_title != null) {\n                tab_title.setTextColor(isSelect ? mTextSelectColor : mTextUnselectColor);\n                if (mTextBold == TEXT_BOLD_WHEN_SELECT) {\n                    tab_title.getPaint().setFakeBoldText(isSelect);\n                }\n            }\n        }\n    }\n\n    private float margin;\n\n    private void calcIndicatorRect() {\n        View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);\n        float left = currentTabView.getLeft();\n        float right = currentTabView.getRight();\n\n        //for mIndicatorWidthEqualTitle\n        if (mIndicatorStyle == STYLE_NORMAL && mIndicatorWidthEqualTitle) {\n            TextView tab_title = (TextView) currentTabView.findViewById(R.id.tv_tab_title);\n            mTextPaint.setTextSize(mTextsize);\n            float textWidth = mTextPaint.measureText(tab_title.getText().toString());\n            margin = (right - left - textWidth) / 2;\n        }\n\n        if (this.mCurrentTab < mTabCount - 1) {\n            View nextTabView = mTabsContainer.getChildAt(this.mCurrentTab + 1);\n            float nextTabLeft = nextTabView.getLeft();\n            float nextTabRight = nextTabView.getRight();\n\n            left = left + mCurrentPositionOffset * (nextTabLeft - left);\n            right = right + mCurrentPositionOffset * (nextTabRight - right);\n\n            //for mIndicatorWidthEqualTitle\n            if (mIndicatorStyle == STYLE_NORMAL && mIndicatorWidthEqualTitle) {\n                TextView next_tab_title = (TextView) nextTabView.findViewById(R.id.tv_tab_title);\n                mTextPaint.setTextSize(mTextsize);\n                float nextTextWidth = mTextPaint.measureText(next_tab_title.getText().toString());\n                float nextMargin = (nextTabRight - nextTabLeft - nextTextWidth) / 2;\n                margin = margin + mCurrentPositionOffset * (nextMargin - margin);\n            }\n        }\n\n        mIndicatorRect.left = (int) left;\n        mIndicatorRect.right = (int) right;\n        //for mIndicatorWidthEqualTitle\n        if (mIndicatorStyle == STYLE_NORMAL && mIndicatorWidthEqualTitle) {\n            mIndicatorRect.left = (int) (left + margin - 1);\n            mIndicatorRect.right = (int) (right - margin - 1);\n        }\n\n        mTabRect.left = (int) left;\n        mTabRect.right = (int) right;\n\n        if (mIndicatorWidth < 0) {   //indicatorWidth小于0时,原jpardogo's PagerSlidingTabStrip\n\n        } else {//indicatorWidth大于0时,圆角矩形以及三角形\n            float indicatorLeft = currentTabView.getLeft() + (currentTabView.getWidth() - mIndicatorWidth) / 2;\n\n            if (this.mCurrentTab < mTabCount - 1) {\n                View nextTab = mTabsContainer.getChildAt(this.mCurrentTab + 1);\n                indicatorLeft = indicatorLeft + mCurrentPositionOffset * (currentTabView.getWidth() / 2 + nextTab.getWidth() / 2);\n            }\n\n            mIndicatorRect.left = (int) indicatorLeft;\n            mIndicatorRect.right = (int) (mIndicatorRect.left + mIndicatorWidth);\n        }\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n\n        if (isInEditMode() || mTabCount <= 0) {\n            return;\n        }\n\n        int height = getHeight();\n        int paddingLeft = getPaddingLeft();\n        // draw divider\n        if (mDividerWidth > 0) {\n            mDividerPaint.setStrokeWidth(mDividerWidth);\n            mDividerPaint.setColor(mDividerColor);\n            for (int i = 0; i < mTabCount - 1; i++) {\n                View tab = mTabsContainer.getChildAt(i);\n                canvas.drawLine(paddingLeft + tab.getRight(), mDividerPadding, paddingLeft + tab.getRight(), height - mDividerPadding, mDividerPaint);\n            }\n        }\n\n        // draw underline\n        if (mUnderlineHeight > 0) {\n            mRectPaint.setColor(mUnderlineColor);\n            if (mUnderlineGravity == Gravity.BOTTOM) {\n                canvas.drawRect(paddingLeft, height - mUnderlineHeight, mTabsContainer.getWidth() + paddingLeft, height, mRectPaint);\n            } else {\n                canvas.drawRect(paddingLeft, 0, mTabsContainer.getWidth() + paddingLeft, mUnderlineHeight, mRectPaint);\n            }\n        }\n\n        //draw indicator line\n\n        calcIndicatorRect();\n        if (mIndicatorStyle == STYLE_TRIANGLE) {\n            if (mIndicatorHeight > 0) {\n                mTrianglePaint.setColor(mIndicatorColor);\n                mTrianglePath.reset();\n                mTrianglePath.moveTo(paddingLeft + mIndicatorRect.left, height);\n                mTrianglePath.lineTo(paddingLeft + mIndicatorRect.left / 2 + mIndicatorRect.right / 2, height - mIndicatorHeight);\n                mTrianglePath.lineTo(paddingLeft + mIndicatorRect.right, height);\n                mTrianglePath.close();\n                canvas.drawPath(mTrianglePath, mTrianglePaint);\n            }\n        } else if (mIndicatorStyle == STYLE_BLOCK) {\n            if (mIndicatorHeight < 0) {\n                mIndicatorHeight = height - mIndicatorMarginTop - mIndicatorMarginBottom;\n            } else {\n\n            }\n\n            if (mIndicatorHeight > 0) {\n                if (mIndicatorCornerRadius < 0 || mIndicatorCornerRadius > mIndicatorHeight / 2) {\n                    mIndicatorCornerRadius = mIndicatorHeight / 2;\n                }\n\n                mIndicatorDrawable.setColor(mIndicatorColor);\n                mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                        (int) mIndicatorMarginTop, (int) (paddingLeft + mIndicatorRect.right - mIndicatorMarginRight),\n                        (int) (mIndicatorMarginTop + mIndicatorHeight));\n                mIndicatorDrawable.setCornerRadius(mIndicatorCornerRadius);\n                mIndicatorDrawable.draw(canvas);\n            }\n        } else {\n               /* mRectPaint.setColor(mIndicatorColor);\n                calcIndicatorRect();\n                canvas.drawRect(getPaddingLeft() + mIndicatorRect.left, getHeight() - mIndicatorHeight,\n                        mIndicatorRect.right + getPaddingLeft(), getHeight(), mRectPaint);*/\n\n            if (mIndicatorHeight > 0) {\n                mIndicatorDrawable.setColor(mIndicatorColor);\n\n                if (mIndicatorGravity == Gravity.BOTTOM) {\n                    mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                            height - (int) mIndicatorHeight - (int) mIndicatorMarginBottom,\n                            paddingLeft + mIndicatorRect.right - (int) mIndicatorMarginRight,\n                            height - (int) mIndicatorMarginBottom);\n                } else {\n                    mIndicatorDrawable.setBounds(paddingLeft + (int) mIndicatorMarginLeft + mIndicatorRect.left,\n                            (int) mIndicatorMarginTop,\n                            paddingLeft + mIndicatorRect.right - (int) mIndicatorMarginRight,\n                            (int) mIndicatorHeight + (int) mIndicatorMarginTop);\n                }\n                mIndicatorDrawable.setCornerRadius(mIndicatorCornerRadius);\n                mIndicatorDrawable.draw(canvas);\n            }\n        }\n    }\n\n    //setter and getter\n    public void setCurrentTab(int currentTab) {\n        this.mCurrentTab = currentTab;\n        mViewPager.setCurrentItem(currentTab);\n\n    }\n\n    public void setCurrentTab(int currentTab, boolean smoothScroll) {\n        this.mCurrentTab = currentTab;\n        mViewPager.setCurrentItem(currentTab, smoothScroll);\n    }\n\n    public void setIndicatorStyle(int indicatorStyle) {\n        this.mIndicatorStyle = indicatorStyle;\n        invalidate();\n    }\n\n    public void setTabPadding(float tabPadding) {\n        this.mTabPadding = dp2px(tabPadding);\n        updateTabStyles();\n    }\n\n    public void setTabSpaceEqual(boolean tabSpaceEqual) {\n        this.mTabSpaceEqual = tabSpaceEqual;\n        updateTabStyles();\n    }\n\n    public void setTabWidth(float tabWidth) {\n        this.mTabWidth = dp2px(tabWidth);\n        updateTabStyles();\n    }\n\n    public void setIndicatorColor(int indicatorColor) {\n        this.mIndicatorColor = indicatorColor;\n        invalidate();\n    }\n\n    public void setIndicatorHeight(float indicatorHeight) {\n        this.mIndicatorHeight = dp2px(indicatorHeight);\n        invalidate();\n    }\n\n    public void setIndicatorWidth(float indicatorWidth) {\n        this.mIndicatorWidth = dp2px(indicatorWidth);\n        invalidate();\n    }\n\n    public void setIndicatorCornerRadius(float indicatorCornerRadius) {\n        this.mIndicatorCornerRadius = dp2px(indicatorCornerRadius);\n        invalidate();\n    }\n\n    public void setIndicatorGravity(int indicatorGravity) {\n        this.mIndicatorGravity = indicatorGravity;\n        invalidate();\n    }\n\n    public void setIndicatorMargin(float indicatorMarginLeft, float indicatorMarginTop,\n                                   float indicatorMarginRight, float indicatorMarginBottom) {\n        this.mIndicatorMarginLeft = dp2px(indicatorMarginLeft);\n        this.mIndicatorMarginTop = dp2px(indicatorMarginTop);\n        this.mIndicatorMarginRight = dp2px(indicatorMarginRight);\n        this.mIndicatorMarginBottom = dp2px(indicatorMarginBottom);\n        invalidate();\n    }\n\n    public void setIndicatorWidthEqualTitle(boolean indicatorWidthEqualTitle) {\n        this.mIndicatorWidthEqualTitle = indicatorWidthEqualTitle;\n        invalidate();\n    }\n\n    public void setUnderlineColor(int underlineColor) {\n        this.mUnderlineColor = underlineColor;\n        invalidate();\n    }\n\n    public void setUnderlineHeight(float underlineHeight) {\n        this.mUnderlineHeight = dp2px(underlineHeight);\n        invalidate();\n    }\n\n    public void setUnderlineGravity(int underlineGravity) {\n        this.mUnderlineGravity = underlineGravity;\n        invalidate();\n    }\n\n    public void setDividerColor(int dividerColor) {\n        this.mDividerColor = dividerColor;\n        invalidate();\n    }\n\n    public void setDividerWidth(float dividerWidth) {\n        this.mDividerWidth = dp2px(dividerWidth);\n        invalidate();\n    }\n\n    public void setDividerPadding(float dividerPadding) {\n        this.mDividerPadding = dp2px(dividerPadding);\n        invalidate();\n    }\n\n    public void setTextsize(float textsize) {\n        this.mTextsize = sp2px(textsize);\n        updateTabStyles();\n    }\n\n    public void setTextSelectColor(int textSelectColor) {\n        this.mTextSelectColor = textSelectColor;\n        updateTabStyles();\n    }\n\n    public void setTextUnselectColor(int textUnselectColor) {\n        this.mTextUnselectColor = textUnselectColor;\n        updateTabStyles();\n    }\n\n    public void setTextBold(int textBold) {\n        this.mTextBold = textBold;\n        updateTabStyles();\n    }\n\n    public void setTextAllCaps(boolean textAllCaps) {\n        this.mTextAllCaps = textAllCaps;\n        updateTabStyles();\n    }\n\n    public void setSnapOnTabClick(boolean snapOnTabClick) {\n        mSnapOnTabClick = snapOnTabClick;\n    }\n\n\n    public int getTabCount() {\n        return mTabCount;\n    }\n\n    public int getCurrentTab() {\n        return mCurrentTab;\n    }\n\n    public int getIndicatorStyle() {\n        return mIndicatorStyle;\n    }\n\n    public float getTabPadding() {\n        return mTabPadding;\n    }\n\n    public boolean isTabSpaceEqual() {\n        return mTabSpaceEqual;\n    }\n\n    public float getTabWidth() {\n        return mTabWidth;\n    }\n\n    public int getIndicatorColor() {\n        return mIndicatorColor;\n    }\n\n    public float getIndicatorHeight() {\n        return mIndicatorHeight;\n    }\n\n    public float getIndicatorWidth() {\n        return mIndicatorWidth;\n    }\n\n    public float getIndicatorCornerRadius() {\n        return mIndicatorCornerRadius;\n    }\n\n    public float getIndicatorMarginLeft() {\n        return mIndicatorMarginLeft;\n    }\n\n    public float getIndicatorMarginTop() {\n        return mIndicatorMarginTop;\n    }\n\n    public float getIndicatorMarginRight() {\n        return mIndicatorMarginRight;\n    }\n\n    public float getIndicatorMarginBottom() {\n        return mIndicatorMarginBottom;\n    }\n\n    public int getUnderlineColor() {\n        return mUnderlineColor;\n    }\n\n    public float getUnderlineHeight() {\n        return mUnderlineHeight;\n    }\n\n    public int getDividerColor() {\n        return mDividerColor;\n    }\n\n    public float getDividerWidth() {\n        return mDividerWidth;\n    }\n\n    public float getDividerPadding() {\n        return mDividerPadding;\n    }\n\n    public float getTextsize() {\n        return mTextsize;\n    }\n\n    public int getTextSelectColor() {\n        return mTextSelectColor;\n    }\n\n    public int getTextUnselectColor() {\n        return mTextUnselectColor;\n    }\n\n    public int getTextBold() {\n        return mTextBold;\n    }\n\n    public boolean isTextAllCaps() {\n        return mTextAllCaps;\n    }\n\n    public TextView getTitleView(int tab) {\n        View tabView = mTabsContainer.getChildAt(tab);\n        TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n        return tv_tab_title;\n    }\n\n    //setter and getter\n\n    // show MsgTipView\n    private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private SparseArray<Boolean> mInitSetMap = new SparseArray<>();\n\n    /**\n     * 显示未读消息\n     *\n     * @param position 显示tab位置\n     * @param num      num小于等于0显示红点,num大于0显示数字\n     */\n    public void showMsg(int position, int num) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            UnreadMsgUtils.show(tipView, num);\n\n            if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {\n                return;\n            }\n\n            setMsgMargin(position, 4, 2);\n            mInitSetMap.put(position, true);\n        }\n    }\n\n    /**\n     * 显示未读红点\n     *\n     * @param position 显示tab位置\n     */\n    public void showDot(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        showMsg(position, 0);\n    }\n\n    /** 隐藏未读消息 */\n    public void hideMsg(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            tipView.setVisibility(View.GONE);\n        }\n    }\n\n    /** 设置未读消息偏移,原点为文字的右上角.当控件高度固定,消息提示位置易控制,显示效果佳 */\n    public void setMsgMargin(int position, float leftPadding, float bottomPadding) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        if (tipView != null) {\n            TextView tv_tab_title = (TextView) tabView.findViewById(R.id.tv_tab_title);\n            mTextPaint.setTextSize(mTextsize);\n            float textWidth = mTextPaint.measureText(tv_tab_title.getText().toString());\n            float textHeight = mTextPaint.descent() - mTextPaint.ascent();\n            MarginLayoutParams lp = (MarginLayoutParams) tipView.getLayoutParams();\n            lp.leftMargin = mTabWidth >= 0 ? (int) (mTabWidth / 2 + textWidth / 2 + dp2px(leftPadding)) : (int) (mTabPadding + textWidth + dp2px(leftPadding));\n            lp.topMargin = mHeight > 0 ? (int) (mHeight - textHeight) / 2 - dp2px(bottomPadding) : 0;\n            tipView.setLayoutParams(lp);\n        }\n    }\n\n    /** 当前类只提供了少许设置未读消息属性的方法,可以通过该方法获取MsgView对象从而各种设置 */\n    public MsgView getMsgView(int position) {\n        if (position >= mTabCount) {\n            position = mTabCount - 1;\n        }\n        View tabView = mTabsContainer.getChildAt(position);\n        MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);\n        return tipView;\n    }\n\n    private OnTabSelectListener mListener;\n\n    public void setOnTabSelectListener(OnTabSelectListener listener) {\n        this.mListener = listener;\n    }\n\n    class InnerPagerAdapter extends FragmentPagerAdapter {\n        private ArrayList<Fragment> fragments = new ArrayList<>();\n        private String[] titles;\n\n        public InnerPagerAdapter(FragmentManager fm, ArrayList<Fragment> fragments, String[] titles) {\n            super(fm);\n            this.fragments = fragments;\n            this.titles = titles;\n        }\n\n        @Override\n        public int getCount() {\n            return fragments.size();\n        }\n\n        @Override\n        public CharSequence getPageTitle(int position) {\n            return titles[position];\n        }\n\n        @Override\n        public Fragment getItem(int position) {\n            return fragments.get(position);\n        }\n\n        @Override\n        public void destroyItem(ViewGroup container, int position, Object object) {\n            // 覆写destroyItem并且空实现,这样每个Fragment中的视图就不会被销毁\n            // super.destroyItem(container, position, object);\n        }\n\n        @Override\n        public int getItemPosition(Object object) {\n            return PagerAdapter.POSITION_NONE;\n        }\n    }\n\n    @Override\n    protected Parcelable onSaveInstanceState() {\n        Bundle bundle = new Bundle();\n        bundle.putParcelable(\"instanceState\", super.onSaveInstanceState());\n        bundle.putInt(\"mCurrentTab\", mCurrentTab);\n        return bundle;\n    }\n\n    @Override\n    protected void onRestoreInstanceState(Parcelable state) {\n        if (state instanceof Bundle) {\n            Bundle bundle = (Bundle) state;\n            mCurrentTab = bundle.getInt(\"mCurrentTab\");\n            state = bundle.getParcelable(\"instanceState\");\n            if (mCurrentTab != 0 && mTabsContainer.getChildCount() > 0) {\n                updateTabSelection(mCurrentTab);\n                scrollToCurrentTab();\n            }\n        }\n        super.onRestoreInstanceState(state);\n    }\n\n    protected int dp2px(float dp) {\n        final float scale = mContext.getResources().getDisplayMetrics().density;\n        return (int) (dp * scale + 0.5f);\n    }\n\n    protected int sp2px(float sp) {\n        final float scale = this.mContext.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scale + 0.5f);\n    }\n}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/listener/CustomTabEntity.java",
    "content": "package com.flyco.tablayout.listener;\n\nimport androidx.annotation.DrawableRes;\n\npublic interface CustomTabEntity {\n    String getTabTitle();\n\n    @DrawableRes\n    int getTabSelectedIcon();\n\n    @DrawableRes\n    int getTabUnselectedIcon();\n}"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/listener/OnTabSelectListener.java",
    "content": "package com.flyco.tablayout.listener;\n\npublic interface OnTabSelectListener {\n    void onTabSelect(int position);\n    void onTabReselect(int position);\n}"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/utils/FragmentChangeManager.java",
    "content": "package com.flyco.tablayout.utils;\n\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentTransaction;\n\nimport java.util.ArrayList;\n\npublic class FragmentChangeManager {\n    private FragmentManager mFragmentManager;\n    private int mContainerViewId;\n    /** Fragment切换数组 */\n    private ArrayList<Fragment> mFragments;\n    /** 当前选中的Tab */\n    private int mCurrentTab;\n\n    public FragmentChangeManager(FragmentManager fm, int containerViewId, ArrayList<Fragment> fragments) {\n        this.mFragmentManager = fm;\n        this.mContainerViewId = containerViewId;\n        this.mFragments = fragments;\n        initFragments();\n    }\n\n    /** 初始化fragments */\n    private void initFragments() {\n        for (Fragment fragment : mFragments) {\n            mFragmentManager.beginTransaction().add(mContainerViewId, fragment).hide(fragment).commit();\n        }\n\n        setFragments(0);\n    }\n\n    /** 界面切换控制 */\n    public void setFragments(int index) {\n        for (int i = 0; i < mFragments.size(); i++) {\n            FragmentTransaction ft = mFragmentManager.beginTransaction();\n            Fragment fragment = mFragments.get(i);\n            if (i == index) {\n                ft.show(fragment);\n            } else {\n                ft.hide(fragment);\n            }\n            ft.commit();\n        }\n        mCurrentTab = index;\n    }\n\n    public int getCurrentTab() {\n        return mCurrentTab;\n    }\n\n    public Fragment getCurrentFragment() {\n        return mFragments.get(mCurrentTab);\n    }\n}"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/utils/UnreadMsgUtils.java",
    "content": "package com.flyco.tablayout.utils;\n\n\nimport android.util.DisplayMetrics;\nimport android.view.View;\nimport android.widget.RelativeLayout;\n\nimport com.flyco.tablayout.widget.MsgView;\n\n/**\n * 未读消息提示View,显示小红点或者带有数字的红点:\n * 数字一位,圆\n * 数字两位,圆角矩形,圆角是高度的一半\n * 数字超过两位,显示99+\n */\npublic class UnreadMsgUtils {\n    public static void show(MsgView msgView, int num) {\n        if (msgView == null) {\n            return;\n        }\n        RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) msgView.getLayoutParams();\n        DisplayMetrics dm = msgView.getResources().getDisplayMetrics();\n        msgView.setVisibility(View.VISIBLE);\n        if (num <= 0) {//圆点,设置默认宽高\n            msgView.setStrokeWidth(0);\n            msgView.setText(\"\");\n\n            lp.width = (int) (5 * dm.density);\n            lp.height = (int) (5 * dm.density);\n            msgView.setLayoutParams(lp);\n        } else {\n            lp.height = (int) (18 * dm.density);\n            if (num > 0 && num < 10) {//圆\n                lp.width = (int) (18 * dm.density);\n                msgView.setText(num + \"\");\n            } else if (num > 9 && num < 100) {//圆角矩形,圆角是高度的一半,设置默认padding\n                lp.width = RelativeLayout.LayoutParams.WRAP_CONTENT;\n                msgView.setPadding((int) (6 * dm.density), 0, (int) (6 * dm.density), 0);\n                msgView.setText(num + \"\");\n            } else {//数字超过两位,显示99+\n                lp.width = RelativeLayout.LayoutParams.WRAP_CONTENT;\n                msgView.setPadding((int) (6 * dm.density), 0, (int) (6 * dm.density), 0);\n                msgView.setText(\"99+\");\n            }\n            msgView.setLayoutParams(lp);\n        }\n    }\n\n    public static void setSize(MsgView rtv, int size) {\n        if (rtv == null) {\n            return;\n        }\n        RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) rtv.getLayoutParams();\n        lp.width = size;\n        lp.height = size;\n        rtv.setLayoutParams(lp);\n    }\n}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/widget/MsgView.java",
    "content": "package com.flyco.tablayout.widget;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Color;\nimport android.graphics.drawable.GradientDrawable;\nimport android.graphics.drawable.StateListDrawable;\nimport android.os.Build;\nimport android.util.AttributeSet;\nimport android.widget.TextView;\n\nimport com.flyco.tablayout.R;\n\n/** 用于需要圆角矩形框背景的TextView的情况,减少直接使用TextView时引入的shape资源文件 */\npublic class MsgView extends TextView {\n    private Context context;\n    private GradientDrawable gd_background = new GradientDrawable();\n    private int backgroundColor;\n    private int cornerRadius;\n    private int strokeWidth;\n    private int strokeColor;\n    private boolean isRadiusHalfHeight;\n    private boolean isWidthHeightEqual;\n\n    public MsgView(Context context) {\n        this(context, null);\n    }\n\n    public MsgView(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public MsgView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        this.context = context;\n        obtainAttributes(context, attrs);\n    }\n\n    private void obtainAttributes(Context context, AttributeSet attrs) {\n        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MsgView);\n        backgroundColor = ta.getColor(R.styleable.MsgView_mv_backgroundColor, Color.TRANSPARENT);\n        cornerRadius = ta.getDimensionPixelSize(R.styleable.MsgView_mv_cornerRadius, 0);\n        strokeWidth = ta.getDimensionPixelSize(R.styleable.MsgView_mv_strokeWidth, 0);\n        strokeColor = ta.getColor(R.styleable.MsgView_mv_strokeColor, Color.TRANSPARENT);\n        isRadiusHalfHeight = ta.getBoolean(R.styleable.MsgView_mv_isRadiusHalfHeight, false);\n        isWidthHeightEqual = ta.getBoolean(R.styleable.MsgView_mv_isWidthHeightEqual, false);\n\n        ta.recycle();\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        if (isWidthHeightEqual() && getWidth() > 0 && getHeight() > 0) {\n            int max = Math.max(getWidth(), getHeight());\n            int measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY);\n            super.onMeasure(measureSpec, measureSpec);\n            return;\n        }\n\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        if (isRadiusHalfHeight()) {\n            setCornerRadius(getHeight() / 2);\n        } else {\n            setBgSelector();\n        }\n    }\n\n\n    public void setBackgroundColor(int backgroundColor) {\n        this.backgroundColor = backgroundColor;\n        setBgSelector();\n    }\n\n    public void setCornerRadius(int cornerRadius) {\n        this.cornerRadius = dp2px(cornerRadius);\n        setBgSelector();\n    }\n\n    public void setStrokeWidth(int strokeWidth) {\n        this.strokeWidth = dp2px(strokeWidth);\n        setBgSelector();\n    }\n\n    public void setStrokeColor(int strokeColor) {\n        this.strokeColor = strokeColor;\n        setBgSelector();\n    }\n\n    public void setIsRadiusHalfHeight(boolean isRadiusHalfHeight) {\n        this.isRadiusHalfHeight = isRadiusHalfHeight;\n        setBgSelector();\n    }\n\n    public void setIsWidthHeightEqual(boolean isWidthHeightEqual) {\n        this.isWidthHeightEqual = isWidthHeightEqual;\n        setBgSelector();\n    }\n\n    public int getBackgroundColor() {\n        return backgroundColor;\n    }\n\n    public int getCornerRadius() {\n        return cornerRadius;\n    }\n\n    public int getStrokeWidth() {\n        return strokeWidth;\n    }\n\n    public int getStrokeColor() {\n        return strokeColor;\n    }\n\n    public boolean isRadiusHalfHeight() {\n        return isRadiusHalfHeight;\n    }\n\n    public boolean isWidthHeightEqual() {\n        return isWidthHeightEqual;\n    }\n\n    protected int dp2px(float dp) {\n        final float scale = context.getResources().getDisplayMetrics().density;\n        return (int) (dp * scale + 0.5f);\n    }\n\n    protected int sp2px(float sp) {\n        final float scale = this.context.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scale + 0.5f);\n    }\n\n    private void setDrawable(GradientDrawable gd, int color, int strokeColor) {\n        gd.setColor(color);\n        gd.setCornerRadius(cornerRadius);\n        gd.setStroke(strokeWidth, strokeColor);\n    }\n\n    public void setBgSelector() {\n        StateListDrawable bg = new StateListDrawable();\n\n        setDrawable(gd_background, backgroundColor, strokeColor);\n        bg.addState(new int[]{-android.R.attr.state_pressed}, gd_background);\n\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {//16\n            setBackground(bg);\n        } else {\n            //noinspection deprecation\n            setBackgroundDrawable(bg);\n        }\n    }\n}\n"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <TextView\n        android:id=\"@+id/tv_tab_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:singleLine=\"true\"/>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab_bottom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <LinearLayout\n        android:id=\"@+id/ll_tap\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:id=\"@+id/tv_tab_title\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"/>\n\n        <ImageView\n            android:id=\"@+id/iv_tab_icon\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"/>\n\n    </LinearLayout>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_toRightOf=\"@+id/ll_tap\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab_left.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <LinearLayout\n        android:id=\"@+id/ll_tap\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"horizontal\">\n\n        <ImageView\n            android:id=\"@+id/iv_tab_icon\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"/>\n\n        <TextView\n            android:id=\"@+id/tv_tab_title\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"/>\n    </LinearLayout>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:layout_toRightOf=\"@+id/ll_tap\"\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab_right.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <LinearLayout\n        android:id=\"@+id/ll_tap\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"horizontal\">\n\n        <TextView\n            android:id=\"@+id/tv_tab_title\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"/>\n\n        <ImageView\n            android:id=\"@+id/iv_tab_icon\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"/>\n\n    </LinearLayout>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_toRightOf=\"@+id/ll_tap\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab_segment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <LinearLayout\n        android:id=\"@+id/ll_tap\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"horizontal\">\n\n        <TextView\n            android:id=\"@+id/tv_tab_title\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"/>\n    </LinearLayout>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:layout_toRightOf=\"@+id/ll_tap\"\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/layout/layout_tab_top.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\n    android:clipToPadding=\"false\">\n\n    <LinearLayout\n        android:id=\"@+id/ll_tap\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"vertical\">\n\n        <ImageView\n            android:id=\"@+id/iv_tab_icon\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"/>\n\n        <TextView\n            android:id=\"@+id/tv_tab_title\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"/>\n    </LinearLayout>\n\n    <com.flyco.tablayout.widget.MsgView\n        android:id=\"@+id/rtv_msg_tip\"\n        xmlns:mv=\"http://schemas.android.com/apk/res-auto\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_toRightOf=\"@+id/ll_tap\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffff\"\n        android:textSize=\"11.5sp\"\n        android:visibility=\"gone\"\n        mv:mv_backgroundColor=\"#FD481F\"\n        mv:mv_isRadiusHalfHeight=\"true\"\n        mv:mv_strokeColor=\"#ffffff\"\n        mv:mv_strokeWidth=\"1dp\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "FlycoTabLayout_Lib/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- indicator -->\n    <!-- 设置显示器颜色 -->\n    <attr name=\"tl_indicator_color\" format=\"color\"/>\n    <!-- 设置显示器高度 -->\n    <attr name=\"tl_indicator_height\" format=\"dimension\"/>\n    <!-- 设置显示器固定宽度 -->\n    <attr name=\"tl_indicator_width\" format=\"dimension\"/>\n    <!-- 设置显示器margin,当indicator_width大于0,无效 -->\n    <attr name=\"tl_indicator_margin_left\" format=\"dimension\"/>\n    <attr name=\"tl_indicator_margin_top\" format=\"dimension\"/>\n    <attr name=\"tl_indicator_margin_right\" format=\"dimension\"/>\n    <attr name=\"tl_indicator_margin_bottom\" format=\"dimension\"/>\n    <!-- 设置显示器圆角弧度-->\n    <attr name=\"tl_indicator_corner_radius\" format=\"dimension\"/>\n    <!-- 设置显示器上方还是下方,只对圆角矩形有用-->\n    <attr name=\"tl_indicator_gravity\" format=\"enum\">\n        <enum name=\"TOP\" value=\"48\"/>\n        <enum name=\"BOTTOM\" value=\"80\"/>\n    </attr>\n    <!-- 设置显示器为常规|三角形|背景色块|-->\n    <attr name=\"tl_indicator_style\" format=\"enum\">\n        <enum name=\"NORMAL\" value=\"0\"/>\n        <enum name=\"TRIANGLE\" value=\"1\"/>\n        <enum name=\"BLOCK\" value=\"2\"/>\n    </attr>\n    <!-- 设置显示器长度与title一样长,只有在STYLE_NORMAL并且indicatorWidth小于零有效-->\n    <attr name=\"tl_indicator_width_equal_title\" format=\"boolean\"/>\n    <!-- 设置显示器支持动画-->\n    <attr name=\"tl_indicator_anim_enable\" format=\"boolean\"/>\n    <!-- 设置显示器动画时间-->\n    <attr name=\"tl_indicator_anim_duration\" format=\"integer\"/>\n    <!-- 设置显示器支持动画回弹效果-->\n    <attr name=\"tl_indicator_bounce_enable\" format=\"boolean\"/>\n\n    <!-- underline -->\n    <!-- 设置下划线颜色 -->\n    <attr name=\"tl_underline_color\" format=\"color\"/>\n    <!-- 设置下划线高度 -->\n    <attr name=\"tl_underline_height\" format=\"dimension\"/>\n    <!-- 设置下划线上方还是下方-->\n    <attr name=\"tl_underline_gravity\" format=\"enum\">\n        <enum name=\"TOP\" value=\"48\"/>\n        <enum name=\"BOTTOM\" value=\"80\"/>\n    </attr>\n\n    <!-- divider -->\n    <!-- 设置分割线颜色 -->\n    <attr name=\"tl_divider_color\" format=\"color\"/>\n    <!-- 设置分割线宽度 -->\n    <attr name=\"tl_divider_width\" format=\"dimension\"/>\n    <!-- 设置分割线的paddingTop和paddingBottom -->\n    <attr name=\"tl_divider_padding\" format=\"dimension\"/>\n\n    <!-- tab -->\n    <!-- 设置tab的paddingLeft和paddingRight -->\n    <attr name=\"tl_tab_padding\" format=\"dimension\"/>\n    <!-- 设置tab大小等分 -->\n    <attr name=\"tl_tab_space_equal\" format=\"boolean\"/>\n    <!-- 设置tab固定大小 -->\n    <attr name=\"tl_tab_width\" format=\"dimension\"/>\n\n    <!-- title -->\n    <!-- 设置字体大小 -->\n    <attr name=\"tl_textsize\" format=\"dimension\"/>\n    <!-- 设置字体选中颜色 -->\n    <attr name=\"tl_textSelectColor\" format=\"color\"/>\n    <!-- 设置字体未选中颜色 -->\n    <attr name=\"tl_textUnselectColor\" format=\"color\"/>\n    <!-- 设置字体加粗 -->\n    <attr name=\"tl_textBold\" format=\"enum\">\n        <enum name=\"NONE\" value=\"0\"/>\n        <enum name=\"SELECT\" value=\"1\"/>\n        <enum name=\"BOTH\" value=\"2\"/>\n    </attr>\n    <!-- 设置字体全大写 -->\n    <attr name=\"tl_textAllCaps\" format=\"boolean\"/>\n\n    <declare-styleable name=\"SlidingTabLayout\">\n        <!-- indicator -->\n        <attr name=\"tl_indicator_color\"/>\n        <attr name=\"tl_indicator_height\"/>\n        <attr name=\"tl_indicator_width\"/>\n        <attr name=\"tl_indicator_margin_left\"/>\n        <attr name=\"tl_indicator_margin_top\"/>\n        <attr name=\"tl_indicator_margin_right\"/>\n        <attr name=\"tl_indicator_margin_bottom\"/>\n        <attr name=\"tl_indicator_corner_radius\"/>\n        <attr name=\"tl_indicator_gravity\"/>\n        <attr name=\"tl_indicator_style\"/>\n        <attr name=\"tl_indicator_width_equal_title\"/>\n\n        <!-- underline -->\n        <attr name=\"tl_underline_color\"/>\n        <attr name=\"tl_underline_height\"/>\n        <attr name=\"tl_underline_gravity\"/>\n\n        <!-- divider -->\n        <attr name=\"tl_divider_color\"/>\n        <attr name=\"tl_divider_width\"/>\n        <attr name=\"tl_divider_padding\"/>\n\n        <!-- tab -->\n        <attr name=\"tl_tab_padding\"/>\n        <attr name=\"tl_tab_space_equal\"/>\n        <attr name=\"tl_tab_width\"/>\n\n        <!-- title -->\n        <attr name=\"tl_textsize\"/>\n        <attr name=\"tl_textSelectColor\"/>\n        <attr name=\"tl_textUnselectColor\"/>\n        <attr name=\"tl_textBold\"/>\n        <attr name=\"tl_textAllCaps\"/>\n\n    </declare-styleable>\n\n    <declare-styleable name=\"CommonTabLayout\">\n        <!-- indicator -->\n        <attr name=\"tl_indicator_color\"/>\n        <attr name=\"tl_indicator_height\"/>\n        <attr name=\"tl_indicator_width\"/>\n        <attr name=\"tl_indicator_margin_left\"/>\n        <attr name=\"tl_indicator_margin_top\"/>\n        <attr name=\"tl_indicator_margin_right\"/>\n        <attr name=\"tl_indicator_margin_bottom\"/>\n        <attr name=\"tl_indicator_corner_radius\"/>\n        <attr name=\"tl_indicator_gravity\"/>\n        <attr name=\"tl_indicator_style\"/>\n        <attr name=\"tl_indicator_anim_enable\"/>\n        <attr name=\"tl_indicator_anim_duration\"/>\n        <attr name=\"tl_indicator_bounce_enable\"/>\n\n        <!-- underline -->\n        <attr name=\"tl_underline_color\"/>\n        <attr name=\"tl_underline_height\"/>\n        <attr name=\"tl_underline_gravity\"/>\n\n        <!-- divider -->\n        <attr name=\"tl_divider_color\"/>\n        <attr name=\"tl_divider_width\"/>\n        <attr name=\"tl_divider_padding\"/>\n\n        <!-- tab -->\n        <attr name=\"tl_tab_padding\"/>\n        <attr name=\"tl_tab_space_equal\"/>\n        <attr name=\"tl_tab_width\"/>\n\n        <!-- title -->\n        <attr name=\"tl_textsize\"/>\n        <attr name=\"tl_textSelectColor\"/>\n        <attr name=\"tl_textUnselectColor\"/>\n        <attr name=\"tl_textBold\"/>\n        <attr name=\"tl_textAllCaps\"/>\n\n        <!-- icon -->\n        <!-- 设置icon宽度 -->\n        <attr name=\"tl_iconWidth\" format=\"dimension\"/>\n        <!-- 设置icon高度 -->\n        <attr name=\"tl_iconHeight\" format=\"dimension\"/>\n        <!-- 设置icon是否可见 -->\n        <attr name=\"tl_iconVisible\" format=\"boolean\"/>\n        <!-- 设置icon显示位置,对应Gravity中常量值 -->\n        <attr name=\"tl_iconGravity\" format=\"enum\">\n            <enum name=\"LEFT\" value=\"3\"/>\n            <enum name=\"TOP\" value=\"48\"/>\n            <enum name=\"RIGHT\" value=\"5\"/>\n            <enum name=\"BOTTOM\" value=\"80\"/>\n        </attr>\n        <!-- 设置icon与文字间距 -->\n        <attr name=\"tl_iconMargin\" format=\"dimension\"/>\n\n    </declare-styleable>\n\n    <declare-styleable name=\"SegmentTabLayout\">\n        <!-- indicator -->\n        <attr name=\"tl_indicator_color\"/>\n        <attr name=\"tl_indicator_height\"/>\n        <attr name=\"tl_indicator_margin_left\"/>\n        <attr name=\"tl_indicator_margin_top\"/>\n        <attr name=\"tl_indicator_margin_right\"/>\n        <attr name=\"tl_indicator_margin_bottom\"/>\n        <attr name=\"tl_indicator_corner_radius\"/>\n        <attr name=\"tl_indicator_anim_enable\"/>\n        <attr name=\"tl_indicator_anim_duration\"/>\n        <attr name=\"tl_indicator_bounce_enable\"/>\n\n        <!-- divider -->\n        <attr name=\"tl_divider_color\"/>\n        <attr name=\"tl_divider_width\"/>\n        <attr name=\"tl_divider_padding\"/>\n\n        <!-- tab -->\n        <attr name=\"tl_tab_padding\"/>\n        <attr name=\"tl_tab_space_equal\"/>\n        <attr name=\"tl_tab_width\"/>\n\n        <!-- title -->\n        <attr name=\"tl_textsize\"/>\n        <attr name=\"tl_textSelectColor\"/>\n        <attr name=\"tl_textUnselectColor\"/>\n        <attr name=\"tl_textBold\"/>\n        <attr name=\"tl_textAllCaps\"/>\n\n        <attr name=\"tl_bar_color\" format=\"color\"/>\n        <attr name=\"tl_bar_stroke_color\" format=\"color\"/>\n        <attr name=\"tl_bar_stroke_width\" format=\"dimension\"/>\n\n    </declare-styleable>\n\n    <declare-styleable name=\"MsgView\">\n        <!-- 圆角矩形背景色 -->\n        <attr name=\"mv_backgroundColor\" format=\"color\"/>\n        <!-- 圆角弧度,单位dp-->\n        <attr name=\"mv_cornerRadius\" format=\"dimension\"/>\n        <!-- 圆角弧度,单位dp-->\n        <attr name=\"mv_strokeWidth\" format=\"dimension\"/>\n        <!-- 圆角边框颜色-->\n        <attr name=\"mv_strokeColor\" format=\"color\"/>\n        <!-- 圆角弧度是高度一半-->\n        <attr name=\"mv_isRadiusHalfHeight\" format=\"boolean\"/>\n        <!-- 圆角矩形宽高相等,取较宽高中大值-->\n        <attr name=\"mv_isWidthHeightEqual\" format=\"boolean\"/>\n    </declare-styleable>\n</resources>"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 H07000223\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# FlycoTabLayout\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlycoTabLayout-green.svg?style=true)](https://android-arsenal.com/details/1/2756)\n#### [中文版](https://github.com/H07000223/FlycoTabLayout/blob/master/README_CN.md)\nAn Android TabLayout Lib has 3 kinds of TabLayout at present.\n\n* SlidingTabLayout: deeply modified from [PagerSlidingTabStrip](https://github.com/jpardogo/PagerSlidingTabStrip).\n    * new added attribute\n    * new added kinds of indicators\n    * new added unread msg tip\n    * new added method for convenience\n    \n    ```java\n        /** no need to set titles in adapter */\n        public void setViewPager(ViewPager vp, String[] titles)\n        \n        /** no need to initialize even adapter */\n        public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList<Fragment> fragments) \n    ```\n\n* CommonTabLayout:unlike SlidingTabLayout's dependence on ViewPager,it is a tabLayout without dependence on ViewPager and \ncan be used freely with other widgets together.\n    * support kinds of indicators and indicator animation\n    * support unread msg tip\n    * support icon and icon gravity.\n    * new added method for convenience\n    \n    ```java\n        /** support switch fragments itself */\n        public void setTabData(ArrayList<CustomTabEntity> tabEntitys, FragmentManager fm, int containerViewId, ArrayList<Fragment> fragments)\n    ```\n\n* SegmentTabLayout\n\n## Demo\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_1.gif)\n\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_2.gif)\n\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_3.gif)\n\n\n## Change Log\n\n > 3.0.0 (2021-09-30)\n   - upgrade to AndroidX\n   - publish on Maven Central\n\n\n## Gradle\n\n```groovy\n// AndroidX\ndependencies {\n    implementation 'io.github.h07000223:flycoTabLayout:3.0.0'\n}\n\n// Old\ndependencies{\n    compile 'com.android.support:support-v4:23.1.1'\n    compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'\n}\n```\n\n## Attributes\n\n|name|format|description|\n|:---:|:---:|:---:|\n| tl_indicator_color | color |set indicator color\n| tl_indicator_height | dimension |set indicator height\n| tl_indicator_width | dimension |set indicator width\n| tl_indicator_margin_left | dimension |set indicator margin,invalid when indicator width is greater than 0.\n| tl_indicator_margin_top | dimension |set indicator margin,invalid when indicator width is greater than 0.\n| tl_indicator_margin_right | dimension |set indicator margin,invalid when indicator width is greater than 0.\n| tl_indicator_margin_bottom | dimension |set indicator margin,invalid when indicator width is greater than 0.\n| tl_indicator_corner_radius | dimension |set indicator corner radius\n| tl_indicator_gravity | enum |set indicator gravity TOP or BOTTOM.\n| tl_indicator_style | enum |set indicator style NORMAL or TRIANGLE or BLOCK\n| tl_underline_color | color |set underline color\n| tl_underline_height | dimension |set underline height\n| tl_underline_gravity | enum |set underline gravity TOP or BOTTOM\n| tl_divider_color | color |set divider color\n| tl_divider_width | dimension |set divider width\n| tl_divider_padding |dimension| set divider paddingTop and paddingBottom\n| tl_tab_padding |dimension| set tab paddingLeft and paddingRight\n| tl_tab_space_equal |boolean| set tab space equal\n| tl_tab_width |dimension| set tab width\n| tl_textsize |dimension| set text size\n| tl_textSelectColor |color| set text select color\n| tl_textUnselectColor |color|  set text unselect color\n| tl_textBold |boolean| set text is bold \n| tl_iconWidth |dimension| set icon width(only for CommonTabLayout)\n| tl_iconHeight |dimension|set icon height(only for CommonTabLayout)\n| tl_iconVisible |boolean| set icon is visible(only for CommonTabLayout)\n| tl_iconGravity |enum| set icon gravity LEFT or TOP or RIGHT or BOTTOM(only for CommonTabLayout)\n| tl_iconMargin |dimension| set icon margin with text(only for CommonTabLayout)\n| tl_indicator_anim_enable |boolean| set indicator support animation(only for CommonTabLayout)\n| tl_indicator_anim_duration |integer| set indicator animation duration(only for CommonTabLayout)\n| tl_indicator_bounce_enable |boolean| set indicator aniamtion with bounce effect(only for CommonTabLayout)\n| tl_indicator_width_equal_title |boolean| set indicator width same as text(only for SlidingTabLayout)\n\n## Dependence\n*   [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids)\n*   [FlycoRoundView](https://github.com/H07000223/FlycoRoundView)\n\n## Thanks\n*   [PagerSlidingTabStrip](https://github.com/jpardogo/PagerSlidingTabStrip)\n"
  },
  {
    "path": "README_CN.md",
    "content": "# FlycoTabLayout\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlycoTabLayout-green.svg?style=true)](https://android-arsenal.com/details/1/2756)\n\n一个Android TabLayout库,目前有3个TabLayout\n\n* SlidingTabLayout:参照[PagerSlidingTabStrip](https://github.com/jpardogo/PagerSlidingTabStrip)进行大量修改.\n    * 新增部分属性\n    * 新增支持多种Indicator显示器\n    * 新增支持未读消息显示\n    * 新增方法for懒癌患者\n    \n    ```java\n        /** 关联ViewPager,用于不想在ViewPager适配器中设置titles数据的情况 */\n        public void setViewPager(ViewPager vp, String[] titles)\n        \n        /** 关联ViewPager,用于连适配器都不想自己实例化的情况 */\n        public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList<Fragment> fragments) \n    ```\n\n* CommonTabLayout:不同于SlidingTabLayout对ViewPager依赖,它是一个不依赖ViewPager可以与其他控件自由搭配使用的TabLayout.\n    * 支持多种Indicator显示器,以及Indicator动画\n    * 支持未读消息显示\n    * 支持Icon以及Icon位置\n    * 新增方法for懒癌患者\n    \n    ```java\n        /** 关联数据支持同时切换fragments */\n        public void setTabData(ArrayList<CustomTabEntity> tabEntitys, FragmentManager fm, int containerViewId, ArrayList<Fragment> fragments)\n    ```\n\n* SegmentTabLayout\n\n## Demo\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_1.gif)\n\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_2.gif)\n\n![](https://github.com/H07000223/FlycoTabLayout/blob/master/preview_3.gif)\n\n\n## Change Log\n\n > 3.0.0 (2021-09-30)\n   - 升级到AndroidX\n   - 发布到Maven\n\n\n## Gradle\n\n```groovy\n// AndroidX\ndependencies {\n    implementation 'io.github.h07000223:flycoTabLayout:3.0.0'\n}\n\n// Old\ndependencies{\n    compile 'com.android.support:support-v4:23.1.1'\n    compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'\n}\n```\n\n## Attributes\n\n|name|format|description|\n|:---:|:---:|:---:|\n| tl_indicator_color | color |设置显示器颜色\n| tl_indicator_height | dimension |设置显示器高度\n| tl_indicator_width | dimension |设置显示器固定宽度\n| tl_indicator_margin_left | dimension |设置显示器margin,当indicator_width大于0,无效\n| tl_indicator_margin_top | dimension |设置显示器margin,当indicator_width大于0,无效\n| tl_indicator_margin_right | dimension |设置显示器margin,当indicator_width大于0,无效\n| tl_indicator_margin_bottom | dimension |设置显示器margin,当indicator_width大于0,无效 \n| tl_indicator_corner_radius | dimension |设置显示器圆角弧度\n| tl_indicator_gravity | enum |设置显示器上方(TOP)还是下方(BOTTOM),只对常规显示器有用\n| tl_indicator_style | enum |设置显示器为常规(NORMAL)或三角形(TRIANGLE)或背景色块(BLOCK)\n| tl_underline_color | color |设置下划线颜色\n| tl_underline_height | dimension |设置下划线高度\n| tl_underline_gravity | enum |设置下划线上方(TOP)还是下方(BOTTOM)\n| tl_divider_color | color |设置分割线颜色\n| tl_divider_width | dimension |设置分割线宽度\n| tl_divider_padding |dimension| 设置分割线的paddingTop和paddingBottom\n| tl_tab_padding |dimension| 设置tab的paddingLeft和paddingRight\n| tl_tab_space_equal |boolean| 设置tab大小等分\n| tl_tab_width |dimension| 设置tab固定大小\n| tl_textsize |dimension| 设置字体大小\n| tl_textSelectColor |color| 设置字体选中颜色\n| tl_textUnselectColor |color| 设置字体未选中颜色\n| tl_textBold |boolean| 设置字体加粗\n| tl_iconWidth |dimension| 设置icon宽度(仅支持CommonTabLayout)\n| tl_iconHeight |dimension|设置icon高度(仅支持CommonTabLayout)\n| tl_iconVisible |boolean| 设置icon是否可见(仅支持CommonTabLayout)\n| tl_iconGravity |enum| 设置icon显示位置,对应Gravity中常量值,左上右下(仅支持CommonTabLayout)\n| tl_iconMargin |dimension| 设置icon与文字间距(仅支持CommonTabLayout)\n| tl_indicator_anim_enable |boolean| 设置显示器支持动画(only for CommonTabLayout)\n| tl_indicator_anim_duration |integer| 设置显示器动画时间(only for CommonTabLayout)\n| tl_indicator_bounce_enable |boolean| 设置显示器支持动画回弹效果(only for CommonTabLayout)\n| tl_indicator_width_equal_title |boolean| 设置显示器与标题一样长(only for SlidingTabLayout)\n\n## Dependence\n*   [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids)\n*   [FlycoRoundView](https://github.com/H07000223/FlycoRoundView)\n\n## Thanks\n*   [PagerSlidingTabStrip](https://github.com/jpardogo/PagerSlidingTabStrip)\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion rootProject.ext.compileSdkVersion\n    buildToolsVersion rootProject.ext.buildToolsVersion\n\n    defaultConfig {\n        applicationId \"com.flyco.tablayoutsamples\"\n        minSdkVersion rootProject.ext.minSdkVersion\n        targetSdkVersion rootProject.ext.targetSdkVersion\n        versionCode rootProject.ext.versionCode\n        versionName rootProject.ext.versionName\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation support.appcompat\n    implementation support.v4\n    implementation support.design\n//    implementation project(':FlycoTabLayout_Lib')\n    implementation 'io.github.h07000223:flycoTabLayout:3.0.0'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/lihui/work/AndroidStudio/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest\n    package=\"com.flyco.tablayoutsamples\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme.NoActionBar\">\n        <activity\n            android:name=\".ui.SimpleHomeActivity\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/AppTheme\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n        <activity\n            android:name=\".ui.CommonTabActivity\"\n            android:screenOrientation=\"portrait\"/>\n        <activity\n            android:name=\".ui.SlidingTabActivity\"\n            android:screenOrientation=\"portrait\"/>\n        <activity\n            android:name=\".ui.SegmentTabActivity\"\n            android:screenOrientation=\"portrait\"/>\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/adapter/SimpleHomeAdapter.java",
    "content": "package com.flyco.tablayoutsamples.adapter;\r\n\r\nimport android.app.Activity;\r\nimport android.content.Context;\r\nimport android.graphics.Color;\r\nimport android.util.DisplayMetrics;\r\nimport android.util.TypedValue;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.widget.AbsListView;\r\nimport android.widget.BaseAdapter;\r\nimport android.widget.TextView;\r\n\r\npublic class SimpleHomeAdapter extends BaseAdapter {\r\n    private Context mContext;\r\n    private String[] mItems;\r\n    private DisplayMetrics mDisplayMetrics;\r\n\r\n    public SimpleHomeAdapter(Context context, String[] items) {\r\n        this.mContext = context;\r\n        this.mItems = items;\r\n        mDisplayMetrics = new DisplayMetrics();\r\n        ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);\r\n    }\r\n\r\n    @Override\r\n    public int getCount() {\r\n        return mItems.length;\r\n    }\r\n\r\n    @Override\r\n    public Object getItem(int position) {\r\n        return null;\r\n    }\r\n\r\n    @Override\r\n    public long getItemId(int position) {\r\n        return position;\r\n    }\r\n\r\n    @Override\r\n    public View getView(int position, View convertView, ViewGroup parent) {\r\n\r\n        int padding = (int) (mDisplayMetrics.density * 10);\r\n\r\n        TextView tv = new TextView(mContext);\r\n        tv.setText(mItems[position]);\r\n        tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);\r\n        tv.setTextColor(Color.parseColor(\"#468ED0\"));\r\n        // tv.setGravity(Gravity.CENTER);\r\n        tv.setPadding(padding, padding, padding, padding);\r\n        AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,\r\n                AbsListView.LayoutParams.WRAP_CONTENT);\r\n        tv.setLayoutParams(lp);\r\n        return tv;\r\n    }\r\n}"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/entity/TabEntity.java",
    "content": "package com.flyco.tablayoutsamples.entity;\n\nimport com.flyco.tablayout.listener.CustomTabEntity;\n\npublic class TabEntity implements CustomTabEntity {\n    public String title;\n    public int selectedIcon;\n    public int unSelectedIcon;\n\n    public TabEntity(String title, int selectedIcon, int unSelectedIcon) {\n        this.title = title;\n        this.selectedIcon = selectedIcon;\n        this.unSelectedIcon = unSelectedIcon;\n    }\n\n    @Override\n    public String getTabTitle() {\n        return title;\n    }\n\n    @Override\n    public int getTabSelectedIcon() {\n        return selectedIcon;\n    }\n\n    @Override\n    public int getTabUnselectedIcon() {\n        return unSelectedIcon;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/ui/CommonTabActivity.java",
    "content": "package com.flyco.tablayoutsamples.ui;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.view.View;\n\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentPagerAdapter;\nimport androidx.viewpager.widget.ViewPager;\n\nimport com.flyco.tablayout.CommonTabLayout;\nimport com.flyco.tablayout.listener.CustomTabEntity;\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.utils.UnreadMsgUtils;\nimport com.flyco.tablayout.widget.MsgView;\nimport com.flyco.tablayoutsamples.R;\nimport com.flyco.tablayoutsamples.entity.TabEntity;\nimport com.flyco.tablayoutsamples.utils.ViewFindUtils;\n\nimport java.util.ArrayList;\nimport java.util.Random;\n\npublic class CommonTabActivity extends AppCompatActivity {\n    private Context mContext = this;\n    private ArrayList<Fragment> mFragments = new ArrayList<>();\n    private ArrayList<Fragment> mFragments2 = new ArrayList<>();\n\n    private String[] mTitles = {\"首页\", \"消息\", \"联系人\", \"更多\"};\n    private int[] mIconUnselectIds = {\n            R.mipmap.tab_home_unselect, R.mipmap.tab_speech_unselect,\n            R.mipmap.tab_contact_unselect, R.mipmap.tab_more_unselect};\n    private int[] mIconSelectIds = {\n            R.mipmap.tab_home_select, R.mipmap.tab_speech_select,\n            R.mipmap.tab_contact_select, R.mipmap.tab_more_select};\n    private ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>();\n    private View mDecorView;\n    private ViewPager mViewPager;\n    private CommonTabLayout mTabLayout_1;\n    private CommonTabLayout mTabLayout_2;\n    private CommonTabLayout mTabLayout_3;\n    private CommonTabLayout mTabLayout_4;\n    private CommonTabLayout mTabLayout_5;\n    private CommonTabLayout mTabLayout_6;\n    private CommonTabLayout mTabLayout_7;\n    private CommonTabLayout mTabLayout_8;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_common_tab);\n\n        for (String title : mTitles) {\n            mFragments.add(SimpleCardFragment.getInstance(\"Switch ViewPager \" + title));\n            mFragments2.add(SimpleCardFragment.getInstance(\"Switch Fragment \" + title));\n        }\n\n\n        for (int i = 0; i < mTitles.length; i++) {\n            mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i]));\n        }\n\n        mDecorView = getWindow().getDecorView();\n        mViewPager = ViewFindUtils.find(mDecorView, R.id.vp_2);\n        mViewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));\n        /** with nothing */\n        mTabLayout_1 = ViewFindUtils.find(mDecorView, R.id.tl_1);\n        /** with ViewPager */\n        mTabLayout_2 = ViewFindUtils.find(mDecorView, R.id.tl_2);\n        /** with Fragments */\n        mTabLayout_3 = ViewFindUtils.find(mDecorView, R.id.tl_3);\n        /** indicator固定宽度 */\n        mTabLayout_4 = ViewFindUtils.find(mDecorView, R.id.tl_4);\n        /** indicator固定宽度 */\n        mTabLayout_5 = ViewFindUtils.find(mDecorView, R.id.tl_5);\n        /** indicator矩形圆角 */\n        mTabLayout_6 = ViewFindUtils.find(mDecorView, R.id.tl_6);\n        /** indicator三角形 */\n        mTabLayout_7 = ViewFindUtils.find(mDecorView, R.id.tl_7);\n        /** indicator圆角色块 */\n        mTabLayout_8 = ViewFindUtils.find(mDecorView, R.id.tl_8);\n\n        mTabLayout_1.setTabData(mTabEntities);\n        tl_2();\n        mTabLayout_3.setTabData(mTabEntities, this, R.id.fl_change, mFragments2);\n        mTabLayout_4.setTabData(mTabEntities);\n        mTabLayout_5.setTabData(mTabEntities);\n        mTabLayout_6.setTabData(mTabEntities);\n        mTabLayout_7.setTabData(mTabEntities);\n        mTabLayout_8.setTabData(mTabEntities);\n\n        mTabLayout_3.setOnTabSelectListener(new OnTabSelectListener() {\n            @Override\n            public void onTabSelect(int position) {\n                mTabLayout_1.setCurrentTab(position);\n                mTabLayout_2.setCurrentTab(position);\n                mTabLayout_4.setCurrentTab(position);\n                mTabLayout_5.setCurrentTab(position);\n                mTabLayout_6.setCurrentTab(position);\n                mTabLayout_7.setCurrentTab(position);\n                mTabLayout_8.setCurrentTab(position);\n            }\n\n            @Override\n            public void onTabReselect(int position) {\n\n            }\n        });\n        mTabLayout_8.setCurrentTab(2);\n        mTabLayout_3.setCurrentTab(1);\n\n        //显示未读红点\n        mTabLayout_1.showDot(2);\n        mTabLayout_3.showDot(1);\n        mTabLayout_4.showDot(1);\n\n        //两位数\n        mTabLayout_2.showMsg(0, 55);\n        mTabLayout_2.setMsgMargin(0, -5, 5);\n\n        //三位数\n        mTabLayout_2.showMsg(1, 100);\n        mTabLayout_2.setMsgMargin(1, -5, 5);\n\n        //设置未读消息红点\n        mTabLayout_2.showDot(2);\n        MsgView rtv_2_2 = mTabLayout_2.getMsgView(2);\n        if (rtv_2_2 != null) {\n            UnreadMsgUtils.setSize(rtv_2_2, dp2px(7.5f));\n        }\n\n        //设置未读消息背景\n        mTabLayout_2.showMsg(3, 5);\n        mTabLayout_2.setMsgMargin(3, 0, 5);\n        MsgView rtv_2_3 = mTabLayout_2.getMsgView(3);\n        if (rtv_2_3 != null) {\n            rtv_2_3.setBackgroundColor(Color.parseColor(\"#6D8FB0\"));\n        }\n    }\n\n    Random mRandom = new Random();\n\n    private void tl_2() {\n        mTabLayout_2.setTabData(mTabEntities);\n        mTabLayout_2.setOnTabSelectListener(new OnTabSelectListener() {\n            @Override\n            public void onTabSelect(int position) {\n                mViewPager.setCurrentItem(position);\n            }\n\n            @Override\n            public void onTabReselect(int position) {\n                if (position == 0) {\n                    mTabLayout_2.showMsg(0, mRandom.nextInt(100) + 1);\n//                    UnreadMsgUtils.show(mTabLayout_2.getMsgView(0), mRandom.nextInt(100) + 1);\n                }\n            }\n        });\n\n        mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n            @Override\n            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n            }\n\n            @Override\n            public void onPageSelected(int position) {\n                mTabLayout_2.setCurrentTab(position);\n            }\n\n            @Override\n            public void onPageScrollStateChanged(int state) {\n\n            }\n        });\n\n        mViewPager.setCurrentItem(1);\n    }\n\n    private class MyPagerAdapter extends FragmentPagerAdapter {\n        public MyPagerAdapter(FragmentManager fm) {\n            super(fm);\n        }\n\n        @Override\n        public int getCount() {\n            return mFragments.size();\n        }\n\n        @Override\n        public CharSequence getPageTitle(int position) {\n            return mTitles[position];\n        }\n\n        @Override\n        public Fragment getItem(int position) {\n            return mFragments.get(position);\n        }\n    }\n\n    protected int dp2px(float dp) {\n        final float scale = mContext.getResources().getDisplayMetrics().density;\n        return (int) (dp * scale + 0.5f);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/ui/SegmentTabActivity.java",
    "content": "package com.flyco.tablayoutsamples.ui;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.view.View;\n\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentPagerAdapter;\nimport androidx.viewpager.widget.ViewPager;\n\nimport com.flyco.tablayout.SegmentTabLayout;\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.widget.MsgView;\nimport com.flyco.tablayoutsamples.R;\nimport com.flyco.tablayoutsamples.utils.ViewFindUtils;\n\nimport java.util.ArrayList;\n\npublic class SegmentTabActivity extends AppCompatActivity {\n    private ArrayList<Fragment> mFragments = new ArrayList<>();\n    private ArrayList<Fragment> mFragments2 = new ArrayList<>();\n\n    private String[] mTitles = {\"首页\", \"消息\"};\n    private String[] mTitles_2 = {\"首页\", \"消息\", \"联系人\"};\n    private String[] mTitles_3 = {\"首页\", \"消息\", \"联系人\", \"更多\"};\n    private View mDecorView;\n    private SegmentTabLayout mTabLayout_3;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_segment_tab);\n\n        for (String title : mTitles_3) {\n            mFragments.add(SimpleCardFragment.getInstance(\"Switch ViewPager \" + title));\n        }\n\n        for (String title : mTitles_2) {\n            mFragments2.add(SimpleCardFragment.getInstance(\"Switch Fragment \" + title));\n        }\n\n        mDecorView = getWindow().getDecorView();\n\n        SegmentTabLayout tabLayout_1 = ViewFindUtils.find(mDecorView, R.id.tl_1);\n        SegmentTabLayout tabLayout_2 = ViewFindUtils.find(mDecorView, R.id.tl_2);\n        mTabLayout_3 = ViewFindUtils.find(mDecorView, R.id.tl_3);\n        SegmentTabLayout tabLayout_4 = ViewFindUtils.find(mDecorView, R.id.tl_4);\n        SegmentTabLayout tabLayout_5 = ViewFindUtils.find(mDecorView, R.id.tl_5);\n\n        tabLayout_1.setTabData(mTitles);\n        tabLayout_2.setTabData(mTitles_2);\n        tl_3();\n        tabLayout_4.setTabData(mTitles_2, this, R.id.fl_change, mFragments2);\n        tabLayout_5.setTabData(mTitles_3);\n\n        //显示未读红点\n        tabLayout_1.showDot(2);\n        tabLayout_2.showDot(2);\n        mTabLayout_3.showDot(1);\n        tabLayout_4.showDot(1);\n\n        //设置未读消息红点\n        mTabLayout_3.showDot(2);\n        MsgView rtv_3_2 = mTabLayout_3.getMsgView(2);\n        if (rtv_3_2 != null) {\n            rtv_3_2.setBackgroundColor(Color.parseColor(\"#6D8FB0\"));\n        }\n    }\n\n    private void tl_3() {\n        final ViewPager vp_3 = ViewFindUtils.find(mDecorView, R.id.vp_2);\n        vp_3.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));\n\n        mTabLayout_3.setTabData(mTitles_3);\n        mTabLayout_3.setOnTabSelectListener(new OnTabSelectListener() {\n            @Override\n            public void onTabSelect(int position) {\n                vp_3.setCurrentItem(position);\n            }\n\n            @Override\n            public void onTabReselect(int position) {\n            }\n        });\n\n        vp_3.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n            @Override\n            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n            }\n\n            @Override\n            public void onPageSelected(int position) {\n                mTabLayout_3.setCurrentTab(position);\n            }\n\n            @Override\n            public void onPageScrollStateChanged(int state) {\n\n            }\n        });\n        vp_3.setCurrentItem(1);\n    }\n\n    private class MyPagerAdapter extends FragmentPagerAdapter {\n        public MyPagerAdapter(FragmentManager fm) {\n            super(fm);\n        }\n\n        @Override\n        public int getCount() {\n            return mFragments.size();\n        }\n\n        @Override\n        public CharSequence getPageTitle(int position) {\n            return mTitles_3[position];\n        }\n\n        @Override\n        public Fragment getItem(int position) {\n            return mFragments.get(position);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/ui/SimpleCardFragment.java",
    "content": "package com.flyco.tablayoutsamples.ui;\n\nimport android.annotation.SuppressLint;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\n\nimport androidx.fragment.app.Fragment;\n\nimport com.flyco.tablayoutsamples.R;\n\n@SuppressLint(\"ValidFragment\")\npublic class SimpleCardFragment extends Fragment {\n    private String mTitle;\n\n    public static SimpleCardFragment getInstance(String title) {\n        SimpleCardFragment sf = new SimpleCardFragment();\n        sf.mTitle = title;\n        return sf;\n    }\n\n    @Override\n    public void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n    }\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        View v = inflater.inflate(R.layout.fr_simple_card, null);\n        TextView card_title_tv = (TextView) v.findViewById(R.id.card_title_tv);\n        card_title_tv.setText(mTitle);\n\n        return v;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/ui/SimpleHomeActivity.java",
    "content": "package com.flyco.tablayoutsamples.ui;\r\n\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.graphics.Color;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.widget.AdapterView;\r\nimport android.widget.ListView;\r\n\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport com.flyco.tablayoutsamples.adapter.SimpleHomeAdapter;\r\n\r\npublic class SimpleHomeActivity extends AppCompatActivity {\r\n    private Context mContext = this;\r\n    private final String[] mItems = {\"SlidingTabLayout\", \"CommonTabLayout\", \"SegmentTabLayout\"};\r\n    private final Class<?>[] mClasses = {SlidingTabActivity.class, CommonTabActivity.class,\r\n            SegmentTabActivity.class};\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        ListView lv = new ListView(mContext);\r\n        lv.setCacheColorHint(Color.TRANSPARENT);\r\n        lv.setFadingEdgeLength(0);\r\n        lv.setAdapter(new SimpleHomeAdapter(mContext, mItems));\r\n\r\n        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {\r\n            @Override\r\n            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\r\n                Intent intent = new Intent(mContext, mClasses[position]);\r\n                startActivity(intent);\r\n            }\r\n        });\r\n\r\n        setContentView(lv);\r\n    }\r\n}\r\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/ui/SlidingTabActivity.java",
    "content": "package com.flyco.tablayoutsamples.ui;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.Toast;\n\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentPagerAdapter;\nimport androidx.viewpager.widget.ViewPager;\n\nimport com.flyco.tablayout.SlidingTabLayout;\nimport com.flyco.tablayout.listener.OnTabSelectListener;\nimport com.flyco.tablayout.widget.MsgView;\nimport com.flyco.tablayoutsamples.R;\nimport com.flyco.tablayoutsamples.utils.ViewFindUtils;\n\nimport java.util.ArrayList;\n\npublic class SlidingTabActivity extends AppCompatActivity implements OnTabSelectListener {\n    private Context mContext = this;\n    private ArrayList<Fragment> mFragments = new ArrayList<>();\n    private final String[] mTitles = {\n            \"热门\", \"iOS\", \"Android\"\n            , \"前端\", \"后端\", \"设计\", \"工具资源\"\n    };\n    private MyPagerAdapter mAdapter;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_sliding_tab);\n\n        for (String title : mTitles) {\n            mFragments.add(SimpleCardFragment.getInstance(title));\n        }\n\n\n        View decorView = getWindow().getDecorView();\n        ViewPager vp = ViewFindUtils.find(decorView, R.id.vp);\n        mAdapter = new MyPagerAdapter(getSupportFragmentManager());\n        vp.setAdapter(mAdapter);\n\n        /** 默认 */\n        SlidingTabLayout tabLayout_1 = ViewFindUtils.find(decorView, R.id.tl_1);\n        /**自定义部分属性*/\n        SlidingTabLayout tabLayout_2 = ViewFindUtils.find(decorView, R.id.tl_2);\n        /** 字体加粗,大写 */\n        SlidingTabLayout tabLayout_3 = ViewFindUtils.find(decorView, R.id.tl_3);\n        /** tab固定宽度 */\n        SlidingTabLayout tabLayout_4 = ViewFindUtils.find(decorView, R.id.tl_4);\n        /** indicator固定宽度 */\n        SlidingTabLayout tabLayout_5 = ViewFindUtils.find(decorView, R.id.tl_5);\n        /** indicator圆 */\n        SlidingTabLayout tabLayout_6 = ViewFindUtils.find(decorView, R.id.tl_6);\n        /** indicator矩形圆角 */\n        final SlidingTabLayout tabLayout_7 = ViewFindUtils.find(decorView, R.id.tl_7);\n        /** indicator三角形 */\n        SlidingTabLayout tabLayout_8 = ViewFindUtils.find(decorView, R.id.tl_8);\n        /** indicator圆角色块 */\n        SlidingTabLayout tabLayout_9 = ViewFindUtils.find(decorView, R.id.tl_9);\n        /** indicator圆角色块 */\n        SlidingTabLayout tabLayout_10 = ViewFindUtils.find(decorView, R.id.tl_10);\n\n        tabLayout_1.setViewPager(vp);\n        tabLayout_2.setViewPager(vp);\n        tabLayout_2.setOnTabSelectListener(this);\n        tabLayout_3.setViewPager(vp);\n        tabLayout_4.setViewPager(vp);\n        tabLayout_5.setViewPager(vp);\n        tabLayout_6.setViewPager(vp);\n        tabLayout_7.setViewPager(vp, mTitles);\n        tabLayout_8.setViewPager(vp, mTitles, this, mFragments);\n        tabLayout_9.setViewPager(vp);\n        tabLayout_10.setViewPager(vp);\n\n        vp.setCurrentItem(4);\n\n        tabLayout_1.showDot(4);\n        tabLayout_3.showDot(4);\n        tabLayout_2.showDot(4);\n\n        tabLayout_2.showMsg(3, 5);\n        tabLayout_2.setMsgMargin(3, 0, 10);\n        MsgView rtv_2_3 = tabLayout_2.getMsgView(3);\n        if (rtv_2_3 != null) {\n            rtv_2_3.setBackgroundColor(Color.parseColor(\"#6D8FB0\"));\n        }\n\n        tabLayout_2.showMsg(5, 5);\n        tabLayout_2.setMsgMargin(5, 0, 10);\n\n//        tabLayout_7.setOnTabSelectListener(new OnTabSelectListener() {\n//            @Override\n//            public void onTabSelect(int position) {\n//                Toast.makeText(mContext, \"onTabSelect&position--->\" + position, Toast.LENGTH_SHORT).show();\n//            }\n//\n//            @Override\n//            public void onTabReselect(int position) {\n//                mFragments.add(SimpleCardFragment.getInstance(\"后端\"));\n//                mAdapter.notifyDataSetChanged();\n//                tabLayout_7.addNewTab(\"后端\");\n//            }\n//        });\n    }\n\n    @Override\n    public void onTabSelect(int position) {\n        Toast.makeText(mContext, \"onTabSelect&position--->\" + position, Toast.LENGTH_SHORT).show();\n    }\n\n    @Override\n    public void onTabReselect(int position) {\n        Toast.makeText(mContext, \"onTabReselect&position--->\" + position, Toast.LENGTH_SHORT).show();\n    }\n\n    private class MyPagerAdapter extends FragmentPagerAdapter {\n        public MyPagerAdapter(FragmentManager fm) {\n            super(fm);\n        }\n\n        @Override\n        public int getCount() {\n            return mFragments.size();\n        }\n\n        @Override\n        public CharSequence getPageTitle(int position) {\n            return mTitles[position];\n        }\n\n        @Override\n        public Fragment getItem(int position) {\n            return mFragments.get(position);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/flyco/tablayoutsamples/utils/ViewFindUtils.java",
    "content": "package com.flyco.tablayoutsamples.utils;\r\n\r\nimport android.util.SparseArray;\r\nimport android.view.View;\r\n\r\n@SuppressWarnings({\"unchecked\"})\r\npublic class ViewFindUtils {\r\n    /**\r\n     * ViewHolder简洁写法,避免适配器中重复定义ViewHolder,减少代码量 用法:\r\n     *\r\n     * <pre>\r\n     * if (convertView == null)\r\n     * {\r\n     * \tconvertView = View.inflate(context, R.layout.ad_demo, null);\r\n     * }\r\n     * TextView tv_demo = ViewHolderUtils.get(convertView, R.id.tv_demo);\r\n     * ImageView iv_demo = ViewHolderUtils.get(convertView, R.id.iv_demo);\r\n     * </pre>\r\n     */\r\n    public static <T extends View> T hold(View view, int id) {\r\n        SparseArray<View> viewHolder = (SparseArray<View>) view.getTag();\r\n\r\n        if (viewHolder == null) {\r\n            viewHolder = new SparseArray<View>();\r\n            view.setTag(viewHolder);\r\n        }\r\n\r\n        View childView = viewHolder.get(id);\r\n\r\n        if (childView == null) {\r\n            childView = view.findViewById(id);\r\n            viewHolder.put(id, childView);\r\n        }\r\n\r\n        return (T) childView;\r\n    }\r\n\r\n    /**\r\n     * 替代findviewById方法\r\n     */\r\n    public static <T extends View> T find(View view, int id) {\r\n        return (T) view.findViewById(id);\r\n    }\r\n}\r\n"
  },
  {
    "path": "app/src/main/res/layout/activity_common_tab.xml",
    "content": "<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tl=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"#eeeeee\"\n    android:scrollbars=\"none\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\">\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"#ffffff\"\n            android:paddingBottom=\"5dp\"\n            android:paddingTop=\"5dp\"\n            tl:tl_indicator_color=\"#2C97DE\"\n            tl:tl_textSelectColor=\"#2C97DE\"\n            tl:tl_textUnselectColor=\"#66000000\"\n            tl:tl_underline_color=\"#DDDDDD\"\n            tl:tl_underline_height=\"1dp\"/>\n\n        <androidx.viewpager.widget.ViewPager\n            android:id=\"@+id/vp_2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"84dp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"54dp\"\n            android:background=\"#ffffff\"\n            tl:tl_iconHeight=\"23dp\"\n            tl:tl_iconWidth=\"23dp\"\n            tl:tl_indicator_color=\"#2C97DE\"\n            tl:tl_indicator_height=\"0dp\"\n            tl:tl_textSelectColor=\"#2C97DE\"\n            tl:tl_textUnselectColor=\"#66000000\"\n            tl:tl_textsize=\"12sp\"\n            tl:tl_underline_color=\"#DDDDDD\"\n            tl:tl_underline_height=\"1dp\"/>\n\n        <FrameLayout\n            android:id=\"@+id/fl_change\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"84dp\">\n        </FrameLayout>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_3\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#ffffff\"\n            tl:tl_iconGravity=\"LEFT\"\n            tl:tl_iconHeight=\"18dp\"\n            tl:tl_iconMargin=\"5dp\"\n            tl:tl_iconWidth=\"18dp\"\n            tl:tl_indicator_bounce_enable=\"false\"\n            tl:tl_indicator_color=\"#2C97DE\"\n            tl:tl_indicator_gravity=\"TOP\"\n            tl:tl_textSelectColor=\"#2C97DE\"\n            tl:tl_textUnselectColor=\"#66000000\"\n            tl:tl_textsize=\"15sp\"\n            tl:tl_underline_color=\"#DDDDDD\"\n            tl:tl_underline_gravity=\"TOP\"\n            tl:tl_underline_height=\"1dp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_4\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#F6CE59\"\n            tl:tl_iconVisible=\"false\"\n            tl:tl_textBold=\"SELECT\"\n            tl:tl_indicator_width=\"10dp\"\n            tl:tl_textsize=\"14sp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            tl:tl_textBold=\"BOTH\"\n            android:id=\"@+id/tl_5\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#EC7263\"\n            tl:tl_iconVisible=\"false\"\n            tl:tl_indicator_corner_radius=\"2dp\"\n            tl:tl_indicator_height=\"4dp\"\n            tl:tl_indicator_width=\"4dp\"\n            tl:tl_textsize=\"14sp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_6\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#57385C\"\n            tl:tl_iconVisible=\"false\"\n            tl:tl_indicator_corner_radius=\"1.5dp\"\n            tl:tl_indicator_height=\"3dp\"\n            tl:tl_indicator_width=\"10dp\"\n            tl:tl_textsize=\"14sp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_7\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#E45171\"\n            tl:tl_iconVisible=\"false\"\n            tl:tl_indicator_color=\"#eeeeee\"\n            tl:tl_indicator_corner_radius=\"1.5dp\"\n            tl:tl_indicator_height=\"3dp\"\n            tl:tl_indicator_style=\"TRIANGLE\"\n            tl:tl_indicator_width=\"10dp\"\n            tl:tl_textsize=\"14sp\"/>\n\n        <com.flyco.tablayout.CommonTabLayout\n            android:id=\"@+id/tl_8\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"48dp\"\n            android:background=\"#6D8FB0\"\n            android:paddingLeft=\"5dp\"\n            android:paddingRight=\"5dp\"\n            tl:tl_iconVisible=\"false\"\n            tl:tl_indicator_margin_left=\"5dp\"\n            tl:tl_indicator_margin_right=\"5dp\"\n            tl:tl_indicator_style=\"BLOCK\"\n            tl:tl_textsize=\"14sp\"/>\n    </LinearLayout>\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/layout/activity_segment_tab.xml",
    "content": "<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tl=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#eeeeee\"\n    android:scrollbars=\"none\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\">\n\n        <com.flyco.tablayout.SegmentTabLayout\n            android:id=\"@+id/tl_1\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"32dp\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"10dp\"\n            tl:tl_bar_color=\"#ffffff\"\n            tl:tl_indicator_color=\"#2C97DE\"\n            tl:tl_indicator_corner_radius=\"8dp\"\n            tl:tl_tab_padding=\"20dp\"/>\n\n        <com.flyco.tablayout.SegmentTabLayout\n            android:id=\"@+id/tl_2\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"36dp\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"10dp\"\n            android:paddingLeft=\"10dp\"\n            android:paddingRight=\"10dp\"\n            tl:tl_indicator_anim_enable=\"true\"\n            tl:tl_indicator_bounce_enable=\"false\"\n            tl:tl_indicator_color=\"#009688\"\n            tl:tl_tab_padding=\"20dp\"/>\n\n        <com.flyco.tablayout.SegmentTabLayout\n            android:id=\"@+id/tl_3\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"36dp\"\n            android:layout_marginTop=\"10dp\"\n            android:paddingLeft=\"25dp\"\n            android:paddingRight=\"25dp\"\n            tl:tl_bar_color=\"#ffffff\"\n            tl:tl_indicator_anim_enable=\"true\"\n            tl:tl_indicator_color=\"#F6CE59\"\n            tl:tl_indicator_margin_bottom=\"2dp\"\n            tl:tl_indicator_margin_left=\"2dp\"\n            tl:tl_indicator_margin_right=\"2dp\"\n            tl:tl_indicator_margin_top=\"2dp\"\n            tl:tl_textBold=\"SELECT\"/>\n\n        <androidx.viewpager.widget.ViewPager\n            android:id=\"@+id/vp_2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"84dp\"/>\n\n        <com.flyco.tablayout.SegmentTabLayout\n            android:id=\"@+id/tl_4\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"36dp\"\n            android:layout_gravity=\"center_horizontal\"\n            android:paddingLeft=\"10dp\"\n            android:paddingRight=\"10dp\"\n            tl:tl_bar_color=\"#ffffff\"\n            tl:tl_indicator_color=\"#EC7263\"\n            tl:tl_indicator_margin_bottom=\"2dp\"\n            tl:tl_indicator_margin_left=\"2dp\"\n            tl:tl_indicator_margin_right=\"2dp\"\n            tl:tl_indicator_margin_top=\"2dp\"\n            tl:tl_tab_width=\"80dp\"\n            tl:tl_textBold=\"BOTH\"/>\n\n        <FrameLayout\n            android:id=\"@+id/fl_change\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"84dp\"/>\n\n        <com.flyco.tablayout.SegmentTabLayout\n            android:id=\"@+id/tl_5\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"36dp\"\n            android:layout_gravity=\"center_horizontal\"\n            android:paddingLeft=\"30dp\"\n            android:paddingRight=\"30dp\"\n            tl:tl_indicator_anim_enable=\"true\"\n            tl:tl_indicator_bounce_enable=\"false\"\n            tl:tl_indicator_margin_bottom=\"2dp\"\n            tl:tl_indicator_margin_left=\"2dp\"\n            tl:tl_indicator_margin_right=\"2dp\"\n            tl:tl_indicator_margin_top=\"2dp\"\n            tl:tl_tab_space_equal=\"true\"/>\n    </LinearLayout>\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/layout/activity_sliding_tab.xml",
    "content": "<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tl=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"#eeeeee\"\n    android:scrollbars=\"none\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\">\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\">\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_1\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"#666666\"\n                android:paddingBottom=\"15dp\"\n                android:paddingTop=\"15dp\"\n                tl:tl_indicator_gravity=\"TOP\"\n                tl:tl_textBold=\"SELECT\"\n                tl:tl_underline_color=\"#1A000000\"\n                tl:tl_underline_gravity=\"TOP\"\n                tl:tl_underline_height=\"1dp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_2\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#EEEEEE\"\n                tl:tl_divider_color=\"#1A000000\"\n                tl:tl_divider_padding=\"13dp\"\n                tl:tl_divider_width=\"1dp\"\n                tl:tl_indicator_color=\"#000000\"\n                tl:tl_indicator_height=\"1.5dp\"\n                tl:tl_indicator_width_equal_title=\"true\"\n                tl:tl_tab_padding=\"22dp\"\n                tl:tl_tab_space_equal=\"true\"\n                tl:tl_textSelectColor=\"#000000\"\n                tl:tl_textUnselectColor=\"#66000000\"\n                tl:tl_underline_color=\"#1A000000\"\n                tl:tl_underline_height=\"1dp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_3\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#3F9FE0\"\n                tl:tl_textAllCaps=\"true\"\n                tl:tl_textBold=\"BOTH\"\n                tl:tl_textsize=\"14sp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_4\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#009688\"\n                tl:tl_tab_padding=\"0dp\"\n                tl:tl_tab_width=\"95dp\"\n                tl:tl_textsize=\"15sp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_5\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#F6CE59\"\n                tl:tl_indicator_width=\"10dp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_6\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#EC7263\"\n                tl:tl_indicator_corner_radius=\"2dp\"\n                tl:tl_indicator_height=\"4dp\"\n                tl:tl_indicator_width=\"4dp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_7\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#57385C\"\n                tl:tl_indicator_corner_radius=\"1.5dp\"\n                tl:tl_indicator_height=\"3dp\"\n                tl:tl_indicator_width=\"10dp\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_8\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#E45171\"\n                tl:tl_indicator_color=\"#eeeeee\"\n                tl:tl_indicator_style=\"TRIANGLE\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_9\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#6D8FB0\"\n                android:paddingLeft=\"5dp\"\n                android:paddingRight=\"5dp\"\n                tl:tl_indicator_margin_left=\"2dp\"\n                tl:tl_indicator_margin_right=\"2dp\"\n                tl:tl_indicator_style=\"BLOCK\"/>\n\n            <com.flyco.tablayout.SlidingTabLayout\n                android:id=\"@+id/tl_10\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"48dp\"\n                android:background=\"#222831\"\n                android:paddingLeft=\"5dp\"\n                android:paddingRight=\"5dp\"\n                tl:tl_indicator_color=\"#393E46\"\n                tl:tl_indicator_corner_radius=\"5dp\"\n                tl:tl_indicator_margin_left=\"2dp\"\n                tl:tl_indicator_margin_right=\"2dp\"\n                tl:tl_indicator_style=\"BLOCK\"/>\n\n        </LinearLayout>\n\n        <androidx.viewpager.widget.ViewPager\n            android:id=\"@+id/vp\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"84dp\"/>\n\n    </LinearLayout>\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/layout/fr_simple_card.xml",
    "content": "<RelativeLayout\r\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\">\r\n\r\n    <TextView\r\n        android:id=\"@+id/card_title_tv\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        android:layout_margin=\"10dp\"\r\n        android:background=\"@drawable/background_card\"\r\n        android:gravity=\"center\"\r\n        android:textSize=\"18sp\"/>\r\n\r\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#8BC34A</color>\n    <color name=\"colorPrimaryDark\">#689F38</color>\n    <color name=\"colorAccent\">#FF4081</color>\n    <color name=\"textColorPrimary\">#FFFFFF</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">FlycoTabLayout</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n        <item name=\"android:textColorPrimary\">@color/textColorPrimary</item>\n    </style>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n    </style>\n\n    <style name=\"AppTheme.AppBarOverlay\" parent=\"ThemeOverlay.AppCompat.Dark.ActionBar\"/>\n\n    <style name=\"AppTheme.PopupOverlay\" parent=\"ThemeOverlay.AppCompat.Light\"/>\n\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\napply from: 'dependencies.gradle'\n\nbuildscript {\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:4.2.2'\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "dependencies.gradle",
    "content": "ext {\n    minSdkVersion = 16\n    targetSdkVersion = 29\n    compileSdkVersion = 29\n    buildToolsVersion = '29.0.2'\n    versionCode = 100\n    versionName = '1.0.0'\n\n    lifecycle_version = '2.3.1'\n\n    support = [\n            'v4'                    : \"androidx.legacy:legacy-support-v4:1.0.0\",\n            'annotations'           : \"androidx.annotation:annotation:1.1.0\",\n            'appcompat'             : \"androidx.appcompat:appcompat:1.2.0\",\n            'recyclerview'          : \"androidx.recyclerview:recyclerview:1.1.0\",\n            'design'                : \"com.google.android.material:material:1.2.1\",\n            'constraintlayout'      : \"androidx.constraintlayout:constraintlayout:2.0.4\",\n    ]\n\n    arch_lifecycle = [\n            'viewmodel'             : \"androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version\",\n            'livedata'              : \"androidx.lifecycle:lifecycle-livedata:$lifecycle_version\",\n            'lifecycle'             : \"androidx.lifecycle:lifecycle-runtime:$lifecycle_version\",\n            'lifecycle-ktx'         : \"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version\",\n            'lifecycle-process'     : \"androidx.lifecycle:lifecycle-process:$lifecycle_version\",\n    ]\n}"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Nov 25 18:19:50 CST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.7.1-bin.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\nandroid.useAndroidX=true\n\n# com.flyco.tablayout:flycoTabLayout:3.0.0\nGROUP=io.github.h07000223\nPOM_ARTIFACT_ID=flycoTabLayout\nVERSION_NAME=3.0.0\n\nPOM_NAME=FlycoTabLayout\nPOM_DESCRIPTION=Android TabLayout Library\nPOM_INCEPTION_YEAR=2021\nPOM_URL=https://github.com/H07000223/FlycoTabLayout\n\nPOM_LICENSE_NAME=The Apache Software License, Version 2.0\nPOM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt\nPOM_LICENSE_DIST=repo\n\nPOM_SCM_URL=https://github.com/H07000223/FlycoTabLayout\nPOM_SCM_CONNECTION=scm:git:git://github.com/H07000223/FlycoTabLayout.git\nPOM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/H07000223/FlycoTabLayout.git\n\nPOM_DEVELOPER_ID=H07000223\nPOM_DEVELOPER_NAME=H07000223\nPOM_DEVELOPER_URL=https://github.com/H07000223\n\n# 密钥ID的后8位\nsigning.keyId=\n# 密钥密码\nsigning.password=\nsigning.secretKeyRingFile=\n\n# Sonatype账号&密码\nmavenCentralUsername=\nmavenCentralPassword="
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app', ':FlycoTabLayout_Lib'\n"
  }
]