From: Daniel Sandler Date: Fri, 6 Nov 2009 16:27:27 +0000 (-0500) Subject: DeskClock UI fixes. X-Git-Tag: android-x86-2.2~36^2^2~38 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fpackages-apps-DeskClock.git;a=commitdiff_plain;h=daa1dd3eb9ebb69817babdb74b125dc63889eb45 DeskClock UI fixes. - darker shade on the user's background - stop clipping the left-hand side of the time (was moving it over to accommodate Clockopia's generous tracking, but it's causing drawing issues) - AM/PM now in Droid Sans - calmer green in screen-saver mode --- diff --git a/res/layout/desk_clock_time_date.xml b/res/layout/desk_clock_time_date.xml index 068d03b..1eb1d53 100644 --- a/res/layout/desk_clock_time_date.xml +++ b/res/layout/desk_clock_time_date.xml @@ -28,10 +28,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="12dip" - android:layout_marginLeft="-8dip" > - @@ -66,7 +63,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" - android:textSize="18sp" + android:textSize="20sp" android:textColor="#FFFFFFFF" android:shadowColor="#C0000000" android:shadowDx="0" diff --git a/src/com/android/deskclock/DeskClock.java b/src/com/android/deskclock/DeskClock.java index 51ebbdb..8b72ee7 100644 --- a/src/com/android/deskclock/DeskClock.java +++ b/src/com/android/deskclock/DeskClock.java @@ -99,8 +99,8 @@ public class DeskClock extends Activity { private final long SCREEN_SAVER_MOVE_DELAY = 60 * 1000; // 1 min // Color to use for text & graphics in screen saver mode. - private final int SCREEN_SAVER_COLOR = 0xFF008000; - private final int SCREEN_SAVER_COLOR_DIM = 0xFF003000; + private final int SCREEN_SAVER_COLOR = 0xFF308030; + private final int SCREEN_SAVER_COLOR_DIM = 0xFF183018; // Internal message IDs. private final int FETCH_WEATHER_DATA_MSG = 0x1000; @@ -198,20 +198,6 @@ public class DeskClock extends Activity { final View time_date = findViewById(R.id.time_date); - /* - final TranslateAnimation anim = new TranslateAnimation( - Animation.RELATIVE_TO_SELF, 0, // fromX - Animation.RELATIVE_TO_PARENT, 0.5f, // toX - Animation.RELATIVE_TO_SELF, 0, // fromY - Animation.RELATIVE_TO_PARENT, 0.5f // toY - ); - anim.setDuration(1000); - anim.setInterpolator(new android.view.animation.AccelerateDecelerateInterpolator()); - anim.setFillEnabled(true); - anim.setFillAfter(true); - time_date.startAnimation(anim); - */ - DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); @@ -482,7 +468,7 @@ public class DeskClock extends Activity { if (mDimmed) { winParams.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; - winParams.dimAmount = 0.5f; // pump up contrast in dim mode + winParams.dimAmount = 0.67f; // pump up contrast in dim mode // show the window tint tintView.startAnimation(AnimationUtils.loadAnimation(this, @@ -490,7 +476,7 @@ public class DeskClock extends Activity { : R.anim.dim_instant)); } else { winParams.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); - winParams.dimAmount = 0.2f; // lower contrast in normal mode + winParams.dimAmount = 0.5f; // lower contrast in normal mode // hide the window tint tintView.startAnimation(AnimationUtils.loadAnimation(this, diff --git a/src/com/android/deskclock/DigitalClock.java b/src/com/android/deskclock/DigitalClock.java index d28cc7d..383ca7b 100644 --- a/src/com/android/deskclock/DigitalClock.java +++ b/src/com/android/deskclock/DigitalClock.java @@ -68,7 +68,9 @@ public class DigitalClock extends LinearLayout { AmPm(View parent, Typeface tf) { mAmPm = (TextView) parent.findViewById(R.id.am_pm); - mAmPm.setTypeface(tf); + if (tf != null) { + mAmPm.setTypeface(tf); + } String[] ampm = new DateFormatSymbols().getAmPmStrings(); mAmString = ampm[0]; @@ -111,7 +113,7 @@ public class DigitalClock extends LinearLayout { "fonts/Clockopia.ttf"); mTimeDisplay = (TextView) findViewById(R.id.timeDisplay); mTimeDisplay.setTypeface(tf); - mAmPm = new AmPm(this, tf); + mAmPm = new AmPm(this, null); mCalendar = Calendar.getInstance(); setDateFormat();