From b6650bf02d0926f5bc056a00350d928d483ad265 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Wed, 1 Jun 2016 18:12:46 -0700 Subject: [PATCH] Also update setMinLines If we switch to single-line, the min lines property gets overriden so we need to manually call setMinLines to reset the state to the initial state. Change-Id: I1b47a093981045c2c0d176c831e37f8e9431ae1c Fixes: 29056442 --- .../android/systemui/qs/customize/CustomizeTileView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/CustomizeTileView.java b/packages/SystemUI/src/com/android/systemui/qs/customize/CustomizeTileView.java index e512f93f2ced7..26fc6dfdd9229 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/CustomizeTileView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/CustomizeTileView.java @@ -26,7 +26,7 @@ import libcore.util.Objects; public class CustomizeTileView extends QSTileView { private TextView mAppLabel; - + private int mLabelMinLines; public CustomizeTileView(Context context, QSIconView icon) { super(context, icon); } @@ -34,6 +34,7 @@ public class CustomizeTileView extends QSTileView { @Override protected void createLabel() { super.createLabel(); + mLabelMinLines = mLabel.getMinLines(); View view = LayoutInflater.from(mContext).inflate(R.layout.qs_tile_label, null); mAppLabel = (TextView) view.findViewById(R.id.tile_label); mAppLabel.setAlpha(.6f); @@ -44,6 +45,9 @@ public class CustomizeTileView extends QSTileView { public void setShowAppLabel(boolean showAppLabel) { mAppLabel.setVisibility(showAppLabel ? View.VISIBLE : View.GONE); mLabel.setSingleLine(showAppLabel); + if (!showAppLabel) { + mLabel.setMinLines(mLabelMinLines); + } } public void setAppLabel(CharSequence label) {