| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | 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() |
| | |
| | | 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); |