Snap for 8925421 from 88568fd15b to udc-release

Change-Id: I5a3fe6b0c85c3e4cd9c621f2ab93260bd509b960
This commit is contained in:
Android Build Coastguard Worker committed 2022-08-10 01:26:26 +00:00
commit da0f99ff16
7 files changed
+28 -13

No files matched your search

@@ -1416,7 +1416,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
anim.start(mLauncher, velocityPxPerS);
anim.start(mLauncher, mDeviceProfile, velocityPxPerS);
}
});
return anim;
@@ -32,6 +32,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.Utilities;
@@ -48,6 +49,7 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.StringJoiner;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
@@ -92,6 +94,15 @@ import java.util.function.Supplier;
// We skip any view synchronizations during init/destroy.
private boolean mCanSyncViews;
private final Consumer<Float> mIconAlphaForHomeConsumer = alpha -> {
mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
mLauncher.getHotseat().setQsbAlpha(
mLauncher.getDeviceProfile().isQsbInline && alpha > 0 ? 0 : 1);
};
private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener =
dp -> mIconAlphaForHomeConsumer.accept(mIconAlphaForHome.getValue());
private final StateManager.StateListener<LauncherState> mStateListener =
new StateManager.StateListener<LauncherState>() {
@@ -131,13 +142,7 @@ import java.util.function.Supplier;
.getTaskbarBackgroundAlpha();
MultiValueAlpha taskbarIconAlpha = mControllers.taskbarViewController.getTaskbarIconAlpha();
mIconAlphaForHome = taskbarIconAlpha.getProperty(ALPHA_INDEX_HOME);
mIconAlphaForHome.setConsumer(
alpha -> {
mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
if (mLauncher.getDeviceProfile().isQsbInline) {
mLauncher.getHotseat().setQsbAlpha(alpha > 0 ? 0 : 1);
}
});
mIconAlphaForHome.setConsumer(mIconAlphaForHomeConsumer);
mIconAlignmentForResumedState.finishAnimation();
onIconAlignmentRatioChangedForAppAndHomeTransition();
@@ -150,6 +155,7 @@ import java.util.function.Supplier;
applyState(0);
mCanSyncViews = true;
mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
}
public void onDestroy() {
@@ -164,6 +170,7 @@ import java.util.function.Supplier;
mLauncher.getStateManager().removeStateListener(mStateListener);
mCanSyncViews = true;
mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
}
public Animator createAnimToLauncher(@NonNull LauncherState toState,
@@ -1330,7 +1330,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
if (windowAnimation == null) {
continue;
}
windowAnimation.start(mContext, velocityPxPerMs);
DeviceProfile dp = mActivity == null ? null : mActivity.getDeviceProfile();
windowAnimation.start(mContext, dp, velocityPxPerMs);
mRunningWindowAnim[i] = RunningWindowAnim.wrap(windowAnimation);
}
homeAnimFactory.setSwipeVelocity(velocityPxPerMs.y);
@@ -358,7 +358,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
};
RectFSpringAnim windowAnim = createWindowAnimationToHome(startShift,
homeAnimFactory)[0];
windowAnim.start(mContext, velocityPxPerMs);
windowAnim.start(mContext, mDp, velocityPxPerMs);
return windowAnim;
}
}
@@ -214,7 +214,7 @@ public class RectFSpringAnim extends ReleaseCheck {
* @param context The activity context.
* @param velocityPxPerMs Velocity of swipe in px/ms.
*/
public void start(Context context, PointF velocityPxPerMs) {
public void start(Context context, @Nullable DeviceProfile profile, PointF velocityPxPerMs) {
// Only tell caller that we ended if both x and y animations have ended.
OnAnimationEndListener onXEndListener = ((animation, canceled, centerX, velocityX) -> {
mRectXAnimEnded = true;
@@ -252,7 +252,13 @@ public class RectFSpringAnim extends ReleaseCheck {
float minVisibleChange = Math.abs(1f / mStartRect.height());
ResourceProvider rp = DynamicResource.provider(context);
float damping = rp.getFloat(R.dimen.swipe_up_rect_scale_damping_ratio);
float stiffness = rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness);
// Increase the stiffness for devices where we want the window size to transform quicker.
boolean shouldUseHigherStiffness = profile != null
&& (profile.isLandscape || profile.isTablet);
float stiffness = shouldUseHigherStiffness
? rp.getFloat(R.dimen.swipe_up_rect_scale_higher_stiffness)
: rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness);
mRectScaleAnim = new SpringAnimation(this, RECT_SCALE_PROGRESS)
.setSpring(new SpringForce(1f)
+1
View File
@@ -157,6 +157,7 @@
<item name="swipe_up_rect_scale_damping_ratio" type="dimen" format="float">0.75</item>
<item name="swipe_up_rect_scale_stiffness" type="dimen" format="float">200</item>
<item name="swipe_up_rect_scale_higher_stiffness" type="dimen" format="float">400</item>
<item name="swipe_up_rect_xy_fling_friction" type="dimen" format="float">1.5</item>
@@ -26,7 +26,7 @@ import com.android.launcher3.Workspace;
public class SpringLoadedDragController implements OnAlarmListener {
// how long the user must hover over a mini-screen before it unshrinks
private static final long ENTER_SPRING_LOAD_HOVER_TIME = 500;
private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 1500;
private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 2000;
private static final long ENTER_SPRING_LOAD_CANCEL_HOVER_TIME = 950;
Alarm mAlarm;