Merge "Only notify listeners when actual height changes" into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-06-15 13:49:03 +00:00
committed by Android (Google) Code Review

View File

@@ -186,12 +186,14 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
* @param notifyListeners Whether the listener should be informed about the change. * @param notifyListeners Whether the listener should be informed about the change.
*/ */
public void setActualHeight(int actualHeight, boolean notifyListeners) { public void setActualHeight(int actualHeight, boolean notifyListeners) {
if (mActualHeight != actualHeight) {
mActualHeight = actualHeight; mActualHeight = actualHeight;
updateClipping(); updateClipping();
if (notifyListeners) { if (notifyListeners) {
notifyHeightChanged(false /* needsAnimation */); notifyHeightChanged(false /* needsAnimation */);
} }
} }
}
public void setActualHeight(int actualHeight) { public void setActualHeight(int actualHeight) {
setActualHeight(actualHeight, true /* notifyListeners */); setActualHeight(actualHeight, true /* notifyListeners */);