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