Search in sources :

Example 86 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_Launcher3 by ArrowOS.

the class ClearAllButton method onLayout.

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    PagedOrientationHandler orientationHandler = getRecentsView().getPagedOrientationHandler();
    mSidePadding = orientationHandler.getClearAllSidePadding(getRecentsView(), mIsRtl);
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 87 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_Launcher3 by ArrowOS.

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 88 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_Launcher3 by ArrowOS.

the class ClearAllButton method applyPrimaryTranslation.

private void applyPrimaryTranslation() {
    RecentsView recentsView = getRecentsView();
    if (recentsView == null) {
        return;
    }
    PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler();
    orientationHandler.getPrimaryViewTranslate().set(this, orientationHandler.getPrimaryValue(0f, getOriginalTranslationY()) + mNormalTranslationPrimary + getFullscreenTrans(mFullscreenTranslationPrimary) + getGridTrans(mGridTranslationPrimary));
}
Also used : PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 89 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_Launcher3 by ProtonAOSP.

the class TaskView method setOrientationState.

public void setOrientationState(RecentsOrientedState orientationState) {
    PagedOrientationHandler orientationHandler = orientationState.getOrientationHandler();
    boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
    LayoutParams snapshotParams = (LayoutParams) mSnapshotView.getLayoutParams();
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    boolean isGridTask = isGridTask();
    int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
    int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx : deviceProfile.overviewTaskMarginPx;
    int taskIconMargin = snapshotParams.topMargin - taskIconHeight - taskMargin;
    LayoutParams iconParams = (LayoutParams) mIconView.getLayoutParams();
    orientationHandler.setIconAndSnapshotParams(mIconView, taskIconMargin, taskIconHeight, snapshotParams, isRtl);
    mSnapshotView.setLayoutParams(snapshotParams);
    iconParams.width = iconParams.height = taskIconHeight;
    mIconView.setLayoutParams(iconParams);
    mIconView.setRotation(orientationHandler.getDegreesRotated());
    int iconDrawableSize = isGridTask ? deviceProfile.overviewTaskIconDrawableSizeGridPx : deviceProfile.overviewTaskIconDrawableSizePx;
    mIconView.setDrawableSize(iconDrawableSize, iconDrawableSize);
    snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    mSnapshotView.setLayoutParams(snapshotParams);
    mSnapshotView.getTaskOverlay().updateOrientationState(orientationState);
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 90 with PagedOrientationHandler

use of com.android.launcher3.touch.PagedOrientationHandler in project android_packages_apps_Launcher3 by ProtonAOSP.

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)

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