summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java25
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java2
3 files changed, 18 insertions, 17 deletions
diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
index 53ff9f0e8c0b..4fe48c9dbdda 100644
--- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
+++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
@@ -59,6 +59,14 @@ public interface BcSmartspaceDataPlugin extends Plugin {
interface SmartspaceView {
void registerDataProvider(BcSmartspaceDataPlugin plugin);
+ /**
+ * Primary color for unprotected text
+ */
void setPrimaryTextColor(int color);
+
+ /**
+ * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD
+ */
+ void setDozeAmount(float amount);
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 96421f3a4981..f2bebcebb6d6 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -24,7 +24,6 @@ import android.app.smartspace.SmartspaceConfig;
import android.app.smartspace.SmartspaceManager;
import android.app.smartspace.SmartspaceSession;
import android.content.res.Resources;
-import android.graphics.Color;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.view.View;
@@ -33,7 +32,6 @@ import android.widget.RelativeLayout;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.colorextraction.ColorExtractor;
-import com.android.internal.graphics.ColorUtils;
import com.android.keyguard.clock.ClockManager;
import com.android.settingslib.Utils;
import com.android.systemui.R;
@@ -87,9 +85,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private SmartspaceSession mSmartspaceSession;
private SmartspaceSession.OnTargetsAvailableListener mSmartspaceCallback;
- private float mDozeAmount;
private int mWallpaperTextColor;
- private int mDozeColor = Color.WHITE;
private ConfigurationController mConfigurationController;
/**
@@ -121,8 +117,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
new StatusBarStateController.StateListener() {
@Override
public void onDozeAmountChanged(float linear, float eased) {
- mDozeAmount = eased;
- updateSmartspaceColor();
+ if (mSmartspaceView != null) {
+ mSmartspaceView.setDozeAmount(eased);
+ }
}
};
@@ -192,9 +189,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mBatteryController);
mLargeClockViewController.init();
- mDozeAmount = mStatusBarStateController.getDozeAmount();
- updateWallpaperColor();
-
mStatusBarStateController.addCallback(mStatusBarStateListener);
mConfigurationController.addCallback(mConfigurationListener);
@@ -206,7 +200,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mSmartspaceView = smartspaceDataPlugin.getView(mView);
mSmartspaceView.registerDataProvider(smartspaceDataPlugin);
- updateSmartspaceColor();
+ updateWallpaperColor();
View asView = (View) mSmartspaceView;
// Place smartspace view below normal clock...
@@ -237,17 +231,14 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mSmartspaceSession.addOnTargetsAvailableListener(mUiExecutor, mSmartspaceCallback);
mSmartspaceSession.requestSmartspaceUpdate();
}
- }
- private void updateWallpaperColor() {
- mWallpaperTextColor = Utils.getColorAttrDefaultColor(getContext(),
- R.attr.wallpaperTextColor);
- updateSmartspaceColor();
+ float dozeAmount = mStatusBarStateController.getDozeAmount();
+ mStatusBarStateListener.onDozeAmountChanged(dozeAmount, dozeAmount);
}
- private void updateSmartspaceColor() {
+ private void updateWallpaperColor() {
if (mSmartspaceView != null) {
- int color = ColorUtils.blendARGB(mWallpaperTextColor, mDozeColor, mDozeAmount);
+ int color = Utils.getColorAttrDefaultColor(getContext(), R.attr.wallpaperTextColor);
mSmartspaceView.setPrimaryTextColor(color);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java
index 4d4acd987f85..263a75c0928a 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java
@@ -262,5 +262,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
public void registerDataProvider(BcSmartspaceDataPlugin plugin) { }
public void setPrimaryTextColor(int color) { }
+
+ public void setDozeAmount(float amount) { }
}
}