summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@google.com>2011-08-17 09:50:35 -0400
committerDaniel Sandler <dsandler@google.com>2011-08-17 13:45:01 -0400
commit96f4818ef41141649337d4dee09f837594e93d09 (patch)
tree66217a03058679be1be23f284c2d3f562763d1a5 /packages/SystemUI/src/com
parente518be3085c7457f3451a64fbea3f9499ae39bf5 (diff)
downloadframeworks_base-96f4818ef41141649337d4dee09f837594e93d09.zip
frameworks_base-96f4818ef41141649337d4dee09f837594e93d09.tar.gz
frameworks_base-96f4818ef41141649337d4dee09f837594e93d09.tar.bz2
Fix drawing artifacts on glowing navigation buttons.
Bug: 5162661 Change-Id: I49d78124cc179221492af2f7bee6adf7bfe34426
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java6
4 files changed, 24 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 2818f87..e7ed052 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -30,7 +30,7 @@ import android.view.View;
public class SwipeHelper {
static final String TAG = "com.android.systemui.SwipeHelper";
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private static final boolean DEBUG_INVALIDATE = false;
private static final boolean SLOW_ANIMATIONS = false; // DEBUG;
@@ -142,7 +142,7 @@ public class SwipeHelper {
// invalidate a rectangle relative to the view's coordinate system all the way up the view
// hierarchy
public static void invalidateGlobalRegion(View view, RectF childBounds) {
- childBounds.offset(view.getX(), view.getY());
+ //childBounds.offset(view.getTranslationX(), view.getTranslationY());
if (DEBUG_INVALIDATE)
Log.v(TAG, "-------------");
while (view.getParent() != null && view.getParent() instanceof View) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index abf505c..c3f20bc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -29,6 +29,7 @@ import android.view.Display;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewGroup;
import android.view.Surface;
import android.view.WindowManager;
import android.widget.LinearLayout;
@@ -67,6 +68,7 @@ public class NavigationBarView extends LinearLayout {
public NavigationBarView(Context context, AttributeSet attrs) {
super(context, attrs);
+
mHidden = false;
mDisplay = ((WindowManager)context.getSystemService(
@@ -129,6 +131,11 @@ public class NavigationBarView extends LinearLayout {
? findViewById(R.id.rot90)
: findViewById(R.id.rot270);
+ for (View v : mRotatedViews) {
+ // this helps avoid drawing artifacts with glowing navigation keys
+ ViewGroup group = (ViewGroup) v.findViewById(R.id.nav_buttons);
+ group.setMotionEventSplittingEnabled(false);
+ }
mCurrentView = mRotatedViews[Surface.ROTATION_0];
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 38a1029..ce1492f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -49,6 +49,8 @@ import com.android.systemui.R;
public class KeyButtonView extends ImageView {
private static final String TAG = "StatusBar.KeyButtonView";
+ final float GLOW_MAX_SCALE_FACTOR = 1.8f;
+
IWindowManager mWindowManager;
long mDownTime;
boolean mSending;
@@ -156,17 +158,22 @@ public class KeyButtonView extends ImageView {
mGlowScale = x;
final float w = getWidth();
final float h = getHeight();
- if (x < 1.0f) {
+ if (GLOW_MAX_SCALE_FACTOR <= 1.0f) {
+ // this only works if we know the glow will never leave our bounds
invalidate();
} else {
- final float rx = (w * (x - 1.0f)) / 2.0f;
- final float ry = (h * (x - 1.0f)) / 2.0f;
+ final float rx = (w * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
+ final float ry = (h * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
com.android.systemui.SwipeHelper.invalidateGlobalRegion(
this,
new RectF(getLeft() - rx,
getTop() - ry,
getRight() + rx,
getBottom() + ry));
+
+ // also invalidate our immediate parent to help avoid situations where nearby glows
+ // interfere
+ ((View)getParent()).invalidate();
}
}
@@ -180,7 +187,7 @@ public class KeyButtonView extends ImageView {
setDrawingAlpha(1f);
as.playTogether(
ObjectAnimator.ofFloat(this, "glowAlpha", 1f),
- ObjectAnimator.ofFloat(this, "glowScale", 1.8f)
+ ObjectAnimator.ofFloat(this, "glowScale", GLOW_MAX_SCALE_FACTOR)
);
as.setDuration(50);
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index e787113..201ff2d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -497,6 +497,8 @@ public class TabletStatusBar extends StatusBar implements
mRecentButton = mNavigationArea.findViewById(R.id.recent_apps);
mRecentButton.setOnClickListener(mOnClickListener);
mNavigationArea.setLayoutTransition(mBarContentsLayoutTransition);
+ // no multi-touch on the nav buttons
+ mNavigationArea.setMotionEventSplittingEnabled(false);
// The bar contents buttons
mFeedbackIconArea = (ViewGroup)sb.findViewById(R.id.feedbackIconArea);
@@ -966,11 +968,11 @@ public class TabletStatusBar extends StatusBar implements
if ((diff & StatusBarManager.DISABLE_BACK) != 0) {
if ((state & StatusBarManager.DISABLE_BACK) != 0) {
Slog.i(TAG, "DISABLE_BACK: yes");
- mBackButton.setVisibility(View.INVISIBLE);
+ mBackButton.setEnabled(false);
mInputMethodSwitchButton.setScreenLocked(true);
} else {
Slog.i(TAG, "DISABLE_BACK: no");
- mBackButton.setVisibility(View.VISIBLE);
+ mBackButton.setEnabled(true);
mInputMethodSwitchButton.setScreenLocked(false);
}
}