Skip to content
Browse files

Use Clockopia as the typeface for the digital clock.

  • Loading branch information...
1 parent 93e942a commit 52b3d633a031c64dcefefc4884b9cea5781425c2 Patrick Scott committed Oct 20, 2009
Showing with 8 additions and 2 deletions.
  1. BIN assets/fonts/Clockopia.ttf
  2. +8 −2 src/com/android/deskclock/DigitalClock.java
View
BIN assets/fonts/Clockopia.ttf
Binary file not shown.
View
10 src/com/android/deskclock/DigitalClock.java
@@ -22,6 +22,7 @@
import android.content.IntentFilter;
import android.content.res.Resources;
import android.database.ContentObserver;
+import android.graphics.Typeface;
import android.os.Handler;
import android.provider.Settings;
import android.text.format.DateFormat;
@@ -66,10 +67,12 @@ public void onReceive(Context context, Intent intent) {
private LinearLayout mAmPmLayout;
private TextView mAm, mPm;
- AmPm(View parent) {
+ AmPm(View parent, Typeface tf) {
mAmPmLayout = (LinearLayout) parent.findViewById(R.id.am_pm);
mAm = (TextView)mAmPmLayout.findViewById(R.id.am);
+ mAm.setTypeface(tf);
mPm = (TextView)mAmPmLayout.findViewById(R.id.pm);
+ mPm.setTypeface(tf);
Resources r = parent.getResources();
mColorOn = r.getColor(R.color.ampm_on);
@@ -109,8 +112,11 @@ public DigitalClock(Context context, AttributeSet attrs) {
protected void onFinishInflate() {
super.onFinishInflate();
+ Typeface tf = Typeface.createFromAsset(getContext().getAssets(),
+ "fonts/Clockopia.ttf");
mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);
- mAmPm = new AmPm(this);
+ mTimeDisplay.setTypeface(tf);
+ mAmPm = new AmPm(this, tf);
mCalendar = Calendar.getInstance();
setDateFormat();

0 comments on commit 52b3d63

Please sign in to comment.
Something went wrong with that request. Please try again.