Merge "Use split thumbnail width/height directly" into sc-v2-dev
This commit is contained in:
commit
5394db834f
|
@ -4,7 +4,6 @@ import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITIO
|
|||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
|
@ -50,8 +49,6 @@ public class GroupedTaskView extends TaskView {
|
|||
private final float[] mIcon2CenterCoords = new float[2];
|
||||
private TransformingTouchDelegate mIcon2TouchDelegate;
|
||||
@Nullable private StagedSplitBounds mSplitBoundsConfig;
|
||||
private final Rect mPrimaryTempRect = new Rect();
|
||||
private final Rect mSecondaryTempRect = new Rect();
|
||||
|
||||
public GroupedTaskView(Context context) {
|
||||
super(context);
|
||||
|
@ -239,10 +236,8 @@ public class GroupedTaskView extends TaskView {
|
|||
int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
|
||||
boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
|
||||
|
||||
mSnapshotView.getBoundsOnScreen(mPrimaryTempRect);
|
||||
mSnapshotView2.getBoundsOnScreen(mSecondaryTempRect);
|
||||
getPagedOrientationHandler().setSplitIconParams(mIconView, mIconView2,
|
||||
taskIconHeight, mPrimaryTempRect, mSecondaryTempRect,
|
||||
taskIconHeight, mSnapshotView.getWidth(), mSnapshotView.getHeight(),
|
||||
isRtl, deviceProfile, mSplitBoundsConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
|||
|
||||
@Override
|
||||
public void setSplitIconParams(View primaryIconView, View secondaryIconView,
|
||||
int taskIconHeight, Rect primarySnapshotBounds, Rect secondarySnapshotBounds,
|
||||
int taskIconHeight, int primarySnapshotWidth, int primarySnapshotHeight,
|
||||
boolean isRtl, DeviceProfile deviceProfile, StagedSplitBounds splitConfig) {
|
||||
FrameLayout.LayoutParams primaryIconParams =
|
||||
(FrameLayout.LayoutParams) primaryIconView.getLayoutParams();
|
||||
|
@ -439,13 +439,12 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
|||
splitConfig.visualDividerBounds.height() :
|
||||
splitConfig.visualDividerBounds.width());
|
||||
|
||||
int primaryHeight = primarySnapshotBounds.height();
|
||||
primaryIconParams.gravity = (isRtl ? START : END) | TOP;
|
||||
primaryIconView.setTranslationY(primaryHeight - primaryIconView.getHeight() / 2f);
|
||||
primaryIconView.setTranslationY(primarySnapshotHeight - primaryIconView.getHeight() / 2f);
|
||||
primaryIconView.setTranslationX(0);
|
||||
|
||||
secondaryIconParams.gravity = (isRtl ? START : END) | TOP;
|
||||
secondaryIconView.setTranslationY(primaryHeight + taskIconHeight + dividerBar);
|
||||
secondaryIconView.setTranslationY(primarySnapshotHeight + taskIconHeight + dividerBar);
|
||||
secondaryIconView.setTranslationX(0);
|
||||
primaryIconView.setLayoutParams(primaryIconParams);
|
||||
secondaryIconView.setLayoutParams(secondaryIconParams);
|
||||
|
|
|
@ -152,7 +152,7 @@ public interface PagedOrientationHandler {
|
|||
void setIconAndSnapshotParams(View iconView, int taskIconMargin, int taskIconHeight,
|
||||
FrameLayout.LayoutParams snapshotParams, boolean isRtl);
|
||||
void setSplitIconParams(View primaryIconView, View secondaryIconView,
|
||||
int taskIconHeight, Rect primarySnapshotBounds, Rect secondarySnapshotBounds,
|
||||
int taskIconHeight, int primarySnapshotWidth, int primarySnapshotHeight,
|
||||
boolean isRtl, DeviceProfile deviceProfile, StagedSplitBounds splitConfig);
|
||||
|
||||
/*
|
||||
|
|
|
@ -523,7 +523,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
|||
|
||||
@Override
|
||||
public void setSplitIconParams(View primaryIconView, View secondaryIconView,
|
||||
int taskIconHeight, Rect primarySnapshotBounds, Rect secondarySnapshotBounds,
|
||||
int taskIconHeight, int primarySnapshotWidth, int primarySnapshotHeight,
|
||||
boolean isRtl, DeviceProfile deviceProfile, StagedSplitBounds splitConfig) {
|
||||
FrameLayout.LayoutParams primaryIconParams =
|
||||
(FrameLayout.LayoutParams) primaryIconView.getLayoutParams();
|
||||
|
@ -533,15 +533,12 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
|||
splitConfig.visualDividerBounds.height() :
|
||||
splitConfig.visualDividerBounds.width());
|
||||
|
||||
int primaryWidth = primarySnapshotBounds.width();
|
||||
if (deviceProfile.isLandscape) {
|
||||
primaryIconParams.gravity = TOP | START;
|
||||
primaryIconView.setTranslationX(primaryWidth - primaryIconView.getWidth());
|
||||
primaryIconView.setTranslationX(primarySnapshotWidth - primaryIconView.getWidth());
|
||||
primaryIconView.setTranslationY(0);
|
||||
|
||||
secondaryIconParams.gravity = TOP | START;
|
||||
secondaryIconView.setTranslationX(primaryWidth + dividerBar);
|
||||
secondaryIconView.setTranslationY(0);
|
||||
secondaryIconView.setTranslationX(primarySnapshotWidth + dividerBar);
|
||||
} else {
|
||||
primaryIconParams.gravity = TOP | CENTER_HORIZONTAL;
|
||||
primaryIconView.setTranslationX(-(primaryIconView.getWidth()) / 2f);
|
||||
|
@ -549,8 +546,8 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
|||
|
||||
secondaryIconParams.gravity = TOP | CENTER_HORIZONTAL;
|
||||
secondaryIconView.setTranslationX(secondaryIconView.getWidth() / 2f);
|
||||
secondaryIconView.setTranslationY(0);
|
||||
}
|
||||
secondaryIconView.setTranslationY(0);
|
||||
primaryIconView.setLayoutParams(primaryIconParams);
|
||||
secondaryIconView.setLayoutParams(secondaryIconParams);
|
||||
}
|
||||
|
|
|
@ -132,10 +132,10 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
|
|||
|
||||
@Override
|
||||
public void setSplitIconParams(View primaryIconView, View secondaryIconView,
|
||||
int taskIconHeight, Rect primarySnapshotBounds, Rect secondarySnapshotBounds,
|
||||
int taskIconHeight, int primarySnapshotWidth, int primarySnapshotHeight,
|
||||
boolean isRtl, DeviceProfile deviceProfile, StagedSplitBounds splitConfig) {
|
||||
super.setSplitIconParams(primaryIconView, secondaryIconView, taskIconHeight,
|
||||
primarySnapshotBounds, secondarySnapshotBounds, isRtl, deviceProfile, splitConfig);
|
||||
primarySnapshotWidth, primarySnapshotHeight, isRtl, deviceProfile, splitConfig);
|
||||
FrameLayout.LayoutParams primaryIconParams =
|
||||
(FrameLayout.LayoutParams) primaryIconView.getLayoutParams();
|
||||
FrameLayout.LayoutParams secondaryIconParams =
|
||||
|
|
Loading…
Reference in New Issue