Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df9d4e88 authored by Michael Jurka's avatar Michael Jurka Committed by Android (Google) Code Review
Browse files

Merge "Speeding up Recent Apps"

parents a71483c7 57e4d44f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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>
+2 −2
Original line number Diff line number Diff line
@@ -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>
+2 −2
Original line number Diff line number Diff line
@@ -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>
+4 −20
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ public class RecentsPanelView extends RelativeLayout
        }

        public void setThumbnail(Bitmap thumbnail) {
            mThumbnail = compositeBitmap(mDefaultThumbnailBackground, thumbnail);
            mThumbnail = thumbnail;
        }

        public Bitmap getThumbnail() {
@@ -480,13 +480,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);
@@ -525,7 +522,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);
            }
        }
    }

@@ -660,21 +659,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();