Merge "Polish redesgined tutorial home and overview animations" into udc-dev

This commit is contained in:
Treehugger Robot
2023-06-14 18:35:21 +00:00
committed by Android (Google) Code Review
6 changed files with 57 additions and 5 deletions

View File

@@ -28,7 +28,7 @@
android:layout_height="wrap_content"
app:constraint_referenced_ids="hotseat_search_bar, hotseat_icon_1, hotseat_icon_2,
hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
hotseat_icon_3, hotseat_icon_4, hotseat_icon_5, hotseat_icon_6"
app:flow_horizontalStyle="spread"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -77,4 +77,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_6"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -40,7 +40,8 @@
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5,
hotseat_icon_6"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -81,4 +82,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_6"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -40,7 +40,8 @@
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5,
hotseat_icon_6"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -81,4 +82,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_6"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -192,7 +192,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge);
break;
case OVERVIEW_GESTURE_COMPLETED:
fadeOutFakeTaskView(true, () -> {
fadeOutFakeTaskView(false, () -> {
showFeedback(R.string.home_gesture_feedback_overview_detected);
showFakeTaskbar(/* animateFromHotseat= */ false);
});

View File

@@ -15,6 +15,9 @@
*/
package com.android.quickstep.interaction;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
@@ -38,6 +41,7 @@ import android.view.ViewOutlineProvider;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.graphics.ColorUtils;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
@@ -46,6 +50,7 @@ import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
import com.android.quickstep.GestureState;
import com.android.quickstep.OverviewComponentObserver;
import com.android.quickstep.RecentsAnimationDeviceState;
@@ -125,6 +130,9 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
void resetTaskViews() {
mFakeHotseatView.setVisibility(View.INVISIBLE);
mFakeIconView.setVisibility(View.INVISIBLE);
if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
mFakeIconView.getBackground().setTint(getFakeTaskViewColor());
}
if (mTutorialFragment.getActivity() != null) {
int height = mTutorialFragment.getRootView().getFullscreenHeight();
int width = mTutorialFragment.getRootView().getWidth();
@@ -133,6 +141,9 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
mFakeTaskViewRadius = 0;
mFakeTaskView.invalidateOutline();
mFakeTaskView.setVisibility(View.VISIBLE);
if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
mFakeTaskView.setBackgroundColor(getFakeTaskViewColor());
}
mFakeTaskView.setAlpha(1);
mFakePreviousTaskView.setVisibility(View.INVISIBLE);
mFakePreviousTaskView.setAlpha(1);
@@ -250,6 +261,17 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
// After home animation finishes, fade out and run onEndRunnable.
PendingAnimation fadeAnim = new PendingAnimation(300);
fadeAnim.setViewAlpha(mFakeIconView, 0, ACCEL);
final View hotseatIconView = mHotseatIconView;
if (hotseatIconView != null) {
hotseatIconView.setVisibility(INVISIBLE);
fadeAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
hotseatIconView.setVisibility(VISIBLE);
}
});
}
if (onEndRunnable != null) {
fadeAnim.addListener(AnimatorListeners.forSuccessCallback(onEndRunnable));
}
@@ -371,6 +393,12 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
false, /* isOpening */
mFakeIconView, mDp);
mFakeIconView.setAlpha(1);
if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
int iconColor = ColorUtils.blendARGB(
getFakeTaskViewColor(), getHotseatIconColor(), progress);
mFakeIconView.getBackground().setTint(iconColor);
mFakeTaskView.setBackgroundColor(iconColor);
}
mFakeTaskView.setAlpha(getWindowAlpha(progress));
mFakePreviousTaskView.setAlpha(getWindowAlpha(progress));
}

View File

@@ -742,11 +742,12 @@ abstract class TutorialController implements BackGestureAttemptCallback,
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
mExitingAppView.setBackgroundColor(getExitingAppColor());
mFakeTaskView.setBackgroundColor(getFakeTaskViewColor());
updateHotseatChildViewColor(mFakeIconView);
updateHotseatChildViewColor(mHotseatIconView);
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_2));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_3));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_4));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_5));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_6));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_search_bar));
} else {
updateFakeViewLayout(mFakeTaskView, getMockAppTaskLayoutResId());