private String mRestingIndication;
private String mTransientIndication;
private int mTransientTextColor;
+ private int mInitialTextColor;
private boolean mVisible;
private boolean mPowerPluggedIn;
mIndicationArea = indicationArea;
mTextView = (KeyguardIndicationTextView) indicationArea.findViewById(
R.id.keyguard_indication_text);
+ mInitialTextColor = mTextView.getCurrentTextColor();
mDisclosure = (KeyguardIndicationTextView) indicationArea.findViewById(
R.id.keyguard_indication_enterprise_disclosure);
mLockIcon = lockIcon;
* Shows {@param transientIndication} until it is hidden by {@link #hideTransientIndication}.
*/
public void showTransientIndication(String transientIndication) {
- showTransientIndication(transientIndication, Color.WHITE);
+ showTransientIndication(transientIndication, mInitialTextColor);
}
/**
}
if (mVisible) {
- // Walk down a precedence-ordered list of what should indication
+ // Walk down a precedence-ordered list of what indication
// should be shown based on user or device state
if (mDozing) {
// If we're dozing, never show a persistent indication.
if (!TextUtils.isEmpty(mTransientIndication)) {
+ // When dozing we ignore the initial text color and use white instead.
+ // We don't wait to draw black text on a black background.
+ int color = mTransientTextColor == mInitialTextColor ?
+ Color.WHITE : mTransientTextColor;
mTextView.switchIndication(mTransientIndication);
- mTextView.setTextColor(mTransientTextColor);
+ mTextView.setTextColor(color);
} else {
mTextView.switchIndication(null);
String trustManagedIndication = getTrustManagedIndication();
if (!mUserManager.isUserUnlocked(userId)) {
mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked);
- mTextView.setTextColor(Color.WHITE);
+ mTextView.setTextColor(mInitialTextColor);
} else if (!TextUtils.isEmpty(mTransientIndication)) {
mTextView.switchIndication(mTransientIndication);
mTextView.setTextColor(mTransientTextColor);
} else if (!TextUtils.isEmpty(trustGrantedIndication)
&& updateMonitor.getUserHasTrust(userId)) {
mTextView.switchIndication(trustGrantedIndication);
- mTextView.setTextColor(Color.WHITE);
+ mTextView.setTextColor(mInitialTextColor);
} else if (mPowerPluggedIn) {
String indication = computePowerIndication();
if (DEBUG_CHARGING_SPEED) {
indication += ", " + (mChargingWattage / 1000) + " mW";
}
mTextView.switchIndication(indication);
- mTextView.setTextColor(Color.WHITE);
+ mTextView.setTextColor(mInitialTextColor);
} else if (!TextUtils.isEmpty(trustManagedIndication)
&& updateMonitor.getUserTrustIsManaged(userId)
&& !updateMonitor.getUserHasTrust(userId)) {
mTextView.switchIndication(trustManagedIndication);
- mTextView.setTextColor(Color.WHITE);
+ mTextView.setTextColor(mInitialTextColor);
} else {
mTextView.switchIndication(mRestingIndication);
- mTextView.setTextColor(Color.WHITE);
+ mTextView.setTextColor(mInitialTextColor);
}
}
}