Merge "Move FloatingTaskInit set up into init method" into sc-v2-dev am: 039501f41f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16279510 Change-Id: If7370a7be6941e51f6559d79e824838ce2e601ac
This commit is contained in:
@@ -73,6 +73,32 @@ public class FloatingTaskView extends FrameLayout {
|
|||||||
mSplitPlaceholderView.setAlpha(0);
|
mSplitPlaceholderView.setAlpha(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void init(StatefulActivity launcher, TaskView originalView, RectF positionOut) {
|
||||||
|
mStartingPosition = positionOut;
|
||||||
|
updateInitialPositionForView(originalView);
|
||||||
|
final InsettableFrameLayout.LayoutParams lp =
|
||||||
|
(InsettableFrameLayout.LayoutParams) getLayoutParams();
|
||||||
|
|
||||||
|
mSplitPlaceholderView.setLayoutParams(new FrameLayout.LayoutParams(lp.width, lp.height));
|
||||||
|
positionOut.round(mOutline);
|
||||||
|
setPivotX(0);
|
||||||
|
setPivotY(0);
|
||||||
|
|
||||||
|
// Copy bounds of exiting thumbnail into ImageView
|
||||||
|
TaskThumbnailView thumbnail = originalView.getThumbnail();
|
||||||
|
mImageView.setImageBitmap(thumbnail.getThumbnail());
|
||||||
|
mImageView.setVisibility(VISIBLE);
|
||||||
|
|
||||||
|
mOrientationHandler = originalView.getRecentsView().getPagedOrientationHandler();
|
||||||
|
mSplitPlaceholderView.setIconView(originalView.getIconView(),
|
||||||
|
launcher.getDeviceProfile().overviewTaskIconDrawableSizePx);
|
||||||
|
mSplitPlaceholderView.getIconView().setRotation(mOrientationHandler.getDegreesRotated());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures and returns a an instance of {@link FloatingTaskView} initially matching the
|
||||||
|
* appearance of {@code originalView}.
|
||||||
|
*/
|
||||||
public static FloatingTaskView getFloatingTaskView(StatefulActivity launcher,
|
public static FloatingTaskView getFloatingTaskView(StatefulActivity launcher,
|
||||||
TaskView originalView, RectF positionOut) {
|
TaskView originalView, RectF positionOut) {
|
||||||
final BaseDragLayer dragLayer = launcher.getDragLayer();
|
final BaseDragLayer dragLayer = launcher.getDragLayer();
|
||||||
@@ -80,28 +106,7 @@ public class FloatingTaskView extends FrameLayout {
|
|||||||
final FloatingTaskView floatingView = (FloatingTaskView) launcher.getLayoutInflater()
|
final FloatingTaskView floatingView = (FloatingTaskView) launcher.getLayoutInflater()
|
||||||
.inflate(R.layout.floating_split_select_view, parent, false);
|
.inflate(R.layout.floating_split_select_view, parent, false);
|
||||||
|
|
||||||
floatingView.mStartingPosition = positionOut;
|
floatingView.init(launcher, originalView, positionOut);
|
||||||
floatingView.updateInitialPositionForView(originalView);
|
|
||||||
final InsettableFrameLayout.LayoutParams lp =
|
|
||||||
(InsettableFrameLayout.LayoutParams) floatingView.getLayoutParams();
|
|
||||||
|
|
||||||
floatingView.mSplitPlaceholderView.setLayoutParams(
|
|
||||||
new FrameLayout.LayoutParams(lp.width, lp.height));
|
|
||||||
positionOut.round(floatingView.mOutline);
|
|
||||||
floatingView.setPivotX(0);
|
|
||||||
floatingView.setPivotY(0);
|
|
||||||
|
|
||||||
// Copy bounds of exiting thumbnail into ImageView
|
|
||||||
TaskThumbnailView thumbnail = originalView.getThumbnail();
|
|
||||||
floatingView.mImageView.setImageBitmap(thumbnail.getThumbnail());
|
|
||||||
floatingView.mImageView.setVisibility(VISIBLE);
|
|
||||||
|
|
||||||
floatingView.mOrientationHandler =
|
|
||||||
originalView.getRecentsView().getPagedOrientationHandler();
|
|
||||||
floatingView.mSplitPlaceholderView.setIconView(originalView.getIconView(),
|
|
||||||
launcher.getDeviceProfile().overviewTaskIconDrawableSizePx);
|
|
||||||
floatingView.mSplitPlaceholderView.getIconView()
|
|
||||||
.setRotation(floatingView.mOrientationHandler.getDegreesRotated());
|
|
||||||
parent.addView(floatingView);
|
parent.addView(floatingView);
|
||||||
return floatingView;
|
return floatingView;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user