Merge "Fix 6665117: ACTION_ASSIST visual improvements" into jb-dev
diff --git a/core/java/com/android/internal/widget/multiwaveview/PointCloud.java b/core/java/com/android/internal/widget/multiwaveview/PointCloud.java
index 2ef8c78..1beac16 100644
--- a/core/java/com/android/internal/widget/multiwaveview/PointCloud.java
+++ b/core/java/com/android/internal/widget/multiwaveview/PointCloud.java
@@ -180,8 +180,8 @@
float glowDistance = hypot(glowManager.x - point.x, glowManager.y - point.y);
float glowAlpha = 0.0f;
if (glowDistance < glowManager.radius) {
- float cosf = FloatMath.cos(PI * 0.5f * glowDistance / glowManager.radius);
- glowAlpha = glowManager.alpha * max(0.0f, (float) Math.pow(cosf, 0.5f));
+ float cosf = FloatMath.cos(PI * 0.25f * glowDistance / glowManager.radius);
+ glowAlpha = glowManager.alpha * max(0.0f, (float) Math.pow(cosf, 10.0f));
}
// Compute contribution from Wave
@@ -190,7 +190,7 @@
float waveAlpha = 0.0f;
if (distanceToWaveRing < waveManager.width * 0.5f) {
float cosf = FloatMath.cos(PI * 0.5f * distanceToWaveRing / waveManager.width);
- waveAlpha = waveManager.alpha * max(0.0f, (float) Math.pow(cosf, 15.0f));
+ waveAlpha = waveManager.alpha * max(0.0f, (float) Math.pow(cosf, 20.0f));
}
return (int) (max(glowAlpha, waveAlpha) * 255);
diff --git a/core/res/res/drawable-hdpi/ic_action_assist_focused.png b/core/res/res/drawable-hdpi/ic_action_assist_focused.png
new file mode 100644
index 0000000..d98557d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_action_assist_focused.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_action_assist_generic_activated.png b/core/res/res/drawable-hdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..c0e2098
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_action_assist_generic_normal.png b/core/res/res/drawable-hdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..a852e2c
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_action_assist_focused.png b/core/res/res/drawable-mdpi/ic_action_assist_focused.png
new file mode 100644
index 0000000..3f96d03
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_action_assist_focused.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_action_assist_generic_activated.png b/core/res/res/drawable-mdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..f88f7e1
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_action_assist_generic_normal.png b/core/res/res/drawable-mdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..7426994
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_action_assist_generic_activated.png b/core/res/res/drawable-xhdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..500b157
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_action_assist_generic_normal.png b/core/res/res/drawable-xhdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..d0e4cf3
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable/ic_lockscreen_search.xml b/core/res/res/drawable/ic_action_assist_generic.xml
similarity index 83%
rename from core/res/res/drawable/ic_lockscreen_search.xml
rename to core/res/res/drawable/ic_action_assist_generic.xml
index d7a5b00..60f5d5d 100644
--- a/core/res/res/drawable/ic_lockscreen_search.xml
+++ b/core/res/res/drawable/ic_action_assist_generic.xml
@@ -19,18 +19,18 @@
android:state_enabled="true"
android:state_active="false"
android:state_focused="false"
- android:drawable="@drawable/ic_lockscreen_google_normal" />
+ android:drawable="@drawable/ic_action_assist_generic_normal" />
<item
android:state_enabled="true"
android:state_active="true"
android:state_focused="false"
- android:drawable="@drawable/ic_lockscreen_google_activated" />
+ android:drawable="@drawable/ic_action_assist_generic_activated" />
<item
android:state_enabled="true"
android:state_active="false"
android:state_focused="true"
- android:drawable="@drawable/ic_lockscreen_google_focused" />
+ android:drawable="@drawable/ic_action_assist_generic_activated" />
</selector>
diff --git a/core/res/res/drawable/ic_lockscreen_outerring.xml b/core/res/res/drawable/ic_lockscreen_outerring.xml
index 78984b3..3886bb4 100644
--- a/core/res/res/drawable/ic_lockscreen_outerring.xml
+++ b/core/res/res/drawable/ic_lockscreen_outerring.xml
@@ -20,5 +20,5 @@
<size android:height="@dimen/keyguard_lockscreen_outerring_diameter"
android:width="@dimen/keyguard_lockscreen_outerring_diameter" />
<solid android:color="#00000000" />
- <stroke android:color="#1affffff" android:width="2dp" />
-</shape>
\ No newline at end of file
+ <stroke android:color="#00000000" android:width="2dp" />
+</shape>
diff --git a/core/res/res/values-land/arrays.xml b/core/res/res/values-land/arrays.xml
index f2df3fa..6db3a508 100644
--- a/core/res/res/values-land/arrays.xml
+++ b/core/res/res/values-land/arrays.xml
@@ -23,7 +23,7 @@
<array name="lockscreen_targets_when_silent">
<item>@null</item>"
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_soundon</item>
</array>
@@ -44,7 +44,7 @@
<array name="lockscreen_targets_when_soundon">
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_silent</item>
</array>
@@ -58,7 +58,7 @@
<array name="lockscreen_targets_with_camera">
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
</array>
diff --git a/core/res/res/values-sw600dp-land/arrays.xml b/core/res/res/values-sw600dp-land/arrays.xml
index 2b5fd99..5550216 100644
--- a/core/res/res/values-sw600dp-land/arrays.xml
+++ b/core/res/res/values-sw600dp-land/arrays.xml
@@ -57,7 +57,7 @@
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index aeb6b4f..b425ad7 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -353,7 +353,7 @@
<!-- Resources for GlowPadView in LockScreen -->
<array name="lockscreen_targets_when_silent">
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_soundon</item>
<item>@null</item>
</array>
@@ -374,7 +374,7 @@
<array name="lockscreen_targets_when_soundon">
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_silent</item>
<item>@null</item>
</array>
@@ -388,7 +388,7 @@
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_lockscreen_search</item>
+ <item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 82ce655..244aec8 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1018,7 +1018,7 @@
<java-symbol type="drawable" name="ic_lockscreen_camera" />
<java-symbol type="drawable" name="ic_lockscreen_silent" />
<java-symbol type="drawable" name="ic_lockscreen_unlock" />
- <java-symbol type="drawable" name="ic_lockscreen_search" />
+ <java-symbol type="drawable" name="ic_action_assist_generic" />
<java-symbol type="drawable" name="notification_bg" />
<java-symbol type="drawable" name="notification_bg_low" />
<java-symbol type="drawable" name="notification_template_icon_bg" />
diff --git a/packages/SystemUI/res/drawable/navbar_search_outerring.xml b/packages/SystemUI/res/drawable/navbar_search_outerring.xml
index 0dd081d..8a8785f 100644
--- a/packages/SystemUI/res/drawable/navbar_search_outerring.xml
+++ b/packages/SystemUI/res/drawable/navbar_search_outerring.xml
@@ -19,5 +19,5 @@
<size android:height="@dimen/navbar_search_outerring_diameter"
android:width="@dimen/navbar_search_outerring_diameter" />
<solid android:color="#00000000" />
- <stroke android:color="#40ffffff" android:width="2dp" />
-</shape>
\ No newline at end of file
+ <stroke android:color="#00000000" android:width="2dp" />
+</shape>
diff --git a/packages/SystemUI/res/values-land/arrays.xml b/packages/SystemUI/res/values-land/arrays.xml
index 53f374d..74a6c81 100644
--- a/packages/SystemUI/res/values-land/arrays.xml
+++ b/packages/SystemUI/res/values-land/arrays.xml
@@ -22,7 +22,7 @@
<array name="navbar_search_targets">
<item>@null</item>
<item>@null</item>
- <item>@*android:drawable/ic_lockscreen_search</item>
+ <item>@*android:drawable/ic_action_assist_generic</item>
<item>@null</item>
</array>
diff --git a/packages/SystemUI/res/values-port/arrays.xml b/packages/SystemUI/res/values-port/arrays.xml
index f8b1620..cd6aaf6 100644
--- a/packages/SystemUI/res/values-port/arrays.xml
+++ b/packages/SystemUI/res/values-port/arrays.xml
@@ -21,7 +21,7 @@
<array name="navbar_search_targets">
<item>@null</item>
- <item>@*android:drawable/ic_lockscreen_search</item>
+ <item>@*android:drawable/ic_action_assist_generic</item>
<item>@null</item>
<item>@null</item>
</array>
diff --git a/packages/SystemUI/res/values-sw600dp/arrays.xml b/packages/SystemUI/res/values-sw600dp/arrays.xml
index 8b5b17d..f3a1771 100644
--- a/packages/SystemUI/res/values-sw600dp/arrays.xml
+++ b/packages/SystemUI/res/values-sw600dp/arrays.xml
@@ -21,7 +21,7 @@
<array name="navbar_search_targets">
<item>@null</item>
- <item>@*android:drawable/ic_lockscreen_search</item>
+ <item>@*android:drawable/ic_action_assist_generic</item>
<item>@null</item>
<item>@null</item>
</array>
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index c082c97..acab41e 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -118,7 +118,7 @@
public void onTrigger(View v, final int target) {
final int resId = mGlowPadView.getResourceIdForTarget(target);
switch (resId) {
- case com.android.internal.R.drawable.ic_lockscreen_search:
+ case com.android.internal.R.drawable.ic_action_assist_generic:
mWaitingForLaunch = true;
startAssistActivity();
vibrate();
@@ -155,7 +155,7 @@
if (component != null) {
if (!mGlowPadView.replaceTargetDrawablesIfPresent(component,
ASSIST_ICON_METADATA_NAME,
- com.android.internal.R.drawable.ic_lockscreen_search)) {
+ com.android.internal.R.drawable.ic_action_assist_generic)) {
Slog.w(TAG, "Couldn't grab icon from component " + component);
}
} else {
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 4af66ce..33dda09 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -301,10 +301,17 @@
if (searchManager != null) {
ComponentName component = searchManager.getGlobalSearchActivity();
if (component != null) {
- if (!mGlowPadView.replaceTargetDrawablesIfPresent(component,
- ASSIST_ICON_METADATA_NAME,
- com.android.internal.R.drawable.ic_lockscreen_search)) {
- Slog.w(TAG, "Couldn't grab icon from package " + component);
+ // XXX Hack. We need to substitute the icon here but haven't formalized
+ // the public API. The "_google" metadata will be going away, so
+ // DON'T USE IT!
+ boolean replaced = mGlowPadView.replaceTargetDrawablesIfPresent(component,
+ ASSIST_ICON_METADATA_NAME + "_google",
+ com.android.internal.R.drawable.ic_action_assist_generic);
+
+ if (!replaced && !mGlowPadView.replaceTargetDrawablesIfPresent(component,
+ ASSIST_ICON_METADATA_NAME,
+ com.android.internal.R.drawable.ic_action_assist_generic)) {
+ Slog.w(TAG, "Couldn't grab icon from package " + component);
}
} else {
Slog.w(TAG, "No search icon specified in package " + component);
@@ -315,7 +322,7 @@
}
setEnabled(com.android.internal.R.drawable.ic_lockscreen_camera, !mCameraDisabled);
- setEnabled(com.android.internal.R.drawable.ic_lockscreen_search, !mSearchDisabled);
+ setEnabled(com.android.internal.R.drawable.ic_action_assist_generic, !mSearchDisabled);
}
public void onGrabbed(View v, int handle) {
@@ -329,7 +336,7 @@
public void onTrigger(View v, int target) {
final int resId = mGlowPadView.getResourceIdForTarget(target);
switch (resId) {
- case com.android.internal.R.drawable.ic_lockscreen_search:
+ case com.android.internal.R.drawable.ic_action_assist_generic:
Intent assistIntent = getAssistIntent();
if (assistIntent != null) {
launchActivity(assistIntent);
@@ -535,7 +542,7 @@
: false;
boolean searchTargetPresent = (mUnlockWidgetMethods instanceof GlowPadViewMethods)
? ((GlowPadViewMethods) mUnlockWidgetMethods)
- .isTargetPresent(com.android.internal.R.drawable.ic_lockscreen_search)
+ .isTargetPresent(com.android.internal.R.drawable.ic_action_assist_generic)
: false;
if (disabledByAdmin) {