Update digital clock based on latest mocks.
Bug: 122301289
Test: visual inspection of digital clock
Change-Id: I43583b6948adb6d65762c5e28cf87018d098706c
diff --git a/packages/SystemUI/res-keyguard/layout/bubble_clock.xml b/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
index 6f7f398..c8dc8e4 100644
--- a/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
+++ b/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
@@ -19,9 +19,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
>
- <include
+ <TextClock
android:id="@+id/digital_clock"
- layout="@layout/text_clock"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="72dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|left"
+ android:textSize="44dp"
+ android:letterSpacing="0.05"
+ android:textColor="?attr/wallpaperTextColor"
+ android:singleLine="true"
+ style="@style/widget_big"
+ android:format12Hour="@string/keyguard_widget_12_hours_format"
+ android:format24Hour="@string/keyguard_widget_24_hours_format"
+ android:elegantTextHeight="false"
/>
<com.android.keyguard.clock.ImageClock
android:id="@+id/analog_clock"
diff --git a/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml b/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
index 64b676f5..116a044 100644
--- a/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
+++ b/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
@@ -19,9 +19,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
>
- <include
+ <TextClock
android:id="@+id/digital_clock"
- layout="@layout/text_clock"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="72dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|left"
+ android:textSize="44dp"
+ android:letterSpacing="0.05"
+ android:textColor="?attr/wallpaperTextColor"
+ android:singleLine="true"
+ style="@style/widget_big"
+ android:format12Hour="@string/keyguard_widget_12_hours_format"
+ android:format24Hour="@string/keyguard_widget_24_hours_format"
+ android:elegantTextHeight="false"
/>
<com.android.keyguard.clock.StretchAnalogClock
android:id="@+id/analog_clock"
diff --git a/packages/SystemUI/src/com/android/keyguard/clock/ClockLayout.java b/packages/SystemUI/src/com/android/keyguard/clock/ClockLayout.java
index 3591dc8..4d8cf96 100644
--- a/packages/SystemUI/src/com/android/keyguard/clock/ClockLayout.java
+++ b/packages/SystemUI/src/com/android/keyguard/clock/ClockLayout.java
@@ -22,6 +22,7 @@
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
+import android.widget.FrameLayout.LayoutParams;
import com.android.keyguard.R;
@@ -80,8 +81,9 @@
// Put digital clock in two left corner of the screen.
if (mDigitalClock != null) {
- mDigitalClock.setX(0.1f * getWidth() + offsetX);
- mDigitalClock.setY(0.1f * getHeight() + offsetY);
+ LayoutParams params = (LayoutParams) mDigitalClock.getLayoutParams();
+ mDigitalClock.setX(offsetX + params.leftMargin);
+ mDigitalClock.setY(offsetY + params.topMargin);
}
// Put the analog clock in the middle of the screen.