Loading packages/SystemUI/res/layout/qs_tile_label.xml +2 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ android:maxLines="2" android:padding="0dp" android:gravity="center" android:ellipsize="end" android:ellipsize="marquee" android:textAppearance="@style/TextAppearance.QS.TileLabel" android:textColor="?android:attr/textColorPrimary"/> Loading Loading @@ -75,6 +75,7 @@ android:layout_alignEnd="@id/label_group" android:layout_below="@id/label_group" android:clickable="false" android:ellipsize="marquee" android:maxLines="1" android:padding="0dp" android:visibility="gone" Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java +21 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,12 @@ import com.android.systemui.R; import com.android.systemui.plugins.qs.QSIconView; import com.android.systemui.plugins.qs.QSTile; import java.util.Objects; /** View that represents a standard quick settings tile. **/ public class QSTileView extends QSTileBaseView { private static final int DEFAULT_MAX_LINES = 2; private static final boolean DUAL_TARGET_ALLOWED = false; private View mDivider; protected TextView mLabel; Loading @@ -61,7 +62,7 @@ public class QSTileView extends QSTileBaseView { setId(View.generateViewId()); createLabel(); setOrientation(VERTICAL); setGravity(Gravity.CENTER); setGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP); } TextView getLabel() { Loading @@ -72,6 +73,7 @@ public class QSTileView extends QSTileBaseView { protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); FontSizeUtils.updateFontSize(mLabel, R.dimen.qs_tile_text_size); FontSizeUtils.updateFontSize(mSecondLine, R.dimen.qs_tile_text_size); } @Override Loading @@ -85,16 +87,32 @@ public class QSTileView extends QSTileBaseView { mLabelContainer.setClipChildren(false); mLabelContainer.setClipToPadding(false); mLabel = mLabelContainer.findViewById(R.id.tile_label); mLabel.setSelected(true); // Allow marquee to work. mPadLock = mLabelContainer.findViewById(R.id.restricted_padlock); mDivider = mLabelContainer.findViewById(R.id.underline); mExpandIndicator = mLabelContainer.findViewById(R.id.expand_indicator); mExpandSpace = mLabelContainer.findViewById(R.id.expand_space); mSecondLine = mLabelContainer.findViewById(R.id.app_label); mSecondLine.setAlpha(.6f); mSecondLine.setSelected(true); // Allow marquee to work. addView(mLabelContainer); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mLabel.getMaxLines() != DEFAULT_MAX_LINES) { mLabel.setMaxLines(DEFAULT_MAX_LINES); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); // Remeasure view if the secondary label text will be cut off. if (!TextUtils.isEmpty(mSecondLine.getText()) && mSecondLine.getLineHeight() > mSecondLine.getHeight()) { mLabel.setSingleLine(); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } @Override protected void handleStateChanged(QSTile.State state) { super.handleStateChanged(state); Loading Loading
packages/SystemUI/res/layout/qs_tile_label.xml +2 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ android:maxLines="2" android:padding="0dp" android:gravity="center" android:ellipsize="end" android:ellipsize="marquee" android:textAppearance="@style/TextAppearance.QS.TileLabel" android:textColor="?android:attr/textColorPrimary"/> Loading Loading @@ -75,6 +75,7 @@ android:layout_alignEnd="@id/label_group" android:layout_below="@id/label_group" android:clickable="false" android:ellipsize="marquee" android:maxLines="1" android:padding="0dp" android:visibility="gone" Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java +21 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,12 @@ import com.android.systemui.R; import com.android.systemui.plugins.qs.QSIconView; import com.android.systemui.plugins.qs.QSTile; import java.util.Objects; /** View that represents a standard quick settings tile. **/ public class QSTileView extends QSTileBaseView { private static final int DEFAULT_MAX_LINES = 2; private static final boolean DUAL_TARGET_ALLOWED = false; private View mDivider; protected TextView mLabel; Loading @@ -61,7 +62,7 @@ public class QSTileView extends QSTileBaseView { setId(View.generateViewId()); createLabel(); setOrientation(VERTICAL); setGravity(Gravity.CENTER); setGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP); } TextView getLabel() { Loading @@ -72,6 +73,7 @@ public class QSTileView extends QSTileBaseView { protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); FontSizeUtils.updateFontSize(mLabel, R.dimen.qs_tile_text_size); FontSizeUtils.updateFontSize(mSecondLine, R.dimen.qs_tile_text_size); } @Override Loading @@ -85,16 +87,32 @@ public class QSTileView extends QSTileBaseView { mLabelContainer.setClipChildren(false); mLabelContainer.setClipToPadding(false); mLabel = mLabelContainer.findViewById(R.id.tile_label); mLabel.setSelected(true); // Allow marquee to work. mPadLock = mLabelContainer.findViewById(R.id.restricted_padlock); mDivider = mLabelContainer.findViewById(R.id.underline); mExpandIndicator = mLabelContainer.findViewById(R.id.expand_indicator); mExpandSpace = mLabelContainer.findViewById(R.id.expand_space); mSecondLine = mLabelContainer.findViewById(R.id.app_label); mSecondLine.setAlpha(.6f); mSecondLine.setSelected(true); // Allow marquee to work. addView(mLabelContainer); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mLabel.getMaxLines() != DEFAULT_MAX_LINES) { mLabel.setMaxLines(DEFAULT_MAX_LINES); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); // Remeasure view if the secondary label text will be cut off. if (!TextUtils.isEmpty(mSecondLine.getText()) && mSecondLine.getLineHeight() > mSecondLine.getHeight()) { mLabel.setSingleLine(); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } @Override protected void handleStateChanged(QSTile.State state) { super.handleStateChanged(state); Loading