<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="48dp"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
android:paddingTop="8dp">
<LinearLayout
android:id="@+id/label_group"
android:visibility="gone" />
</LinearLayout>
+ <TextView
+ android:id="@+id/app_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignStart="@id/label_group"
+ android:layout_alignEnd="@id/label_group"
+ android:layout_below="@id/label_group"
+ android:clickable="false"
+ android:maxLines="1"
+ android:padding="0dp"
+ android:visibility="gone"
+ android:gravity="center"
+ android:textAppearance="@style/TextAppearance.QS.TileLabel"
+ android:textColor="?android:attr/textColorPrimary"/>
+
<View
android:id="@+id/underline"
android:layout_width="30dp"
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 = findViewById(R.id.app_label);
mAppLabel.setAlpha(.6f);
- mAppLabel.setSingleLine(true);
- addView(view);
}
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) {