Merge "Make the clock font a little thicker" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-05-23 17:59:24 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
<dimen name="widget_big_font_size">64dp</dimen>
<!-- Clock with header -->
<dimen name="widget_small_font_size">24dp</dimen>
<dimen name="widget_small_font_stroke">0.6dp</dimen>
<!-- Dash between clock and header -->
<dimen name="widget_separator_width">12dp</dimen>
<dimen name="widget_separator_thickness">1dp</dimen>

View File

@@ -23,6 +23,7 @@ import android.app.IActivityManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
@@ -179,6 +180,8 @@ public class KeyguardStatusView extends GridLayout implements
mVisibleInDoze = Sets.newArraySet(mClockView, mKeyguardSlice);
mTextColor = mClockView.getCurrentTextColor();
int clockStroke = getResources().getDimensionPixelSize(R.dimen.widget_small_font_stroke);
mClockView.getPaint().setStrokeWidth(clockStroke);
mClockView.addOnLayoutChangeListener(this);
mClockSeparator.addOnLayoutChangeListener(this);
mKeyguardSlice.setContentChangeListener(this::onSliceContentChanged);
@@ -227,6 +230,7 @@ public class KeyguardStatusView extends GridLayout implements
if (view == mClockView) {
float clockScale = smallClock ? mSmallClockScale : 1;
Paint.Style style = smallClock ? Paint.Style.FILL_AND_STROKE : Paint.Style.FILL;
if (mAnimateLayout) {
mClockView.setY(oldTop + heightOffset);
mClockView.animate().cancel();
@@ -238,11 +242,17 @@ public class KeyguardStatusView extends GridLayout implements
.y(top)
.scaleX(clockScale)
.scaleY(clockScale)
.withEndAction(() -> {
mClockView.getPaint().setStyle(style);
mClockView.invalidate();
})
.start();
} else {
mClockView.setY(top);
mClockView.setScaleX(clockScale);
mClockView.setScaleY(clockScale);
mClockView.getPaint().setStyle(style);
mClockView.invalidate();
}
} else if (view == mClockSeparator) {
boolean hasSeparator = hasHeader && !mPulsing;
@@ -280,6 +290,8 @@ public class KeyguardStatusView extends GridLayout implements
if (mClockView != null) {
mClockView.setTextSize(TypedValue.COMPLEX_UNIT_PX,
getResources().getDimensionPixelSize(R.dimen.widget_big_font_size));
mClockView.getPaint().setStrokeWidth(
getResources().getDimensionPixelSize(R.dimen.widget_small_font_stroke));
}
if (mOwnerInfo != null) {
mOwnerInfo.setTextSize(TypedValue.COMPLEX_UNIT_PX,