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

Commit 78b19667 authored by Winson Chung's avatar Winson Chung
Browse files

Removing some dead code and extra view creation.

b/21133230
parent afa77e94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class WidgetPreviewLoader {
     * @return a request id which can be used to cancel the request.
     */
    public PreviewLoadRequest getPreview(final Object o, int previewWidth, int previewHeight,
            WidgetCell caller, Bitmap[] immediateResult) {
            WidgetCell caller) {
        String size = previewWidth + "x" + previewHeight;
        WidgetCacheKey key = getObjectKey(o, size);

+3 −8
Original line number Diff line number Diff line
@@ -143,8 +143,8 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
        }
        // TODO(hyunyoungs): setup a cache for these labels.
        mWidgetName.setText(AppWidgetManagerCompat.getInstance(getContext()).loadLabel(info));
        int hSpan = Math.min(info.spanX, (int) grid.numColumns);
        int vSpan = Math.min(info.spanY, (int) grid.numRows);
        int hSpan = Math.min(info.spanX, grid.numColumns);
        int vSpan = Math.min(info.spanY, grid.numRows);
        mWidgetDims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
        mWidgetPreviewLoader = loader;
    }
@@ -199,12 +199,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
            Log.d(TAG, String.format("[tag=%s] ensurePreview (%d, %d):",
                    getTagToString(), size[0], size[1]));
        }
        Bitmap[] immediateResult = new Bitmap[1];
        mActiveRequest = mWidgetPreviewLoader.getPreview(mInfo, size[0], size[1], this,
                immediateResult);
        if (immediateResult[0] != null) {
            applyPreview(immediateResult[0]);
        }
        mActiveRequest = mWidgetPreviewLoader.getPreview(mInfo, size[0], size[1], this);
    }

    @Override
+4 −5
Original line number Diff line number Diff line
@@ -109,8 +109,7 @@ public class WidgetsListAdapter extends Adapter<WidgetsRowViewHolder> {

        if (diff > 0) {
            for (int i = 0; i < diff; i++) {
                WidgetCell widget = new WidgetCell(mContext);
                widget = (WidgetCell) mLayoutInflater.inflate(
                WidgetCell widget = (WidgetCell) mLayoutInflater.inflate(
                        R.layout.widget_cell, row, false);

                // set up touch.
@@ -135,11 +134,11 @@ public class WidgetsListAdapter extends Adapter<WidgetsRowViewHolder> {
        tv.applyFromPackageItemInfo(infoOut);

        // Bind the view in the widget horizontal tray region.
        for (int i=0; i < infoList.size(); i++) {
            WidgetCell widget = (WidgetCell) row.getChildAt(i);
        if (getWidgetPreviewLoader() == null) {
            return;
        }
        for (int i=0; i < infoList.size(); i++) {
            WidgetCell widget = (WidgetCell) row.getChildAt(i);
            if (infoList.get(i) instanceof LauncherAppWidgetProviderInfo) {
                LauncherAppWidgetProviderInfo info = (LauncherAppWidgetProviderInfo) infoList.get(i);
                PendingAddWidgetInfo pawi = new PendingAddWidgetInfo(info, null);