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

Commit 5c848ce7 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Keep original DialogTitle color when resizing.

Change-Id: Id9d3bf565cc5660ab37037e74be63221cd638ba6
parent 35a9c527
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -53,21 +53,19 @@ public class DialogTitle extends TextView {
                final int ellipsisCount = layout.getEllipsisCount(lineCount - 1);
                if (ellipsisCount > 0) {
                    setSingleLine(false);
                    setMaxLines(2);

                    TypedArray a = mContext.obtainStyledAttributes(null,
                            android.R.styleable.TextAppearance,
                            android.R.attr.textAppearanceMedium,
                    final TypedArray a = mContext.obtainStyledAttributes(null,
                            android.R.styleable.TextAppearance, android.R.attr.textAppearanceMedium,
                            android.R.style.TextAppearance_Medium);
                    final int textSize = a.getDimensionPixelSize(
                            android.R.styleable.TextAppearance_textSize,
                            (int) (20 * getResources().getDisplayMetrics().density));
                    final int textColor = a.getColor(
                            android.R.styleable.TextAppearance_textColor, 0xffffffff);

                            android.R.styleable.TextAppearance_textSize, 0);
                    if (textSize != 0) {
                        // textSize is already expressed in pixels
                        setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
                    setTextColor(textColor);
                    setMaxLines(2);
                    }
                    a.recycle();

                    super.onMeasure(widthMeasureSpec, heightMeasureSpec);      
                }
            }