diff options
author | Michael Jurka <mikejurka@google.com> | 2011-09-15 17:43:34 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-09-19 14:49:59 -0700 |
commit | 57e4d44f095fbcec7c614a45181d3e531e1bda26 (patch) | |
tree | a8d2c6a7719448de61f48807409007319ef9f6b4 | |
parent | 4f92c9bb8d8484fc9a0dfc1549beedbd1ae8bf01 (diff) | |
download | frameworks_base-57e4d44f095fbcec7c614a45181d3e531e1bda26.zip frameworks_base-57e4d44f095fbcec7c614a45181d3e531e1bda26.tar.gz frameworks_base-57e4d44f095fbcec7c614a45181d3e531e1bda26.tar.bz2 |
Speeding up Recent Apps
- removing unused calls on startup
- no longer compositing bitmaps against a background bitmap
Change-Id: If26812ef475d5d972d98dd1cb9f7f741eeb99dae
4 files changed, 10 insertions, 26 deletions
diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml index 167d362..c6966f9 100644 --- a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml @@ -40,8 +40,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> <ImageView android:id="@+id/app_thumbnail_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/status_bar_recents_thumbnail_width" + android:layout_height="@dimen/status_bar_recents_thumbnail_height" android:visibility="invisible" /> </FrameLayout> diff --git a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml index de80a51..586712f 100644 --- a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml @@ -38,8 +38,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> <ImageView android:id="@+id/app_thumbnail_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/status_bar_recents_thumbnail_width" + android:layout_height="@dimen/status_bar_recents_thumbnail_height" android:visibility="invisible" /> </FrameLayout> diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml index 07088d5..cd8ccd5 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml @@ -33,8 +33,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> <ImageView android:id="@+id/app_thumbnail_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/status_bar_recents_thumbnail_width" + android:layout_height="@dimen/status_bar_recents_thumbnail_height" android:visibility="invisible" /> </FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 0621b22..9bda158 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -128,7 +128,7 @@ public class RecentsPanelView extends RelativeLayout } public void setThumbnail(Bitmap thumbnail) { - mThumbnail = compositeBitmap(mDefaultThumbnailBackground, thumbnail); + mThumbnail = thumbnail; } public Bitmap getThumbnail() { @@ -478,13 +478,10 @@ public class RecentsPanelView extends RelativeLayout if (resolveInfo != null) { final ActivityInfo info = resolveInfo.activityInfo; final String title = info.loadLabel(pm).toString(); - // Drawable icon = info.loadIcon(pm); Drawable icon = getFullResIcon(resolveInfo, pm); if (title != null && title.length() > 0 && icon != null) { if (DEBUG) Log.v(TAG, "creating activity desc for id=" + recentInfo.id + ", label=" + title); - ActivityManager.TaskThumbnails thumbs = am.getTaskThumbnails( - recentInfo.persistentId); ActivityDescription item = new ActivityDescription(recentInfo, resolveInfo, intent, index, info.packageName); activityDescriptions.add(item); @@ -523,7 +520,9 @@ public class RecentsPanelView extends RelativeLayout synchronized (ad) { ad.mLabel = label; ad.mIcon = icon; - ad.setThumbnail(thumbs != null ? thumbs.mainThumbnail : mDefaultThumbnailBackground); + if (thumbs != null && thumbs.mainThumbnail != null) { + ad.setThumbnail(thumbs.mainThumbnail); + } } } @@ -651,21 +650,6 @@ public class RecentsPanelView extends RelativeLayout } } - private Bitmap compositeBitmap(Bitmap background, Bitmap thumbnail) { - Bitmap outBitmap = background.copy(background.getConfig(), true); - if (thumbnail != null) { - Canvas canvas = new Canvas(outBitmap); - Paint paint = new Paint(); - paint.setAntiAlias(true); - paint.setFilterBitmap(true); - paint.setAlpha(255); - canvas.drawBitmap(thumbnail, null, - new RectF(0, 0, outBitmap.getWidth(), outBitmap.getHeight()), paint); - canvas.setBitmap(null); - } - return outBitmap; - } - private void updateUiElements(Configuration config) { final int items = mActivityDescriptions.size(); |