| | |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.lcjian.library.util.common.DimenUtils; |
| | | |
| | | /** |
| | | * This widget implements the dynamic action bar tab behavior that can change |
| | | * across different configurations or circumstances. |
| | |
| | | } |
| | | ((TextView) tabView).setTextColor(Color.WHITE); |
| | | ((TextView) tabView).setTextSize( |
| | | TypedValue.COMPLEX_UNIT_SP, 18); |
| | | TypedValue.COMPLEX_UNIT_SP, 20); |
| | | // ((TextView) tabView).setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT,WRAP_CONTENT)); |
| | | mTabSelector = new Runnable() { |
| | | public void run() { |
| | |
| | | tabView.setText(text); |
| | | tabView.setTextColor(R.color.black1); |
| | | |
| | | tabView.setBackgroundResource(R.drawable.found__tab_indicator); |
| | | |
| | | if (iconResId != 0) { |
| | | tabView.setCompoundDrawablesWithIntrinsicBounds(iconResId, 0, 0, 0); |
| | | } |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, |
| | | MATCH_PARENT, 1); |
| | | |
| | | mTabLayout.addView(tabView, params); |
| | | MarginLayoutParams marginLayoutParams = (MarginLayoutParams) tabView.getLayoutParams(); |
| | | if (index == 0) |
| | | marginLayoutParams.leftMargin = DimenUtils.dip2px(getContext(), 10); |
| | | else |
| | | marginLayoutParams.leftMargin = DimenUtils.dip2px(getContext(), 21); |
| | | } |
| | | |
| | | @Override |