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);
}
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()));
}
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));
}
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);
}
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);
}
Aggregations