Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java +0 −39 Original line number Diff line number Diff line Loading @@ -42,10 +42,6 @@ public class StatusBarView extends FrameLayout { View mDate; FixedSizeDrawable mBackground; boolean mNightMode = false; int mStartAlpha = 0, mEndAlpha = 0; long mEndTime = 0; public StatusBarView(Context context, AttributeSet attrs) { super(context, attrs); } Loading @@ -68,29 +64,6 @@ public class StatusBarView extends FrameLayout { mService.onBarViewAttached(); } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); boolean nightMode = (newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; if (mNightMode != nightMode) { mNightMode = nightMode; mStartAlpha = getCurAlpha(); mEndAlpha = mNightMode ? 0x80 : 0x00; mEndTime = SystemClock.uptimeMillis() + DIM_ANIM_TIME; invalidate(); } } int getCurAlpha() { long time = SystemClock.uptimeMillis(); if (time > mEndTime) { return mEndAlpha; } return mEndAlpha - (int)(((mEndAlpha-mStartAlpha) * (mEndTime-time) / DIM_ANIM_TIME)); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); Loading Loading @@ -127,18 +100,6 @@ public class StatusBarView extends FrameLayout { mBackground.setFixedBounds(-mDate.getLeft(), -mDate.getTop(), (r-l), (b-t)); } @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); int alpha = getCurAlpha(); if (alpha != 0) { canvas.drawARGB(alpha, 0, 0, 0); } if (alpha != mEndAlpha) { invalidate(); } } /** * Gets the left position of v in this view. Throws if v is not * a child of this. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java +0 −39 Original line number Diff line number Diff line Loading @@ -42,10 +42,6 @@ public class StatusBarView extends FrameLayout { View mDate; FixedSizeDrawable mBackground; boolean mNightMode = false; int mStartAlpha = 0, mEndAlpha = 0; long mEndTime = 0; public StatusBarView(Context context, AttributeSet attrs) { super(context, attrs); } Loading @@ -68,29 +64,6 @@ public class StatusBarView extends FrameLayout { mService.onBarViewAttached(); } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); boolean nightMode = (newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; if (mNightMode != nightMode) { mNightMode = nightMode; mStartAlpha = getCurAlpha(); mEndAlpha = mNightMode ? 0x80 : 0x00; mEndTime = SystemClock.uptimeMillis() + DIM_ANIM_TIME; invalidate(); } } int getCurAlpha() { long time = SystemClock.uptimeMillis(); if (time > mEndTime) { return mEndAlpha; } return mEndAlpha - (int)(((mEndAlpha-mStartAlpha) * (mEndTime-time) / DIM_ANIM_TIME)); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); Loading Loading @@ -127,18 +100,6 @@ public class StatusBarView extends FrameLayout { mBackground.setFixedBounds(-mDate.getLeft(), -mDate.getTop(), (r-l), (b-t)); } @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); int alpha = getCurAlpha(); if (alpha != 0) { canvas.drawARGB(alpha, 0, 0, 0); } if (alpha != mEndAlpha) { invalidate(); } } /** * Gets the left position of v in this view. Throws if v is not * a child of this. Loading