[V2 Tab UI] Fix icon too big

This commit is contained in:
khanhduytran0 2020-12-15 13:59:29 +07:00
parent e3e2f59948
commit 8b9acb3448

View File

@ -1743,8 +1743,8 @@ public class VerticalTabLayout extends LinearLayout {
if (mIconView == null) { if (mIconView == null) {
ImageView iconView = (ImageView) LayoutInflater.from(getContext()) ImageView iconView = (ImageView) LayoutInflater.from(getContext())
.inflate(R.layout.design_layout_tab_icon, this, false); .inflate(R.layout.design_layout_tab_icon, this, false);
iconView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, iconView.setLayoutParams(new LinearLayout.LayoutParams(dpToPx(25),
ViewGroup.LayoutParams.MATCH_PARENT)); dpToPx(25)));
addView(iconView, 0); addView(iconView, 0);
mIconView = iconView; mIconView = iconView;
} }
@ -1753,7 +1753,7 @@ public class VerticalTabLayout extends LinearLayout {
.inflate(R.layout.design_layout_tab_text, this, false); .inflate(R.layout.design_layout_tab_text, this, false);
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT); ViewGroup.LayoutParams.MATCH_PARENT);
textParams.gravity = Gravity.TOP | Gravity.CENTER_VERTICAL; textParams.gravity = Gravity.CENTER_VERTICAL;
textView.setLayoutParams(textParams); textView.setLayoutParams(textParams);
addView(textView); addView(textView);
mTextView = textView; mTextView = textView;