From f61f411203f515b5816d91f8b57e58c0c406f153 Mon Sep 17 00:00:00 2001 From: Vadim Sinitskiy Date: Wed, 13 Apr 2022 11:11:38 +0300 Subject: [PATCH] Fix Text is not completely shown in Expanded State https://github.com/Manabu-GT/ExpandableTextView/issues/75 --- .../android/expandabletextview/ExpandableTextView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/main/java/com/ms/square/android/expandabletextview/ExpandableTextView.java b/lib/src/main/java/com/ms/square/android/expandabletextview/ExpandableTextView.java index fb1b867..6c450fc 100644 --- a/lib/src/main/java/com/ms/square/android/expandabletextview/ExpandableTextView.java +++ b/lib/src/main/java/com/ms/square/android/expandabletextview/ExpandableTextView.java @@ -207,9 +207,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { return; } - // Saves the text height w/ max lines - mTextHeightWithMaxLines = getRealTextViewHeight(mTv); - // Doesn't fit in collapsed mode. Collapse text view as needed. Show // button. if (mCollapsed) { @@ -219,6 +216,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // Re-measure with new setup super.onMeasure(widthMeasureSpec, heightMeasureSpec); + + // Saves the text height w/ max lines + mTextHeightWithMaxLines = getRealTextViewHeight(mTv); if (mCollapsed) { // Gets the margin between the TextView's bottom and the ViewGroup's bottom @@ -457,4 +457,4 @@ public void setView(View toggleView) { mTextView = (TextView) toggleView; } } -} \ No newline at end of file +}