mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Merge "Set IconView drawable size for SplitPlaceholderView" into sc-v2-dev
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user