Loading src/com/android/deskclock/timer/TimerView.java +11 −12 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ public class TimerView extends LinearLayout { private ZeroTopPaddingTextView mHoursTens, mMinutesTens; private TextView mSeconds; private final Typeface mAndroidClockMonoThin; private Typeface mOriginalHoursTypeface; private final int mWhiteColor, mGrayColor; public TimerView(Context context) { Loading @@ -43,7 +42,8 @@ public class TimerView extends LinearLayout { public TimerView(Context context, AttributeSet attrs) { super(context, attrs); mAndroidClockMonoThin = Typeface.createFromAsset(context.getAssets(),"fonts/AndroidClockMono-Thin.ttf"); mAndroidClockMonoThin = Typeface.createFromAsset(context.getAssets(), "fonts/AndroidClockMono-Thin.ttf"); mWhiteColor = context.getResources().getColor(R.color.clock_white); mGrayColor = context.getResources().getColor(R.color.clock_gray); } Loading @@ -57,8 +57,15 @@ public class TimerView extends LinearLayout { mHoursOnes = (ZeroTopPaddingTextView)findViewById(R.id.hours_ones); mMinutesOnes = (ZeroTopPaddingTextView)findViewById(R.id.minutes_ones); mSeconds = (TextView)findViewById(R.id.seconds); // If we have hours tens, we are in the alarm time picker, set the hours font to thin // to prevent the need to set the top paddings (see b/7407383). if (mHoursTens != null) { mHoursTens.setTypeface(mAndroidClockMonoThin); mHoursTens.updatePadding(); if (mHoursOnes != null) { mOriginalHoursTypeface = mHoursOnes.getTypeface(); mHoursOnes.setTypeface(mAndroidClockMonoThin); mHoursOnes.updatePadding(); } } // Set the lowest time unit with thin font (excluding hundredths) if (mSeconds != null) { Loading @@ -84,29 +91,21 @@ public class TimerView extends LinearLayout { mHoursTens.setVisibility(View.INVISIBLE); } else if (hoursTensDigit == -1) { mHoursTens.setText("-"); mHoursTens.setTypeface(mAndroidClockMonoThin); mHoursTens.setTextColor(mGrayColor); mHoursTens.updatePadding(); mHoursTens.setVisibility(View.VISIBLE); } else { mHoursTens.setText(String.format("%d",hoursTensDigit)); mHoursTens.setTypeface(mOriginalHoursTypeface); mHoursTens.setTextColor(mWhiteColor); mHoursTens.updatePadding(); mHoursTens.setVisibility(View.VISIBLE); } } if (mHoursOnes != null) { if (hoursOnesDigit == -1) { mHoursOnes.setText("-"); mHoursOnes.setTypeface(mAndroidClockMonoThin); mHoursOnes.setTextColor(mGrayColor); mHoursOnes.updatePadding(); } else { mHoursOnes.setText(String.format("%d",hoursOnesDigit)); mHoursOnes.setTypeface(mOriginalHoursTypeface); mHoursOnes.setTextColor(mWhiteColor); mHoursOnes.updatePadding(); } } if (mMinutesTens != null) { Loading Loading
src/com/android/deskclock/timer/TimerView.java +11 −12 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ public class TimerView extends LinearLayout { private ZeroTopPaddingTextView mHoursTens, mMinutesTens; private TextView mSeconds; private final Typeface mAndroidClockMonoThin; private Typeface mOriginalHoursTypeface; private final int mWhiteColor, mGrayColor; public TimerView(Context context) { Loading @@ -43,7 +42,8 @@ public class TimerView extends LinearLayout { public TimerView(Context context, AttributeSet attrs) { super(context, attrs); mAndroidClockMonoThin = Typeface.createFromAsset(context.getAssets(),"fonts/AndroidClockMono-Thin.ttf"); mAndroidClockMonoThin = Typeface.createFromAsset(context.getAssets(), "fonts/AndroidClockMono-Thin.ttf"); mWhiteColor = context.getResources().getColor(R.color.clock_white); mGrayColor = context.getResources().getColor(R.color.clock_gray); } Loading @@ -57,8 +57,15 @@ public class TimerView extends LinearLayout { mHoursOnes = (ZeroTopPaddingTextView)findViewById(R.id.hours_ones); mMinutesOnes = (ZeroTopPaddingTextView)findViewById(R.id.minutes_ones); mSeconds = (TextView)findViewById(R.id.seconds); // If we have hours tens, we are in the alarm time picker, set the hours font to thin // to prevent the need to set the top paddings (see b/7407383). if (mHoursTens != null) { mHoursTens.setTypeface(mAndroidClockMonoThin); mHoursTens.updatePadding(); if (mHoursOnes != null) { mOriginalHoursTypeface = mHoursOnes.getTypeface(); mHoursOnes.setTypeface(mAndroidClockMonoThin); mHoursOnes.updatePadding(); } } // Set the lowest time unit with thin font (excluding hundredths) if (mSeconds != null) { Loading @@ -84,29 +91,21 @@ public class TimerView extends LinearLayout { mHoursTens.setVisibility(View.INVISIBLE); } else if (hoursTensDigit == -1) { mHoursTens.setText("-"); mHoursTens.setTypeface(mAndroidClockMonoThin); mHoursTens.setTextColor(mGrayColor); mHoursTens.updatePadding(); mHoursTens.setVisibility(View.VISIBLE); } else { mHoursTens.setText(String.format("%d",hoursTensDigit)); mHoursTens.setTypeface(mOriginalHoursTypeface); mHoursTens.setTextColor(mWhiteColor); mHoursTens.updatePadding(); mHoursTens.setVisibility(View.VISIBLE); } } if (mHoursOnes != null) { if (hoursOnesDigit == -1) { mHoursOnes.setText("-"); mHoursOnes.setTypeface(mAndroidClockMonoThin); mHoursOnes.setTextColor(mGrayColor); mHoursOnes.updatePadding(); } else { mHoursOnes.setText(String.format("%d",hoursOnesDigit)); mHoursOnes.setTypeface(mOriginalHoursTypeface); mHoursOnes.setTextColor(mWhiteColor); mHoursOnes.updatePadding(); } } if (mMinutesTens != null) { Loading