From 35793cdcd505c162917cd02d043146288f349360 Mon Sep 17 00:00:00 2001 From: ztelur Date: Sat, 23 Jan 2016 17:19:28 +0800 Subject: [PATCH] replace getHeight with getMeasuredHeight --- .../android/expandabletextview/ExpandableTextView.java | 9 ++------- 1 file changed, 2 insertions(+), 7 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 3028207..ab0c468 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,15 +207,10 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (mCollapsed) { - // Gets the margin between the TextView's bottom and the ViewGroup's bottom - mTv.post(new Runnable() { - @Override - public void run() { - mMarginBetweenTxtAndBottom = getHeight() - mTv.getHeight(); - } - }); // Saves the collapsed height of this ViewGroup mCollapsedHeight = getMeasuredHeight(); + // Gets the margin between the TextView's bottom and the ViewGroup's bottom + mMarginBetweenTxtAndBottom = mCollapsedHeight - mTv.getMeasuredHeight(); } }