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

Commit 74351554 authored by Jason Monk's avatar Jason Monk
Browse files

Don't set the text on QS Tiles unless we need to

Avoid causing layout passes.

Bug: 27278616
Change-Id: I5104a756b44154f6b66f2c74aee17caf29acf628
parent 865a4ee0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
        if (!Objects.equal(mLabel.getText(), state.label)) {
            mLabel.setText(state.label);
        }
        mLabel.setEnabled(!state.disabledByPolicy);
        mPadLock.setVisibility(state.disabledByPolicy ? View.VISIBLE : View.GONE);
    }