Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63e530d7 authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "[CollapsableTextView] Update collapse button visibility based on text lines." into main

parents f5c64d41 66a3db88
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -120,6 +120,11 @@ class CollapsableTextView @JvmOverloads constructor(
        }
    }

    override fun onMeasure(p0: Int, p1: Int) {
        super.onMeasure(p0, p1)
        updateView()
    }

    /**
     * Sets the text content of the CollapsableTextView.
     * @param text The text to display.
@@ -243,7 +248,8 @@ class CollapsableTextView @JvmOverloads constructor(
                titleTextView.ellipsize = TextUtils.TruncateAt.END
            }
        }
        collapseButton.visibility = if (isCollapsable) VISIBLE else GONE
        collapseButton.visibility =
            if (isCollapsable && titleTextView.lineCount > minLines) VISIBLE else GONE
        learnMoreTextView.visibility = if (isLearnMoreEnabled && !isCollapsed) VISIBLE else GONE
    }