Loading packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +8 −0 Original line number Diff line number Diff line Loading @@ -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); } } packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +8 −17 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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; /** Loading Loading @@ -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); } } }; Loading Loading @@ -192,9 +189,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mBatteryController); mLargeClockViewController.init(); mDozeAmount = mStatusBarStateController.getDozeAmount(); updateWallpaperColor(); mStatusBarStateController.addCallback(mStatusBarStateListener); mConfigurationController.addCallback(mConfigurationListener); Loading @@ -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... Loading Loading @@ -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); } } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -262,5 +262,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { public void registerDataProvider(BcSmartspaceDataPlugin plugin) { } public void setPrimaryTextColor(int color) { } public void setDozeAmount(float amount) { } } } Loading
packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +8 −0 Original line number Diff line number Diff line Loading @@ -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); } }
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +8 −17 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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; /** Loading Loading @@ -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); } } }; Loading Loading @@ -192,9 +189,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mBatteryController); mLargeClockViewController.init(); mDozeAmount = mStatusBarStateController.getDozeAmount(); updateWallpaperColor(); mStatusBarStateController.addCallback(mStatusBarStateListener); mConfigurationController.addCallback(mConfigurationListener); Loading @@ -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... Loading Loading @@ -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); } } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -262,5 +262,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { public void registerDataProvider(BcSmartspaceDataPlugin plugin) { } public void setPrimaryTextColor(int color) { } public void setDozeAmount(float amount) { } } }