android:viewportHeight="24.0">
<path
- android:fillColor="@color/clock_gray"
+ android:fillColor="?attr/bgProtectSecondaryTextColor"
android:pathData="M22.0,5.7l-4.6,-3.9l-1.3,1.5l4.6,3.9L22.0,5.7zM7.9,3.4L6.6,1.9L2.0,5.7l1.3,1.5L7.9,3.4zM12.5,8.0L11.0,8.0l0.0,6.0l4.7,2.9l0.8,-1.2l-4.0,-2.4L12.5,8.0zM12.0,4.0c-5.0,0.0 -9.0,4.0 -9.0,9.0c0.0,5.0 4.0,9.0 9.0,9.0s9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0zM12.0,20.0c-3.9,0.0 -7.0,-3.1 -7.0,-7.0c0.0,-3.9 3.1,-7.0 7.0,-7.0c3.9,0.0 7.0,3.1 7.0,7.0C19.0,16.9 15.9,20.0 12.0,20.0z"/>
</vector>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
- android:textColor="@color/clock_white"
+ android:textColor="?attr/bgProtectTextColor"
android:singleLine="true"
style="@style/widget_big_thin"
android:format12Hour="@string/keyguard_widget_12_hours_format"
<TextClock android:id="@+id/date_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textColor="@color/clock_white"
+ android:textColor="?attr/bgProtectTextColor"
style="@style/widget_label"
android:letterSpacing="0.15"
android:gravity="center"
android:layout_height="wrap_content"
android:drawablePadding="6dp"
android:drawableStart="@drawable/ic_access_alarms_big"
- android:textColor="@color/clock_gray"
+ android:textColor="?attr/bgProtectSecondaryTextColor"
android:letterSpacing="0.15"
style="@style/widget_label"
android:layout_marginStart="6dp"
android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
- android:textColor="@color/clock_white"
+ android:textColor="?attr/bgProtectTextColor"
android:singleLine="true"
style="@style/widget_big_thin"
android:format12Hour="@string/keyguard_widget_12_hours_format"
android:layout_marginTop="@dimen/date_owner_info_margin"
android:layout_centerHorizontal="true"
android:layout_below="@id/keyguard_status_area"
- android:textColor="@color/clock_gray"
+ android:textColor="?attr/bgProtectSecondaryTextColor"
android:textSize="@dimen/widget_label_font_size"
android:letterSpacing="0.05"
android:ellipsize="marquee"
limitations under the License.
-->
<resources>
-
- <!-- Clock -->
- <color name="clock_white">#ffffffff</color>
- <color name="clock_gray">@*android:color/secondary_text_default_material_dark</color>
+ <color name="keyguard_numpad_divider_light">#80FFFFFF</color> <!-- 50% white -->
+ <color name="keyguard_numpad_divider_dark">#FF9FA4A6</color>
+ <color name="keyguard_numpad_delete_light">#FFFFFFFF</color>
+ <color name="keyguard_numpad_delete_dark">@color/material_grey_600</color>
</resources>
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Color;
import android.os.UserHandle;
+import android.support.v4.graphics.ColorUtils;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.AttributeSet;
private View[] mVisibleInDoze;
private boolean mPulsing;
- private boolean mDark;
+ private float mDarkAmount;
+ private int mTextColor;
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
mOwnerInfo = findViewById(R.id.owner_info);
mBatteryDoze = findViewById(R.id.battery_doze);
mVisibleInDoze = new View[]{mBatteryDoze, mClockView};
+ mTextColor = mClockView.getCurrentTextColor();
boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
setEnableMarquee(shouldMarquee);
}
}
- public void setDark(boolean dark) {
- if (mDark == dark) {
+ public void setDark(float darkAmount) {
+ if (mDarkAmount == darkAmount) {
return;
}
- mDark = dark;
+ mDarkAmount = darkAmount;
+ boolean dark = darkAmount == 1;
final int N = mClockContainer.getChildCount();
for (int i = 0; i < N; i++) {
View child = mClockContainer.getChildAt(i);
}
updateDozeVisibleViews();
mBatteryDoze.setDark(dark);
+ mClockView.setTextColor(ColorUtils.blendARGB(mTextColor, Color.WHITE, darkAmount));
}
public void setPulsing(boolean pulsing) {
private void updateDozeVisibleViews() {
for (View child : mVisibleInDoze) {
- child.setAlpha(mDark && mPulsing ? 0.8f : 1);
+ child.setAlpha(mDarkAmount == 1 && mPulsing ? 0.8f : 1);
}
}
}
private void setDarkAmount(float amount) {
mDarkAmount = amount;
- mKeyguardStatusView.setDark(amount == 1);
+ mKeyguardStatusView.setDark(mDarkAmount);
positionClockAndNotifications();
}