use of com.android.launcher3.anim.Interpolators.ACCEL_0_75 in project android_packages_apps_Launcher3 by crdroidandroid.
the class RecentsView method updatePageOffsets.
private void updatePageOffsets() {
float offset = mAdjacentPageHorizontalOffset;
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
int count = getChildCount();
TaskView runningTask = mRunningTaskId == -1 || !mRunningTaskTileHidden ? null : getTaskView(mRunningTaskId);
int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
int modalMidpoint = getCurrentPage();
float midpointOffsetSize = 0;
float leftOffsetSize = midpoint - 1 >= 0 ? getHorizontalOffsetSize(midpoint - 1, midpoint, offset) : 0;
float rightOffsetSize = midpoint + 1 < count ? getHorizontalOffsetSize(midpoint + 1, midpoint, offset) : 0;
boolean showAsGrid = showAsGrid();
float modalMidpointOffsetSize = 0;
float modalLeftOffsetSize = 0;
float modalRightOffsetSize = 0;
float gridOffsetSize = 0;
if (showAsGrid) {
// In grid, we only focus the task on the side. The reference index used for offset
// calculation is the task directly next to the focus task in the grid.
int referenceIndex = modalMidpoint == 0 ? 1 : 0;
gridOffsetSize = referenceIndex < count ? getHorizontalOffsetSize(referenceIndex, modalMidpoint, modalOffset) : 0;
} else {
modalLeftOffsetSize = modalMidpoint - 1 >= 0 ? getHorizontalOffsetSize(modalMidpoint - 1, modalMidpoint, modalOffset) : 0;
modalRightOffsetSize = modalMidpoint + 1 < count ? getHorizontalOffsetSize(modalMidpoint + 1, modalMidpoint, modalOffset) : 0;
}
for (int i = 0; i < count; i++) {
float translation = i == midpoint ? midpointOffsetSize : i < midpoint ? leftOffsetSize : rightOffsetSize;
float modalTranslation = i == modalMidpoint ? modalMidpointOffsetSize : showAsGrid ? gridOffsetSize : i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
float totalTranslation = translation + modalTranslation;
View child = getChildAt(i);
FloatProperty translationProperty = child instanceof TaskView ? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty() : mOrientationHandler.getPrimaryViewTranslate();
translationProperty.set(child, totalTranslation);
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile && i == getRunningTaskIndex()) {
mLiveTileTaskViewSimulator.taskPrimaryTranslation.value = totalTranslation;
redrawLiveTile();
}
}
updateCurveProperties();
}
use of com.android.launcher3.anim.Interpolators.ACCEL_0_75 in project android_packages_apps_Trebuchet by LineageOS.
the class RecentsView method updatePageOffsets.
private void updatePageOffsets() {
float offset = mAdjacentPageOffset;
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
if (mIsRtl) {
offset = -offset;
modalOffset = -modalOffset;
}
int count = getChildCount();
TaskView runningTask = mRunningTaskId == -1 || !mRunningTaskTileHidden ? null : getTaskView(mRunningTaskId);
int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
int modalMidpoint = getCurrentPage();
float midpointOffsetSize = 0;
float leftOffsetSize = midpoint - 1 >= 0 ? -getOffsetSize(midpoint - 1, midpoint, offset) : 0;
float rightOffsetSize = midpoint + 1 < count ? getOffsetSize(midpoint + 1, midpoint, offset) : 0;
float modalMidpointOffsetSize = 0;
float modalLeftOffsetSize = modalMidpoint - 1 >= 0 ? -getOffsetSize(modalMidpoint - 1, modalMidpoint, modalOffset) : 0;
float modalRightOffsetSize = modalMidpoint + 1 < count ? getOffsetSize(modalMidpoint + 1, modalMidpoint, modalOffset) : 0;
for (int i = 0; i < count; i++) {
float translation = i == midpoint ? midpointOffsetSize : i < midpoint ? leftOffsetSize : rightOffsetSize;
float modalTranslation = i == modalMidpoint ? modalMidpointOffsetSize : i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
float totalTranslation = translation + modalTranslation;
View child = getChildAt(i);
FloatProperty translationProperty = child instanceof TaskView ? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty() : mOrientationHandler.getPrimaryViewTranslate();
translationProperty.set(child, totalTranslation * mOrientationHandler.getPrimaryTranslationDirectionFactor());
}
updateCurveProperties();
}
use of com.android.launcher3.anim.Interpolators.ACCEL_0_75 in project android_packages_apps_Launcher3 by ArrowOS.
the class RecentsView method updatePageOffsets.
private void updatePageOffsets() {
float offset = mAdjacentPageHorizontalOffset;
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
int count = getChildCount();
TaskView runningTask = mRunningTaskViewId == -1 || !mRunningTaskTileHidden ? null : getRunningTaskView();
int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
int modalMidpoint = getCurrentPage();
float midpointOffsetSize = 0;
float leftOffsetSize = midpoint - 1 >= 0 ? getHorizontalOffsetSize(midpoint - 1, midpoint, offset) : 0;
float rightOffsetSize = midpoint + 1 < count ? getHorizontalOffsetSize(midpoint + 1, midpoint, offset) : 0;
boolean showAsGrid = showAsGrid();
float modalMidpointOffsetSize = 0;
float modalLeftOffsetSize = 0;
float modalRightOffsetSize = 0;
float gridOffsetSize = 0;
if (showAsGrid) {
// In grid, we only focus the task on the side. The reference index used for offset
// calculation is the task directly next to the focus task in the grid.
int referenceIndex = modalMidpoint == 0 ? 1 : 0;
gridOffsetSize = referenceIndex < count ? getHorizontalOffsetSize(referenceIndex, modalMidpoint, modalOffset) : 0;
} else {
modalLeftOffsetSize = modalMidpoint - 1 >= 0 ? getHorizontalOffsetSize(modalMidpoint - 1, modalMidpoint, modalOffset) : 0;
modalRightOffsetSize = modalMidpoint + 1 < count ? getHorizontalOffsetSize(modalMidpoint + 1, modalMidpoint, modalOffset) : 0;
}
for (int i = 0; i < count; i++) {
float translation = i == midpoint ? midpointOffsetSize : i < midpoint ? leftOffsetSize : rightOffsetSize;
float modalTranslation = i == modalMidpoint ? modalMidpointOffsetSize : showAsGrid ? gridOffsetSize : i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
float totalTranslation = translation + modalTranslation;
View child = getChildAt(i);
FloatProperty translationProperty = child instanceof TaskView ? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty() : mOrientationHandler.getPrimaryViewTranslate();
translationProperty.set(child, totalTranslation);
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile && i == getRunningTaskIndex()) {
runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().taskPrimaryTranslation.value = totalTranslation);
redrawLiveTile();
}
}
updateCurveProperties();
}
use of com.android.launcher3.anim.Interpolators.ACCEL_0_75 in project android_packages_apps_Launcher3 by ProtonAOSP.
the class RecentsView method updatePageOffsets.
private void updatePageOffsets() {
float offset = mAdjacentPageHorizontalOffset;
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
int count = getChildCount();
TaskView runningTask = mRunningTaskViewId == -1 || !mRunningTaskTileHidden ? null : getRunningTaskView();
int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
int modalMidpoint = getCurrentPage();
float midpointOffsetSize = 0;
float leftOffsetSize = midpoint - 1 >= 0 ? getHorizontalOffsetSize(midpoint - 1, midpoint, offset) : 0;
float rightOffsetSize = midpoint + 1 < count ? getHorizontalOffsetSize(midpoint + 1, midpoint, offset) : 0;
boolean showAsGrid = showAsGrid();
float modalMidpointOffsetSize = 0;
float modalLeftOffsetSize = 0;
float modalRightOffsetSize = 0;
float gridOffsetSize = 0;
if (showAsGrid) {
// In grid, we only focus the task on the side. The reference index used for offset
// calculation is the task directly next to the focus task in the grid.
int referenceIndex = modalMidpoint == 0 ? 1 : 0;
gridOffsetSize = referenceIndex < count ? getHorizontalOffsetSize(referenceIndex, modalMidpoint, modalOffset) : 0;
} else {
modalLeftOffsetSize = modalMidpoint - 1 >= 0 ? getHorizontalOffsetSize(modalMidpoint - 1, modalMidpoint, modalOffset) : 0;
modalRightOffsetSize = modalMidpoint + 1 < count ? getHorizontalOffsetSize(modalMidpoint + 1, modalMidpoint, modalOffset) : 0;
}
for (int i = 0; i < count; i++) {
float translation = i == midpoint ? midpointOffsetSize : i < midpoint ? leftOffsetSize : rightOffsetSize;
float modalTranslation = i == modalMidpoint ? modalMidpointOffsetSize : showAsGrid ? gridOffsetSize : i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
float totalTranslation = translation + modalTranslation;
View child = getChildAt(i);
FloatProperty translationProperty = child instanceof TaskView ? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty() : mOrientationHandler.getPrimaryViewTranslate();
translationProperty.set(child, totalTranslation);
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile && i == getRunningTaskIndex()) {
runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().taskPrimaryTranslation.value = totalTranslation);
redrawLiveTile();
}
}
updateCurveProperties();
}
use of com.android.launcher3.anim.Interpolators.ACCEL_0_75 in project android_packages_apps_404Launcher by P-404.
the class RecentsView method updatePageOffsets.
private void updatePageOffsets() {
float offset = mAdjacentPageHorizontalOffset;
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
int count = getChildCount();
TaskView runningTask = mRunningTaskViewId == -1 || !mRunningTaskTileHidden ? null : getRunningTaskView();
int midpoint = runningTask == null ? -1 : indexOfChild(runningTask);
int modalMidpoint = getCurrentPage();
float midpointOffsetSize = 0;
float leftOffsetSize = midpoint - 1 >= 0 ? getHorizontalOffsetSize(midpoint - 1, midpoint, offset) : 0;
float rightOffsetSize = midpoint + 1 < count ? getHorizontalOffsetSize(midpoint + 1, midpoint, offset) : 0;
boolean showAsGrid = showAsGrid();
float modalMidpointOffsetSize = 0;
float modalLeftOffsetSize = 0;
float modalRightOffsetSize = 0;
float gridOffsetSize = 0;
if (showAsGrid) {
// In grid, we only focus the task on the side. The reference index used for offset
// calculation is the task directly next to the focus task in the grid.
int referenceIndex = modalMidpoint == 0 ? 1 : 0;
gridOffsetSize = referenceIndex < count ? getHorizontalOffsetSize(referenceIndex, modalMidpoint, modalOffset) : 0;
} else {
modalLeftOffsetSize = modalMidpoint - 1 >= 0 ? getHorizontalOffsetSize(modalMidpoint - 1, modalMidpoint, modalOffset) : 0;
modalRightOffsetSize = modalMidpoint + 1 < count ? getHorizontalOffsetSize(modalMidpoint + 1, modalMidpoint, modalOffset) : 0;
}
for (int i = 0; i < count; i++) {
float translation = i == midpoint ? midpointOffsetSize : i < midpoint ? leftOffsetSize : rightOffsetSize;
float modalTranslation = i == modalMidpoint ? modalMidpointOffsetSize : showAsGrid ? gridOffsetSize : i < modalMidpoint ? modalLeftOffsetSize : modalRightOffsetSize;
float totalTranslation = translation + modalTranslation;
View child = getChildAt(i);
FloatProperty translationProperty = child instanceof TaskView ? ((TaskView) child).getPrimaryTaskOffsetTranslationProperty() : mOrientationHandler.getPrimaryViewTranslate();
translationProperty.set(child, totalTranslation);
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile && i == getRunningTaskIndex()) {
runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().taskPrimaryTranslation.value = totalTranslation);
redrawLiveTile();
}
}
updateCurveProperties();
}