From 2eec3de87b6b616a69a46c1f97c2397159031d2f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 21 十一月 2023 18:01:43 +0800 Subject: [PATCH] 广告升级/bug修复 --- library-ViewPagerIndicator/src/com/viewpagerindicator/MTabPageIndicator.java | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/library-ViewPagerIndicator/src/com/viewpagerindicator/MTabPageIndicator.java b/library-ViewPagerIndicator/src/com/viewpagerindicator/MTabPageIndicator.java index 6d5ddff..9c6fa66 100644 --- a/library-ViewPagerIndicator/src/com/viewpagerindicator/MTabPageIndicator.java +++ b/library-ViewPagerIndicator/src/com/viewpagerindicator/MTabPageIndicator.java @@ -22,9 +22,9 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Color; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v4.view.ViewPager.OnPageChangeListener; +import androidx.viewpager.widget.PagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.viewpager.widget.ViewPager.OnPageChangeListener; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; @@ -32,8 +32,6 @@ import android.widget.HorizontalScrollView; import android.widget.LinearLayout; import android.widget.TextView; - -import com.lcjian.library.widget.IsPad; /** * This widget implements the dynamic action bar tab behavior that can change @@ -98,6 +96,14 @@ MATCH_PARENT)); } + private int textColor; + private int highLightColor; + + public void setTextColor(int textColor, int highLightColor) { + this.textColor = textColor; + this.highLightColor = highLightColor; + } + public void setOnTabReselectedListener(OnTabReselectedListener listener) { mTabReselectedListener = listener; } @@ -143,12 +149,10 @@ } for (int i = 0; i < mTabLayout.getChildCount(); i++) { - ((TextView) mTabLayout.getChildAt(i)).setTextColor(Color.argb(255, - 255, 255, 255)); + ((TextView) mTabLayout.getChildAt(i)).setTextColor(textColor); } - // ((TextView) tabView).setTextColor(Color.argb(255, 24, 180, - // 237));//argb(255, 6, 124, 246) - ((TextView) tabView).setTextColor(Color.argb(255, 247, 219, 0));// 鏈ㄧ摐绯诲垪 + + ((TextView) tabView).setTextColor(highLightColor);// 鏈ㄧ摐绯诲垪 mTabSelector = new Runnable() { public void run() { final int scrollPos = tabView.getLeft() @@ -192,9 +196,10 @@ tabView.setFocusable(true); tabView.setOnClickListener(mTabClickListener); tabView.setText(text); - tabView.setTextColor(getResources().getColor(R.color.black1)); - if (IsPad.isPad(tabView.getContext())) - tabView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 25); + tabView.setTextColor(textColor); + tabView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); + + tabView.setBackgroundColor(Color.TRANSPARENT); if (iconResId != 0) { tabView.setCompoundDrawablesWithIntrinsicBounds(iconResId, 0, 0, 0); -- Gitblit v1.8.0