android:background="#FF000000"
/>
- <include layout="@layout/desk_clock_time_date"
+ <RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="0dip"
android:layout_y="0dip"
- />
+ android:id="@+id/saver_view"
+ >
+ <TextView android:id="@+id/nextAlarm"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dip"
+ android:gravity="left"
+ android:textSize="18sp"
+ android:textColor="#FFFFFFFF"
+ android:drawablePadding="6dip"
+ />
+ <include layout="@layout/desk_clock_time_date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/nextAlarm"
+ />
+ </RelativeLayout>
</AbsoluteLayout>
private void moveScreenSaverTo(int x, int y) {
if (!mScreenSaverMode) return;
- final View time_date = findViewById(R.id.time_date);
+ final View saver_view = findViewById(R.id.saver_view);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
if (x < 0 || y < 0) {
- int myWidth = time_date.getMeasuredWidth();
- int myHeight = time_date.getMeasuredHeight();
+ int myWidth = saver_view.getMeasuredWidth();
+ int myHeight = saver_view.getMeasuredHeight();
x = (int)(mRNG.nextFloat()*(metrics.widthPixels - myWidth));
y = (int)(mRNG.nextFloat()*(metrics.heightPixels - myHeight));
}
if (DEBUG) Log.d(LOG_TAG, String.format("screen saver: %d: jumping to (%d,%d)",
System.currentTimeMillis(), x, y));
- time_date.setLayoutParams(new AbsoluteLayout.LayoutParams(
+ saver_view.setLayoutParams(new AbsoluteLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
x,
mTime = (DigitalClock) findViewById(R.id.time);
mDate = (TextView) findViewById(R.id.date);
+ mNextAlarm = (TextView) findViewById(R.id.nextAlarm);
final int color = mDimmed ? SCREEN_SAVER_COLOR_DIM : SCREEN_SAVER_COLOR;
((TextView)findViewById(R.id.timeDisplay)).setTextColor(color);
((TextView)findViewById(R.id.am_pm)).setTextColor(color);
mDate.setTextColor(color);
+ mNextAlarm.setTextColor(color);
+ mNextAlarm.setCompoundDrawablesWithIntrinsicBounds(
+ getResources().getDrawable(mDimmed
+ ? R.drawable.ic_lock_idle_alarm_saver_dim
+ : R.drawable.ic_lock_idle_alarm_saver),
+ null, null, null);
mBatteryDisplay =
- mNextAlarm =
mWeatherCurrentTemperature =
mWeatherHighTemperature =
mWeatherLowTemperature =
mWeatherIcon = null;
refreshDate();
+ refreshAlarm();
moveScreenSaverTo(oldLoc[0], oldLoc[1]);
}