Merge "Overview - Add motion to the footer shown on overview tasks." into ub-launcher3-qt-dev
This commit is contained in:
@@ -145,11 +145,13 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
};
|
||||
|
||||
private final TaskOutlineProvider mOutlineProvider;
|
||||
private final FooterOutlineProvider mFooterOutlineProvider;
|
||||
|
||||
private Task mTask;
|
||||
private TaskThumbnailView mSnapshotView;
|
||||
private TaskMenuView mMenuView;
|
||||
private IconView mIconView;
|
||||
private View mTaskFooterContainer;
|
||||
private DigitalWellBeingToast mDigitalWellBeingToast;
|
||||
private float mCurveScale;
|
||||
private float mFullscreenProgress;
|
||||
@@ -203,6 +205,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
mWindowCornerRadius = QuickStepContract.getWindowCornerRadius(context.getResources());
|
||||
mCurrentFullscreenParams = new FullscreenDrawParams(mCornerRadius);
|
||||
mOutlineProvider = new TaskOutlineProvider(getResources(), mCurrentFullscreenParams);
|
||||
mFooterOutlineProvider = new FooterOutlineProvider(mCurrentFullscreenParams);
|
||||
setOutlineProvider(mOutlineProvider);
|
||||
}
|
||||
|
||||
@@ -212,6 +215,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
mSnapshotView = findViewById(R.id.snapshot);
|
||||
mIconView = findViewById(R.id.icon);
|
||||
mDigitalWellBeingToast = findViewById(R.id.digital_well_being_toast);
|
||||
mTaskFooterContainer = findViewById(R.id.task_footer_container);
|
||||
mTaskFooterContainer.setOutlineProvider(mFooterOutlineProvider);
|
||||
mTaskFooterContainer.setClipToOutline(true);
|
||||
}
|
||||
|
||||
public TaskMenuView getMenuView() {
|
||||
@@ -410,6 +416,15 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
.getInterpolation(progress);
|
||||
mIconView.setScaleX(scale);
|
||||
mIconView.setScaleY(scale);
|
||||
|
||||
int footerVerticalOffset = (int) (mTaskFooterContainer.getHeight() * (1.0f - scale));
|
||||
mTaskFooterContainer.setTranslationY(
|
||||
mCurrentFullscreenParams.mCurrentDrawnInsets.bottom +
|
||||
mCurrentFullscreenParams.mCurrentDrawnInsets.top +
|
||||
footerVerticalOffset);
|
||||
mFooterOutlineProvider.setFullscreenDrawParams(
|
||||
mCurrentFullscreenParams, footerVerticalOffset);
|
||||
mTaskFooterContainer.invalidateOutline();
|
||||
}
|
||||
|
||||
public void setIconScaleAnimStartProgress(float startProgress) {
|
||||
@@ -550,6 +565,29 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class FooterOutlineProvider extends ViewOutlineProvider {
|
||||
|
||||
private FullscreenDrawParams mFullscreenDrawParams;
|
||||
private int mVerticalOffset;
|
||||
private final Rect mOutlineRect = new Rect();
|
||||
|
||||
FooterOutlineProvider(FullscreenDrawParams params) {
|
||||
mFullscreenDrawParams = params;
|
||||
}
|
||||
|
||||
void setFullscreenDrawParams(FullscreenDrawParams params, int verticalOffset) {
|
||||
mFullscreenDrawParams = params;
|
||||
mVerticalOffset = verticalOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
mOutlineRect.set(0, 0, view.getWidth(), view.getHeight());
|
||||
mOutlineRect.offset(0, -mVerticalOffset);
|
||||
outline.setRoundRect(mOutlineRect, mFullscreenDrawParams.mCurrentDrawnCornerRadius);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(info);
|
||||
@@ -639,7 +677,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
}
|
||||
mFullscreenProgress = progress;
|
||||
boolean isFullscreen = mFullscreenProgress > 0;
|
||||
setIconScaleAndDim(progress, true /* invert */);
|
||||
mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
|
||||
setClipChildren(!isFullscreen);
|
||||
setClipToPadding(!isFullscreen);
|
||||
@@ -663,6 +700,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
/ (getWidth() + currentInsetsLeft + currentInsetsRight));
|
||||
}
|
||||
|
||||
// Some of the items in here are dependent on the current fullscreen params
|
||||
setIconScaleAndDim(progress, true /* invert */);
|
||||
|
||||
thumbnail.setFullscreenParams(mCurrentFullscreenParams);
|
||||
mOutlineProvider.setFullscreenParams(mCurrentFullscreenParams);
|
||||
invalidateOutline();
|
||||
|
||||
Reference in New Issue
Block a user