diff options
| author | 2016-02-20 09:44:46 -0500 | |
|---|---|---|
| committer | 2016-02-20 16:56:07 +0000 | |
| commit | 74351554328e56fdd02eb09d93a98aaf97ccce04 (patch) | |
| tree | 3746116ae1ec460d515d6ea7c0042cf6f5ae929e | |
| parent | 865a4ee0cddedc8ef11f8370390e197e9ae95067 (diff) | |
Don't set the text on QS Tiles unless we need to
Avoid causing layout passes.
Bug: 27278616
Change-Id: I5104a756b44154f6b66f2c74aee17caf29acf628
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QSTileView.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java index 6fa23e794041..98a1c23aa645 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java @@ -28,6 +28,7 @@ import android.widget.TextView; import com.android.systemui.FontSizeUtils; import com.android.systemui.R; +import libcore.util.Objects; /** View that represents a standard quick settings tile. **/ public class QSTileView extends QSTileBaseView { @@ -90,7 +91,9 @@ public class QSTileView extends QSTileBaseView { protected void handleStateChanged(QSTile.State state) { super.handleStateChanged(state); - mLabel.setText(state.label); + if (!Objects.equal(mLabel.getText(), state.label)) { + mLabel.setText(state.label); + } mLabel.setEnabled(!state.disabledByPolicy); mPadLock.setVisibility(state.disabledByPolicy ? View.VISIBLE : View.GONE); } |