diff --git a/app/src/main/java/android/support/design/widget/VerticalTabLayout.java b/app/src/main/java/android/support/design/widget/VerticalTabLayout.java index 2e33a8331..af267e69d 100644 --- a/app/src/main/java/android/support/design/widget/VerticalTabLayout.java +++ b/app/src/main/java/android/support/design/widget/VerticalTabLayout.java @@ -1743,12 +1743,18 @@ public class VerticalTabLayout extends LinearLayout { if (mIconView == null) { ImageView iconView = (ImageView) LayoutInflater.from(getContext()) .inflate(R.layout.design_layout_tab_icon, this, false); + iconView.serLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.MATCH_PARENT)); addView(iconView, 0); mIconView = iconView; } if (mTextView == null) { TextView textView = (TextView) LayoutInflater.from(getContext()) .inflate(R.layout.design_layout_tab_text, this, false); + LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT); + textParams.gravity = Gravity.TOP | Gravity.CENTER_VERTICAL; + textView.setLayoutParams(textParams); addView(textView); mTextView = textView; mDefaultMaxLines = TextViewCompat.getMaxLines(mTextView); @@ -2016,9 +2022,6 @@ public class VerticalTabLayout extends LinearLayout { mIndicatorAnimator.cancel(); } - final boolean isRtl = ViewCompat.getLayoutDirection(this) - == ViewCompat.LAYOUT_DIRECTION_RTL; - final View targetView = getChildAt(position); if (targetView == null) { // If we don't have a view, just update the position now and return