Merge "AOD: Show date on always-on display" into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3fbe9d737a
@@ -19,6 +19,6 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="?attr/bgProtectSecondaryTextColor"
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M21.35,6.49c-0.35,0.42 -0.98,0.47 -1.4,0.12l-3.07,-2.57a1,1 0,1 1,1.29 -1.53l3.07,2.57c0.42,0.35 0.47,0.98 0.11,1.41zM7.24,2.63a1,1 0,0 0,-1.41 -0.13L2.77,5.07A0.996,0.996 0,1 0,4.05 6.6l3.06,-2.57c0.43,-0.35 0.48,-0.98 0.13,-1.4zM11.75,8c-0.41,0 -0.75,0.34 -0.75,0.75v4.68c0,0.35 0.18,0.68 0.49,0.86l3.65,2.19c0.34,0.2 0.78,0.1 0.98,-0.24a0.71,0.71 0,0 0,-0.25 -0.99l-3.37,-2v-4.5c0,-0.41 -0.34,-0.75 -0.75,-0.75zM12,5.9c-3.91,0 -7.1,3.18 -7.1,7.1s3.19,7.1 7.1,7.1 7.1,-3.18 7.1,-7.1 -3.19,-7.1 -7.1,-7.1M12,4a9,9 0,1 1,-0.001 18.001A9,9 0,0 1,12 4z" />
|
||||
</vector>
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="6dp"
|
||||
android:drawableStart="@drawable/ic_access_alarms_big"
|
||||
android:drawableTint="?attr/bgProtectSecondaryTextColor"
|
||||
android:drawableTintMode="src_in"
|
||||
android:textColor="?attr/bgProtectSecondaryTextColor"
|
||||
android:letterSpacing="0.15"
|
||||
style="@style/widget_label"
|
||||
|
||||
@@ -814,6 +814,9 @@
|
||||
burn-in on AOD -->
|
||||
<dimen name="burn_in_prevention_offset_y">50dp</dimen>
|
||||
|
||||
<!-- padding between the notification stack and the keyguard status view when dozing -->
|
||||
<dimen name="dozing_stack_padding">10dp</dimen>
|
||||
|
||||
<dimen name="corner_size">16dp</dimen>
|
||||
<dimen name="top_padding">0dp</dimen>
|
||||
<dimen name="bottom_padding">48dp</dimen>
|
||||
|
||||
@@ -19,9 +19,11 @@ package com.android.keyguard;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlarmManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.UserHandle;
|
||||
import android.support.v4.graphics.ColorUtils;
|
||||
import android.text.TextUtils;
|
||||
@@ -56,11 +58,14 @@ public class KeyguardStatusView extends GridLayout {
|
||||
private TextView mOwnerInfo;
|
||||
private ViewGroup mClockContainer;
|
||||
private ChargingView mBatteryDoze;
|
||||
private View mKeyguardStatusArea;
|
||||
|
||||
private View[] mVisibleInDoze;
|
||||
private boolean mPulsing;
|
||||
private float mDarkAmount;
|
||||
private float mDarkAmount = 0;
|
||||
private int mTextColor;
|
||||
private int mDateTextColor;
|
||||
private int mAlarmTextColor;
|
||||
|
||||
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
|
||||
|
||||
@@ -126,8 +131,11 @@ public class KeyguardStatusView extends GridLayout {
|
||||
mClockView.setAccessibilityDelegate(new KeyguardClockAccessibilityDelegate(mContext));
|
||||
mOwnerInfo = findViewById(R.id.owner_info);
|
||||
mBatteryDoze = findViewById(R.id.battery_doze);
|
||||
mVisibleInDoze = new View[]{mBatteryDoze, mClockView};
|
||||
mKeyguardStatusArea = findViewById(R.id.keyguard_status_area);
|
||||
mVisibleInDoze = new View[]{mBatteryDoze, mClockView, mKeyguardStatusArea};
|
||||
mTextColor = mClockView.getCurrentTextColor();
|
||||
mDateTextColor = mDateView.getCurrentTextColor();
|
||||
mAlarmTextColor = mAlarmStatusView.getCurrentTextColor();
|
||||
|
||||
boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
|
||||
setEnableMarquee(shouldMarquee);
|
||||
@@ -186,8 +194,7 @@ public class KeyguardStatusView extends GridLayout {
|
||||
}
|
||||
|
||||
public int getClockBottom() {
|
||||
return mClockView.getBottom() +
|
||||
((MarginLayoutParams) mClockView.getLayoutParams()).bottomMargin;
|
||||
return mKeyguardStatusArea.getBottom();
|
||||
}
|
||||
|
||||
public float getClockTextSize() {
|
||||
@@ -304,6 +311,10 @@ public class KeyguardStatusView extends GridLayout {
|
||||
updateDozeVisibleViews();
|
||||
mBatteryDoze.setDark(dark);
|
||||
mClockView.setTextColor(ColorUtils.blendARGB(mTextColor, Color.WHITE, darkAmount));
|
||||
mDateView.setTextColor(ColorUtils.blendARGB(mDateTextColor, Color.WHITE, darkAmount));
|
||||
int blendedAlarmColor = ColorUtils.blendARGB(mAlarmTextColor, Color.WHITE, darkAmount);
|
||||
mAlarmStatusView.setTextColor(blendedAlarmColor);
|
||||
mAlarmStatusView.setCompoundDrawableTintList(ColorStateList.valueOf(blendedAlarmColor));
|
||||
}
|
||||
|
||||
public void setPulsing(boolean pulsing) {
|
||||
|
||||
@@ -78,6 +78,7 @@ public class KeyguardClockPositionAlgorithm {
|
||||
private AccelerateInterpolator mAccelerateInterpolator = new AccelerateInterpolator();
|
||||
private int mClockBottom;
|
||||
private float mDarkAmount;
|
||||
private int mDozingStackPadding;
|
||||
|
||||
/**
|
||||
* Refreshes the dimension values.
|
||||
@@ -97,6 +98,7 @@ public class KeyguardClockPositionAlgorithm {
|
||||
R.dimen.burn_in_prevention_offset_x);
|
||||
mBurnInPreventionOffsetY = res.getDimensionPixelSize(
|
||||
R.dimen.burn_in_prevention_offset_y);
|
||||
mDozingStackPadding = res.getDimensionPixelSize(R.dimen.dozing_stack_padding);
|
||||
}
|
||||
|
||||
public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight,
|
||||
@@ -135,7 +137,7 @@ public class KeyguardClockPositionAlgorithm {
|
||||
|
||||
result.stackScrollerPadding = (int) interpolate(
|
||||
result.stackScrollerPadding,
|
||||
mClockBottom + y,
|
||||
mClockBottom + y + mDozingStackPadding,
|
||||
mDarkAmount);
|
||||
|
||||
result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount);
|
||||
|
||||
Reference in New Issue
Block a user