Set IconView drawable size for SplitPlaceholderView
Bug: 194194694
Test: Invoking split from overview now shows app icon
Change-Id: Id0c4e253d5730b6eead73b97b5357804ca47cb8f
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index a1befc5..5a86464 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -97,8 +97,9 @@
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 @@
// 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) {
diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
index a712d1a..845e13e 100644
--- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
@@ -24,8 +24,6 @@
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 @@
}
};
- 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);
}
}