diff options
Diffstat (limited to 'packages/SystemUI/src/com')
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); } } |