Prevent unecessary invalidates
updateEmptyMessage() calls invalidate() whenever size has changed. We were only updating mLastMeasuredSize when showing the empty message, however, so we were invalidating whenever updateEmptyMessage was called. Change-Id: Ic9046738e4f53d53aded6347a273522c53394991
This commit is contained in:
@@ -943,6 +943,7 @@ public abstract class RecentsView<T extends BaseActivity>
|
||||
boolean hasValidSize = getWidth() > 0 && getHeight() > 0;
|
||||
if (sizeChanged && hasValidSize) {
|
||||
mEmptyTextLayout = null;
|
||||
mLastMeasureSize.set(getWidth(), getHeight());
|
||||
}
|
||||
|
||||
if (!mShowEmptyMessage) return;
|
||||
@@ -953,7 +954,6 @@ public abstract class RecentsView<T extends BaseActivity>
|
||||
scrollTo(0, 0);
|
||||
|
||||
if (hasValidSize && mEmptyTextLayout == null) {
|
||||
mLastMeasureSize.set(getWidth(), getHeight());
|
||||
int availableWidth = mLastMeasureSize.x - mEmptyMessagePadding - mEmptyMessagePadding;
|
||||
mEmptyTextLayout = StaticLayout.Builder.obtain(mEmptyMessage, 0, mEmptyMessage.length(),
|
||||
mEmptyMessagePaint, availableWidth)
|
||||
|
||||
Reference in New Issue
Block a user