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

Commit 00fa131e authored by Xiaowen Lei's avatar Xiaowen Lei Committed by Automerger Merge Worker
Browse files

Merge "Avoid recreating views in SmartSpaceComplicationViewHolder." into...

Merge "Avoid recreating views in SmartSpaceComplicationViewHolder." into tm-qpr-dev am: 70d8bb35 am: a1fe3c30

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18871649



Change-Id: I47962f73a7f2bbe8bcf9f2b802d690fac46328bc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f95f1a79 a1fe3c30
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public class SmartSpaceComplication implements Complication {
    }

    private static class SmartSpaceComplicationViewHolder implements ViewHolder {
        private View mView = null;
        private static final int SMARTSPACE_COMPLICATION_WEIGHT = 10;
        private final DreamSmartspaceController mSmartSpaceController;
        private final Context mContext;
@@ -102,12 +103,16 @@ public class SmartSpaceComplication implements Complication {

        @Override
        public View getView() {
            if (mView != null) {
                return mView;
            }
            final FrameLayout smartSpaceContainer = new FrameLayout(mContext);
            smartSpaceContainer.addView(
                    mSmartSpaceController.buildAndConnectView(smartSpaceContainer),
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                            ViewGroup.LayoutParams.WRAP_CONTENT));

            mView = smartSpaceContainer;
            return smartSpaceContainer;
        }

+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ import javax.inject.Named;
 * a {@link ComplicationLayoutEngine}.
 */
public class ComplicationHostViewController extends ViewController<ConstraintLayout> {
    public static final String TAG = "ComplicationHostViewController";
    public static final String TAG = "ComplicationHostVwCtrl";

    private final ComplicationLayoutEngine mLayoutEngine;
    private final LifecycleOwner mLifecycleOwner;