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

Commit 9bd2802c authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Set IconView drawable size for SplitPlaceholderView" into sc-v2-dev

parents 3f8f61cb 036baed9
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -97,8 +97,9 @@ public class FloatingTaskView extends FrameLayout {

        floatingView.mOrientationHandler =
                originalView.getRecentsView().getPagedOrientationHandler();
        floatingView.mSplitPlaceholderView.setIcon(originalView.getIconView());
        floatingView.mSplitPlaceholderView.getIcon()
        floatingView.mSplitPlaceholderView.setIconView(originalView.getIconView(),
                launcher.getDeviceProfile().overviewTaskIconDrawableSizePx);
        floatingView.mSplitPlaceholderView.getIconView()
                .setRotation(floatingView.mOrientationHandler.getDegreesRotated());
        parent.addView(floatingView);
        return floatingView;
@@ -141,8 +142,8 @@ public class FloatingTaskView extends FrameLayout {
        // TODO(194414938) seems like this scale value could be fine tuned, some stretchiness
        mImageView.setScaleX(1f / scaleX + scaleX * progress);
        mImageView.setScaleY(1f / scaleY + scaleY * progress);
        mOrientationHandler.setPrimaryScale(mSplitPlaceholderView.getIcon(), childScaleX);
        mOrientationHandler.setSecondaryScale(mSplitPlaceholderView.getIcon(), childScaleY);
        mOrientationHandler.setPrimaryScale(mSplitPlaceholderView.getIconView(), childScaleX);
        mOrientationHandler.setSecondaryScale(mSplitPlaceholderView.getIconView(), childScaleY);
    }

    protected void initPosition(RectF pos, InsettableFrameLayout.LayoutParams lp) {
+11 −21
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.widget.FrameLayout;

import androidx.annotation.Nullable;

import com.android.quickstep.util.SplitSelectStateController;

public class SplitPlaceholderView extends FrameLayout {

    public static final FloatProperty<SplitPlaceholderView> ALPHA_FLOAT =
@@ -42,34 +40,26 @@ public class SplitPlaceholderView extends FrameLayout {
                }
            };

    private SplitSelectStateController mSplitController;
    private IconView mIcon;
    private IconView mIconView;

    public SplitPlaceholderView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void init(SplitSelectStateController controller) {
        this.mSplitController = controller;
    }

    public SplitSelectStateController getSplitController() {
        return mSplitController;
    }

    @Nullable
    public IconView getIcon() {
        return mIcon;
    public IconView getIconView() {
        return mIconView;
    }

    public void setIcon(IconView icon) {
        if (mIcon == null) {
            mIcon = new IconView(getContext());
            addView(mIcon);
    public void setIconView(IconView iconView, int iconSize) {
        if (mIconView == null) {
            mIconView = new IconView(getContext());
            addView(mIconView);
        }
        mIcon.setDrawable(icon.getDrawable());
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(icon.getLayoutParams());
        mIconView.setDrawable(iconView.getDrawable());
        mIconView.setDrawableSize(iconSize, iconSize);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(iconView.getLayoutParams());
        params.gravity = Gravity.CENTER;
        mIcon.setLayoutParams(params);
        mIconView.setLayoutParams(params);
    }
}