Loading packages/SystemUI/src/com/android/systemui/LoadAverageService.java +18 −17 Original line number Original line Diff line number Diff line Loading @@ -195,9 +195,10 @@ public class LoadAverageService extends Service { int systemW = (systemTime*W)/totalTime; int systemW = (systemTime*W)/totalTime; int irqW = ((iowaitTime+irqTime+softIrqTime)*W)/totalTime; int irqW = ((iowaitTime+irqTime+softIrqTime)*W)/totalTime; int x = RIGHT - mPaddingRight; int paddingRight = getPaddingRight(); int top = mPaddingTop + 2; int x = RIGHT - paddingRight; int bottom = mPaddingTop + mFH - 2; int top = getPaddingTop() + 2; int bottom = getPaddingTop() + mFH - 2; if (irqW > 0) { if (irqW > 0) { canvas.drawRect(x-irqW, top, x, bottom, mIrqPaint); canvas.drawRect(x-irqW, top, x, bottom, mIrqPaint); Loading @@ -212,16 +213,16 @@ public class LoadAverageService extends Service { x -= userW; x -= userW; } } int y = mPaddingTop - (int)mAscent; int y = getPaddingTop() - (int)mAscent; canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth-1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth-1, y-1, mShadowPaint); y-1, mShadowPaint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth-1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth-1, y+1, mShadowPaint); y+1, mShadowPaint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth+1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth+1, y-1, mShadow2Paint); y-1, mShadow2Paint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth+1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth+1, y+1, mShadow2Paint); y+1, mShadow2Paint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth, y, mLoadPaint); y, mLoadPaint); int N = stats.countWorkingStats(); int N = stats.countWorkingStats(); Loading @@ -233,7 +234,7 @@ public class LoadAverageService extends Service { userW = (st.rel_utime*W)/totalTime; userW = (st.rel_utime*W)/totalTime; systemW = (st.rel_stime*W)/totalTime; systemW = (st.rel_stime*W)/totalTime; x = RIGHT - mPaddingRight; x = RIGHT - paddingRight; if (systemW > 0) { if (systemW > 0) { canvas.drawRect(x-systemW, top, x, bottom, mSystemPaint); canvas.drawRect(x-systemW, top, x, bottom, mSystemPaint); x -= systemW; x -= systemW; Loading @@ -243,18 +244,18 @@ public class LoadAverageService extends Service { x -= userW; x -= userW; } } canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth-1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth-1, y-1, mShadowPaint); y-1, mShadowPaint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth-1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth-1, y+1, mShadowPaint); y+1, mShadowPaint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth+1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth+1, y-1, mShadow2Paint); y-1, mShadow2Paint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth+1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth+1, y+1, mShadow2Paint); y+1, mShadow2Paint); Paint p = mLoadPaint; Paint p = mLoadPaint; if (st.added) p = mAddedPaint; if (st.added) p = mAddedPaint; if (st.removed) p = mRemovedPaint; if (st.removed) p = mRemovedPaint; canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth, y, p); canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth, y, p); } } } } Loading @@ -270,8 +271,8 @@ public class LoadAverageService extends Service { } } } } int neededWidth = mPaddingLeft + mPaddingRight + maxWidth; int neededWidth = getPaddingLeft() + getPaddingRight() + maxWidth; int neededHeight = mPaddingTop + mPaddingBottom + (mFH*(1+NW)); int neededHeight = getPaddingTop() + getPaddingBottom() + (mFH*(1+NW)); if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) { if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) { mNeededWidth = neededWidth; mNeededWidth = neededWidth; mNeededHeight = neededHeight; mNeededHeight = neededHeight; Loading packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView public RecentsHorizontalScrollView(Context context, AttributeSet attrs) { public RecentsHorizontalScrollView(Context context, AttributeSet attrs) { super(context, attrs, 0); super(context, attrs, 0); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper = new SwipeHelper(SwipeHelper.Y, this, densityScale, pagingTouchSlop); mSwipeHelper = new SwipeHelper(SwipeHelper.Y, this, densityScale, pagingTouchSlop); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, false); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, false); mRecycledViews = new HashSet<View>(); mRecycledViews = new HashSet<View>(); Loading Loading @@ -239,9 +239,9 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView if (mFadedEdgeDrawHelper != null) { if (mFadedEdgeDrawHelper != null) { mFadedEdgeDrawHelper.drawCallback(canvas, mFadedEdgeDrawHelper.drawCallback(canvas, left, right, top, bottom, mScrollX, mScrollY, left, right, top, bottom, getScrollX(), getScrollY(), 0, 0, 0, 0, getLeftFadingEdgeStrength(), getRightFadingEdgeStrength(), mPaddingTop); getLeftFadingEdgeStrength(), getRightFadingEdgeStrength(), getPaddingTop()); } } } } Loading Loading @@ -280,7 +280,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView super.onFinishInflate(); super.onFinishInflate(); setScrollbarFadingEnabled(true); setScrollbarFadingEnabled(true); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); final int leftPadding = mContext.getResources() final int leftPadding = getContext().getResources() .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); setOverScrollEffectPadding(leftPadding, 0); setOverScrollEffectPadding(leftPadding, 0); } } Loading @@ -297,7 +297,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; mSwipeHelper.setDensityScale(densityScale); mSwipeHelper.setDensityScale(densityScale); float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); } } Loading packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +16 −16 Original line number Original line Diff line number Diff line Loading @@ -330,7 +330,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } private void showImpl(boolean show) { private void showImpl(boolean show) { sendCloseSystemWindows(mContext, BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); sendCloseSystemWindows(getContext(), BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); mShowing = show; mShowing = show; Loading Loading @@ -372,11 +372,11 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } public void dismiss() { public void dismiss() { ((RecentsActivity) mContext).dismissAndGoHome(); ((RecentsActivity) getContext()).dismissAndGoHome(); } } public void dismissAndGoBack() { public void dismissAndGoBack() { ((RecentsActivity) mContext).dismissAndGoBack(); ((RecentsActivity) getContext()).dismissAndGoBack(); } } public void onAnimationCancel(Animator animation) { public void onAnimationCancel(Animator animation) { Loading Loading @@ -424,7 +424,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } public void updateValuesFromResources() { public void updateValuesFromResources() { final Resources res = mContext.getResources(); final Resources res = getContext().getResources(); mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width)); mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width)); mFitThumbnailToXY = res.getBoolean(R.bool.config_recents_thumbnail_image_fits_to_xy); mFitThumbnailToXY = res.getBoolean(R.bool.config_recents_thumbnail_image_fits_to_xy); } } Loading @@ -440,7 +440,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener invalidate(); invalidate(); } } }); }); mListAdapter = new TaskDescriptionAdapter(mContext); mListAdapter = new TaskDescriptionAdapter(getContext()); mRecentsContainer.setAdapter(mListAdapter); mRecentsContainer.setAdapter(mListAdapter); mRecentsContainer.setCallback(this); mRecentsContainer.setCallback(this); Loading Loading @@ -474,7 +474,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (show && h.iconView.getVisibility() != View.VISIBLE) { if (show && h.iconView.getVisibility() != View.VISIBLE) { if (anim) { if (anim) { h.iconView.setAnimation( h.iconView.setAnimation( AnimationUtils.loadAnimation(mContext, R.anim.recent_appear)); AnimationUtils.loadAnimation(getContext(), R.anim.recent_appear)); } } h.iconView.setVisibility(View.VISIBLE); h.iconView.setVisibility(View.VISIBLE); } } Loading Loading @@ -506,7 +506,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (show && h.thumbnailView.getVisibility() != View.VISIBLE) { if (show && h.thumbnailView.getVisibility() != View.VISIBLE) { if (anim) { if (anim) { h.thumbnailView.setAnimation( h.thumbnailView.setAnimation( AnimationUtils.loadAnimation(mContext, R.anim.recent_appear)); AnimationUtils.loadAnimation(getContext(), R.anim.recent_appear)); } } h.thumbnailView.setVisibility(View.VISIBLE); h.thumbnailView.setVisibility(View.VISIBLE); } } Loading Loading @@ -617,7 +617,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } else { } else { mRecentTaskDescriptions.addAll(tasks); mRecentTaskDescriptions.addAll(tasks); } } if (((RecentsActivity) mContext).isActivityShowing()) { if (((RecentsActivity) getContext()).isActivityShowing()) { refreshViews(); refreshViews(); } } } } Loading Loading @@ -726,13 +726,13 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener // Currently, either direction means the same thing, so ignore direction and remove // Currently, either direction means the same thing, so ignore direction and remove // the task. // the task. final ActivityManager am = (ActivityManager) final ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); getContext().getSystemService(Context.ACTIVITY_SERVICE); if (am != null) { if (am != null) { am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS); am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS); // Accessibility feedback // Accessibility feedback setContentDescription( setContentDescription( mContext.getString(R.string.accessibility_recents_item_dismissed, ad.getLabel())); getContext().getString(R.string.accessibility_recents_item_dismissed, ad.getLabel())); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); setContentDescription(null); setContentDescription(null); } } Loading @@ -741,7 +741,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener private void startApplicationDetailsActivity(String packageName) { private void startApplicationDetailsActivity(String packageName) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", packageName, null)); Uri.fromParts("package", packageName, null)); intent.setComponent(intent.resolveActivity(mContext.getPackageManager())); intent.setComponent(intent.resolveActivity(getContext().getPackageManager())); TaskStackBuilder.create(getContext()) TaskStackBuilder.create(getContext()) .addNextIntentWithParentStack(intent).startActivities(); .addNextIntentWithParentStack(intent).startActivities(); } } Loading @@ -758,7 +758,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener final View selectedView, final View anchorView, final View thumbnailView) { final View selectedView, final View anchorView, final View thumbnailView) { thumbnailView.setSelected(true); thumbnailView.setSelected(true); final PopupMenu popup = final PopupMenu popup = new PopupMenu(mContext, anchorView == null ? selectedView : anchorView); new PopupMenu(getContext(), anchorView == null ? selectedView : anchorView); mPopup = popup; mPopup = popup; popup.getMenuInflater().inflate(R.menu.recent_popup_menu, popup.getMenu()); popup.getMenuInflater().inflate(R.menu.recent_popup_menu, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { Loading Loading @@ -793,15 +793,15 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); super.dispatchDraw(canvas); int paddingLeft = mPaddingLeft; int paddingLeft = getPaddingLeft(); final boolean offsetRequired = isPaddingOffsetRequired(); final boolean offsetRequired = isPaddingOffsetRequired(); if (offsetRequired) { if (offsetRequired) { paddingLeft += getLeftPaddingOffset(); paddingLeft += getLeftPaddingOffset(); } } int left = mScrollX + paddingLeft; int left = getScrollX() + paddingLeft; int right = left + mRight - mLeft - mPaddingRight - paddingLeft; int right = left + getRight() - getLeft() - getPaddingRight() - paddingLeft; int top = mScrollY + getFadeTop(offsetRequired); int top = getScrollY() + getFadeTop(offsetRequired); int bottom = top + getFadeHeight(offsetRequired); int bottom = top + getFadeHeight(offsetRequired); if (offsetRequired) { if (offsetRequired) { Loading packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class RecentsVerticalScrollView extends ScrollView public RecentsVerticalScrollView(Context context, AttributeSet attrs) { public RecentsVerticalScrollView(Context context, AttributeSet attrs) { super(context, attrs, 0); super(context, attrs, 0); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, densityScale, pagingTouchSlop); mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, densityScale, pagingTouchSlop); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, true); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, true); Loading @@ -69,7 +69,7 @@ public class RecentsVerticalScrollView extends ScrollView } } private int scrollPositionOfMostRecent() { private int scrollPositionOfMostRecent() { return mLinearLayout.getHeight() - getHeight() + mPaddingTop; return mLinearLayout.getHeight() - getHeight() + getPaddingTop(); } } private void addToRecycledViews(View v) { private void addToRecycledViews(View v) { Loading Loading @@ -248,9 +248,9 @@ public class RecentsVerticalScrollView extends ScrollView if (mFadedEdgeDrawHelper != null) { if (mFadedEdgeDrawHelper != null) { final boolean offsetRequired = isPaddingOffsetRequired(); final boolean offsetRequired = isPaddingOffsetRequired(); mFadedEdgeDrawHelper.drawCallback(canvas, mFadedEdgeDrawHelper.drawCallback(canvas, left, right, top + getFadeTop(offsetRequired), bottom, mScrollX, mScrollY, left, right, top + getFadeTop(offsetRequired), bottom, getScrollX(), getScrollY(), getTopFadingEdgeStrength(), getBottomFadingEdgeStrength(), getTopFadingEdgeStrength(), getBottomFadingEdgeStrength(), 0, 0, mPaddingTop); 0, 0, getPaddingTop()); } } } } Loading Loading @@ -289,7 +289,7 @@ public class RecentsVerticalScrollView extends ScrollView super.onFinishInflate(); super.onFinishInflate(); setScrollbarFadingEnabled(true); setScrollbarFadingEnabled(true); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); final int leftPadding = mContext.getResources() final int leftPadding = getContext().getResources() .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); setOverScrollEffectPadding(leftPadding, 0); setOverScrollEffectPadding(leftPadding, 0); } } Loading @@ -306,7 +306,7 @@ public class RecentsVerticalScrollView extends ScrollView super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; mSwipeHelper.setDensityScale(densityScale); mSwipeHelper.setDensityScale(densityScale); float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class StatusBarIconView extends AnimatedImageView { } } if (!numberEquals) { if (!numberEquals) { if (icon.number > 0 && mContext.getResources().getBoolean( if (icon.number > 0 && getContext().getResources().getBoolean( R.bool.config_statusBarShowNumber)) { R.bool.config_statusBarShowNumber)) { if (mNumberBackground == null) { if (mNumberBackground == null) { mNumberBackground = getContext().getResources().getDrawable( mNumberBackground = getContext().getResources().getDrawable( Loading Loading @@ -240,10 +240,10 @@ public class StatusBarIconView extends AnimatedImageView { void placeNumber() { void placeNumber() { final String str; final String str; final int tooBig = mContext.getResources().getInteger( final int tooBig = getContext().getResources().getInteger( android.R.integer.status_bar_notification_info_maxnum); android.R.integer.status_bar_notification_info_maxnum); if (mIcon.number > tooBig) { if (mIcon.number > tooBig) { str = mContext.getResources().getString( str = getContext().getResources().getString( android.R.string.status_bar_notification_info_overflow); android.R.string.status_bar_notification_info_overflow); } else { } else { NumberFormat f = NumberFormat.getIntegerInstance(); NumberFormat f = NumberFormat.getIntegerInstance(); Loading Loading
packages/SystemUI/src/com/android/systemui/LoadAverageService.java +18 −17 Original line number Original line Diff line number Diff line Loading @@ -195,9 +195,10 @@ public class LoadAverageService extends Service { int systemW = (systemTime*W)/totalTime; int systemW = (systemTime*W)/totalTime; int irqW = ((iowaitTime+irqTime+softIrqTime)*W)/totalTime; int irqW = ((iowaitTime+irqTime+softIrqTime)*W)/totalTime; int x = RIGHT - mPaddingRight; int paddingRight = getPaddingRight(); int top = mPaddingTop + 2; int x = RIGHT - paddingRight; int bottom = mPaddingTop + mFH - 2; int top = getPaddingTop() + 2; int bottom = getPaddingTop() + mFH - 2; if (irqW > 0) { if (irqW > 0) { canvas.drawRect(x-irqW, top, x, bottom, mIrqPaint); canvas.drawRect(x-irqW, top, x, bottom, mIrqPaint); Loading @@ -212,16 +213,16 @@ public class LoadAverageService extends Service { x -= userW; x -= userW; } } int y = mPaddingTop - (int)mAscent; int y = getPaddingTop() - (int)mAscent; canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth-1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth-1, y-1, mShadowPaint); y-1, mShadowPaint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth-1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth-1, y+1, mShadowPaint); y+1, mShadowPaint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth+1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth+1, y-1, mShadow2Paint); y-1, mShadow2Paint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth+1, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth+1, y+1, mShadow2Paint); y+1, mShadow2Paint); canvas.drawText(stats.mLoadText, RIGHT-mPaddingRight-stats.mLoadWidth, canvas.drawText(stats.mLoadText, RIGHT-paddingRight-stats.mLoadWidth, y, mLoadPaint); y, mLoadPaint); int N = stats.countWorkingStats(); int N = stats.countWorkingStats(); Loading @@ -233,7 +234,7 @@ public class LoadAverageService extends Service { userW = (st.rel_utime*W)/totalTime; userW = (st.rel_utime*W)/totalTime; systemW = (st.rel_stime*W)/totalTime; systemW = (st.rel_stime*W)/totalTime; x = RIGHT - mPaddingRight; x = RIGHT - paddingRight; if (systemW > 0) { if (systemW > 0) { canvas.drawRect(x-systemW, top, x, bottom, mSystemPaint); canvas.drawRect(x-systemW, top, x, bottom, mSystemPaint); x -= systemW; x -= systemW; Loading @@ -243,18 +244,18 @@ public class LoadAverageService extends Service { x -= userW; x -= userW; } } canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth-1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth-1, y-1, mShadowPaint); y-1, mShadowPaint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth-1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth-1, y+1, mShadowPaint); y+1, mShadowPaint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth+1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth+1, y-1, mShadow2Paint); y-1, mShadow2Paint); canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth+1, canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth+1, y+1, mShadow2Paint); y+1, mShadow2Paint); Paint p = mLoadPaint; Paint p = mLoadPaint; if (st.added) p = mAddedPaint; if (st.added) p = mAddedPaint; if (st.removed) p = mRemovedPaint; if (st.removed) p = mRemovedPaint; canvas.drawText(st.name, RIGHT-mPaddingRight-st.nameWidth, y, p); canvas.drawText(st.name, RIGHT-paddingRight-st.nameWidth, y, p); } } } } Loading @@ -270,8 +271,8 @@ public class LoadAverageService extends Service { } } } } int neededWidth = mPaddingLeft + mPaddingRight + maxWidth; int neededWidth = getPaddingLeft() + getPaddingRight() + maxWidth; int neededHeight = mPaddingTop + mPaddingBottom + (mFH*(1+NW)); int neededHeight = getPaddingTop() + getPaddingBottom() + (mFH*(1+NW)); if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) { if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) { mNeededWidth = neededWidth; mNeededWidth = neededWidth; mNeededHeight = neededHeight; mNeededHeight = neededHeight; Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView public RecentsHorizontalScrollView(Context context, AttributeSet attrs) { public RecentsHorizontalScrollView(Context context, AttributeSet attrs) { super(context, attrs, 0); super(context, attrs, 0); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper = new SwipeHelper(SwipeHelper.Y, this, densityScale, pagingTouchSlop); mSwipeHelper = new SwipeHelper(SwipeHelper.Y, this, densityScale, pagingTouchSlop); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, false); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, false); mRecycledViews = new HashSet<View>(); mRecycledViews = new HashSet<View>(); Loading Loading @@ -239,9 +239,9 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView if (mFadedEdgeDrawHelper != null) { if (mFadedEdgeDrawHelper != null) { mFadedEdgeDrawHelper.drawCallback(canvas, mFadedEdgeDrawHelper.drawCallback(canvas, left, right, top, bottom, mScrollX, mScrollY, left, right, top, bottom, getScrollX(), getScrollY(), 0, 0, 0, 0, getLeftFadingEdgeStrength(), getRightFadingEdgeStrength(), mPaddingTop); getLeftFadingEdgeStrength(), getRightFadingEdgeStrength(), getPaddingTop()); } } } } Loading Loading @@ -280,7 +280,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView super.onFinishInflate(); super.onFinishInflate(); setScrollbarFadingEnabled(true); setScrollbarFadingEnabled(true); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); final int leftPadding = mContext.getResources() final int leftPadding = getContext().getResources() .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); setOverScrollEffectPadding(leftPadding, 0); setOverScrollEffectPadding(leftPadding, 0); } } Loading @@ -297,7 +297,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; mSwipeHelper.setDensityScale(densityScale); mSwipeHelper.setDensityScale(densityScale); float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); } } Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +16 −16 Original line number Original line Diff line number Diff line Loading @@ -330,7 +330,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } private void showImpl(boolean show) { private void showImpl(boolean show) { sendCloseSystemWindows(mContext, BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); sendCloseSystemWindows(getContext(), BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); mShowing = show; mShowing = show; Loading Loading @@ -372,11 +372,11 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } public void dismiss() { public void dismiss() { ((RecentsActivity) mContext).dismissAndGoHome(); ((RecentsActivity) getContext()).dismissAndGoHome(); } } public void dismissAndGoBack() { public void dismissAndGoBack() { ((RecentsActivity) mContext).dismissAndGoBack(); ((RecentsActivity) getContext()).dismissAndGoBack(); } } public void onAnimationCancel(Animator animation) { public void onAnimationCancel(Animator animation) { Loading Loading @@ -424,7 +424,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } } public void updateValuesFromResources() { public void updateValuesFromResources() { final Resources res = mContext.getResources(); final Resources res = getContext().getResources(); mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width)); mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width)); mFitThumbnailToXY = res.getBoolean(R.bool.config_recents_thumbnail_image_fits_to_xy); mFitThumbnailToXY = res.getBoolean(R.bool.config_recents_thumbnail_image_fits_to_xy); } } Loading @@ -440,7 +440,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener invalidate(); invalidate(); } } }); }); mListAdapter = new TaskDescriptionAdapter(mContext); mListAdapter = new TaskDescriptionAdapter(getContext()); mRecentsContainer.setAdapter(mListAdapter); mRecentsContainer.setAdapter(mListAdapter); mRecentsContainer.setCallback(this); mRecentsContainer.setCallback(this); Loading Loading @@ -474,7 +474,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (show && h.iconView.getVisibility() != View.VISIBLE) { if (show && h.iconView.getVisibility() != View.VISIBLE) { if (anim) { if (anim) { h.iconView.setAnimation( h.iconView.setAnimation( AnimationUtils.loadAnimation(mContext, R.anim.recent_appear)); AnimationUtils.loadAnimation(getContext(), R.anim.recent_appear)); } } h.iconView.setVisibility(View.VISIBLE); h.iconView.setVisibility(View.VISIBLE); } } Loading Loading @@ -506,7 +506,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (show && h.thumbnailView.getVisibility() != View.VISIBLE) { if (show && h.thumbnailView.getVisibility() != View.VISIBLE) { if (anim) { if (anim) { h.thumbnailView.setAnimation( h.thumbnailView.setAnimation( AnimationUtils.loadAnimation(mContext, R.anim.recent_appear)); AnimationUtils.loadAnimation(getContext(), R.anim.recent_appear)); } } h.thumbnailView.setVisibility(View.VISIBLE); h.thumbnailView.setVisibility(View.VISIBLE); } } Loading Loading @@ -617,7 +617,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener } else { } else { mRecentTaskDescriptions.addAll(tasks); mRecentTaskDescriptions.addAll(tasks); } } if (((RecentsActivity) mContext).isActivityShowing()) { if (((RecentsActivity) getContext()).isActivityShowing()) { refreshViews(); refreshViews(); } } } } Loading Loading @@ -726,13 +726,13 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener // Currently, either direction means the same thing, so ignore direction and remove // Currently, either direction means the same thing, so ignore direction and remove // the task. // the task. final ActivityManager am = (ActivityManager) final ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); getContext().getSystemService(Context.ACTIVITY_SERVICE); if (am != null) { if (am != null) { am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS); am.removeTask(ad.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS); // Accessibility feedback // Accessibility feedback setContentDescription( setContentDescription( mContext.getString(R.string.accessibility_recents_item_dismissed, ad.getLabel())); getContext().getString(R.string.accessibility_recents_item_dismissed, ad.getLabel())); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); setContentDescription(null); setContentDescription(null); } } Loading @@ -741,7 +741,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener private void startApplicationDetailsActivity(String packageName) { private void startApplicationDetailsActivity(String packageName) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", packageName, null)); Uri.fromParts("package", packageName, null)); intent.setComponent(intent.resolveActivity(mContext.getPackageManager())); intent.setComponent(intent.resolveActivity(getContext().getPackageManager())); TaskStackBuilder.create(getContext()) TaskStackBuilder.create(getContext()) .addNextIntentWithParentStack(intent).startActivities(); .addNextIntentWithParentStack(intent).startActivities(); } } Loading @@ -758,7 +758,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener final View selectedView, final View anchorView, final View thumbnailView) { final View selectedView, final View anchorView, final View thumbnailView) { thumbnailView.setSelected(true); thumbnailView.setSelected(true); final PopupMenu popup = final PopupMenu popup = new PopupMenu(mContext, anchorView == null ? selectedView : anchorView); new PopupMenu(getContext(), anchorView == null ? selectedView : anchorView); mPopup = popup; mPopup = popup; popup.getMenuInflater().inflate(R.menu.recent_popup_menu, popup.getMenu()); popup.getMenuInflater().inflate(R.menu.recent_popup_menu, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { Loading Loading @@ -793,15 +793,15 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); super.dispatchDraw(canvas); int paddingLeft = mPaddingLeft; int paddingLeft = getPaddingLeft(); final boolean offsetRequired = isPaddingOffsetRequired(); final boolean offsetRequired = isPaddingOffsetRequired(); if (offsetRequired) { if (offsetRequired) { paddingLeft += getLeftPaddingOffset(); paddingLeft += getLeftPaddingOffset(); } } int left = mScrollX + paddingLeft; int left = getScrollX() + paddingLeft; int right = left + mRight - mLeft - mPaddingRight - paddingLeft; int right = left + getRight() - getLeft() - getPaddingRight() - paddingLeft; int top = mScrollY + getFadeTop(offsetRequired); int top = getScrollY() + getFadeTop(offsetRequired); int bottom = top + getFadeHeight(offsetRequired); int bottom = top + getFadeHeight(offsetRequired); if (offsetRequired) { if (offsetRequired) { Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class RecentsVerticalScrollView extends ScrollView public RecentsVerticalScrollView(Context context, AttributeSet attrs) { public RecentsVerticalScrollView(Context context, AttributeSet attrs) { super(context, attrs, 0); super(context, attrs, 0); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, densityScale, pagingTouchSlop); mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, densityScale, pagingTouchSlop); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, true); mFadedEdgeDrawHelper = FadedEdgeDrawHelper.create(context, attrs, this, true); Loading @@ -69,7 +69,7 @@ public class RecentsVerticalScrollView extends ScrollView } } private int scrollPositionOfMostRecent() { private int scrollPositionOfMostRecent() { return mLinearLayout.getHeight() - getHeight() + mPaddingTop; return mLinearLayout.getHeight() - getHeight() + getPaddingTop(); } } private void addToRecycledViews(View v) { private void addToRecycledViews(View v) { Loading Loading @@ -248,9 +248,9 @@ public class RecentsVerticalScrollView extends ScrollView if (mFadedEdgeDrawHelper != null) { if (mFadedEdgeDrawHelper != null) { final boolean offsetRequired = isPaddingOffsetRequired(); final boolean offsetRequired = isPaddingOffsetRequired(); mFadedEdgeDrawHelper.drawCallback(canvas, mFadedEdgeDrawHelper.drawCallback(canvas, left, right, top + getFadeTop(offsetRequired), bottom, mScrollX, mScrollY, left, right, top + getFadeTop(offsetRequired), bottom, getScrollX(), getScrollY(), getTopFadingEdgeStrength(), getBottomFadingEdgeStrength(), getTopFadingEdgeStrength(), getBottomFadingEdgeStrength(), 0, 0, mPaddingTop); 0, 0, getPaddingTop()); } } } } Loading Loading @@ -289,7 +289,7 @@ public class RecentsVerticalScrollView extends ScrollView super.onFinishInflate(); super.onFinishInflate(); setScrollbarFadingEnabled(true); setScrollbarFadingEnabled(true); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); mLinearLayout = (LinearLayout) findViewById(R.id.recents_linear_layout); final int leftPadding = mContext.getResources() final int leftPadding = getContext().getResources() .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); setOverScrollEffectPadding(leftPadding, 0); setOverScrollEffectPadding(leftPadding, 0); } } Loading @@ -306,7 +306,7 @@ public class RecentsVerticalScrollView extends ScrollView super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); float densityScale = getResources().getDisplayMetrics().density; float densityScale = getResources().getDisplayMetrics().density; mSwipeHelper.setDensityScale(densityScale); mSwipeHelper.setDensityScale(densityScale); float pagingTouchSlop = ViewConfiguration.get(mContext).getScaledPagingTouchSlop(); float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); mSwipeHelper.setPagingTouchSlop(pagingTouchSlop); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class StatusBarIconView extends AnimatedImageView { } } if (!numberEquals) { if (!numberEquals) { if (icon.number > 0 && mContext.getResources().getBoolean( if (icon.number > 0 && getContext().getResources().getBoolean( R.bool.config_statusBarShowNumber)) { R.bool.config_statusBarShowNumber)) { if (mNumberBackground == null) { if (mNumberBackground == null) { mNumberBackground = getContext().getResources().getDrawable( mNumberBackground = getContext().getResources().getDrawable( Loading Loading @@ -240,10 +240,10 @@ public class StatusBarIconView extends AnimatedImageView { void placeNumber() { void placeNumber() { final String str; final String str; final int tooBig = mContext.getResources().getInteger( final int tooBig = getContext().getResources().getInteger( android.R.integer.status_bar_notification_info_maxnum); android.R.integer.status_bar_notification_info_maxnum); if (mIcon.number > tooBig) { if (mIcon.number > tooBig) { str = mContext.getResources().getString( str = getContext().getResources().getString( android.R.string.status_bar_notification_info_overflow); android.R.string.status_bar_notification_info_overflow); } else { } else { NumberFormat f = NumberFormat.getIntegerInstance(); NumberFormat f = NumberFormat.getIntegerInstance(); Loading