Search in sources :

Example 51 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_404Launcher by P-404.

the class DigitalWellBeingToast method setupAndAddBanner.

private void setupAndAddBanner() {
    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mBanner.getLayoutParams();
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    layoutParams.bottomMargin = ((ViewGroup.MarginLayoutParams) mTaskView.getThumbnail().getLayoutParams()).bottomMargin;
    PagedOrientationHandler orientationHandler = mTaskView.getPagedOrientationHandler();
    Pair<Float, Float> translations = orientationHandler.setDwbLayoutParamsAndGetTranslations(mTaskView.getMeasuredWidth(), mTaskView.getMeasuredHeight(), mStagedSplitBounds, deviceProfile, mTaskView.getThumbnails(), mTask.key.id, mBanner);
    mSplitOffsetTranslationX = translations.first;
    mSplitOffsetTranslationY = translations.second;
    updateTranslationY();
    updateTranslationX();
    mTaskView.addView(mBanner);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) ViewGroup(android.view.ViewGroup) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) FrameLayout(android.widget.FrameLayout)

Example 52 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_404Launcher by P-404.

the class ClearAllButton method applySecondaryTranslation.

private void applySecondaryTranslation() {
    RecentsView recentsView = getRecentsView();
    if (recentsView == null) {
        return;
    }
    PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler();
    orientationHandler.getSecondaryViewTranslate().set(this, orientationHandler.getSecondaryValue(0f, getOriginalTranslationY()));
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 53 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_404Launcher by P-404.

the class ClearAllButton method onRecentsViewScroll.

public void onRecentsViewScroll(int scroll, boolean gridEnabled) {
    RecentsView recentsView = getRecentsView();
    if (recentsView == null) {
        return;
    }
    PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler();
    float orientationSize = orientationHandler.getPrimaryValue(getWidth(), getHeight());
    if (orientationSize == 0) {
        return;
    }
    int clearAllScroll = recentsView.getClearAllScroll();
    int adjustedScrollFromEdge = Math.abs(scroll - clearAllScroll);
    float shift = Math.min(adjustedScrollFromEdge, orientationSize);
    mNormalTranslationPrimary = mIsRtl ? -shift : shift;
    if (!gridEnabled) {
        mNormalTranslationPrimary += mSidePadding;
    }
    applyPrimaryTranslation();
    applySecondaryTranslation();
    mScrollAlpha = 1 - shift / orientationSize;
    updateAlpha();
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 54 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_404Launcher by P-404.

the class RecentsView method onRotateInSplitSelectionState.

protected void onRotateInSplitSelectionState() {
    mOrientationHandler.getInitialSplitPlaceholderBounds(mSplitPlaceholderSize, mActivity.getDeviceProfile(), mSplitSelectStateController.getActiveSplitStagePosition(), mTempRect);
    mTempRectF.set(mTempRect);
    // TODO(194414938) set correct corner radius
    if (mFirstFloatingTaskView != null) {
        mFirstFloatingTaskView.updateOrientationHandler(mOrientationHandler);
        mFirstFloatingTaskView.update(mTempRectF, /*progress=*/
        1f, /*windowRadius=*/
        0f);
    }
    PagedOrientationHandler orientationHandler = getPagedOrientationHandler();
    Pair<FloatProperty, FloatProperty> taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION, mActivity.getDeviceProfile());
    taskViewsFloat.first.set(this, getSplitSelectTranslation());
    taskViewsFloat.second.set(this, 0f);
    applySplitPrimaryScrollOffset();
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) FloatProperty(android.util.FloatProperty)

Example 55 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_404Launcher by P-404.

the class RecentsView method getSplitSelectTranslation.

/**
 * Returns how much additional translation there should be for each of the child TaskViews.
 * Note that the translation can be its primary or secondary dimension.
 */
public float getSplitSelectTranslation() {
    int splitPosition = getSplitPlaceholder().getActiveSplitStagePosition();
    if (!shouldShiftThumbnailsForSplitSelect()) {
        return 0f;
    }
    PagedOrientationHandler orientationHandler = getPagedOrientationHandler();
    int direction = orientationHandler.getSplitTranslationDirectionFactor(splitPosition, mActivity.getDeviceProfile());
    return mActivity.getResources().getDimension(R.dimen.split_placeholder_size) * direction;
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) TextPaint(android.text.TextPaint) Point(android.graphics.Point)

Aggregations

PagedOrientationHandler (com.android.launcher3.touch.PagedOrientationHandler)101 RecentsView (com.android.quickstep.views.RecentsView)25 DeviceProfile (com.android.launcher3.DeviceProfile)22 Rect (android.graphics.Rect)16 PendingAnimation (com.android.launcher3.anim.PendingAnimation)15 FloatProperty (android.util.FloatProperty)14 BaseDragLayer (com.android.launcher3.views.BaseDragLayer)12 PointF (android.graphics.PointF)11 RectF (android.graphics.RectF)11 Point (android.graphics.Point)9 TimeInterpolator (android.animation.TimeInterpolator)6 Matrix (android.graphics.Matrix)6 View (android.view.View)6 Interpolator (android.view.animation.Interpolator)6 AbstractFloatingView (com.android.launcher3.AbstractFloatingView)6 TaskView (com.android.quickstep.views.TaskView)6 Context (android.content.Context)5 ShapeDrawable (android.graphics.drawable.ShapeDrawable)5 RectShape (android.graphics.drawable.shapes.RectShape)5 MotionEvent (android.view.MotionEvent)5