Updating overview tutorial to new simple tutorial flow
test: built and tested on multiple devices. recorded videos and shared in chat. bug: b/253520701, b/253521660, b/241813570 Change-Id: I57f88f5fb35c6a7b1219fac6e992bb84354b91ef
This commit is contained in:
1 parent
fad8c1c449
commit
1c0a27a28e
9 files changed
+142
-13
No files matched your search
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Android Open Source Project
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<View
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/overview_gesture_tutorial_shape"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:background="@color/gesture_overview_tutorial_background" />
|
||||
@@ -0,0 +1 @@
|
||||
{"v":"5.10.0","fr":60,"ip":0,"op":1622,"w":412,"h":892,"nm":"SUW_Overview","ddd":0,"assets":[{"id":"comp_0","nm":"Part03_Demonstration_Overview_V01","fr":60,"pfr":1,"layers":[{"ddd":0,"ind":2,"ty":3,"nm":"Reset to Center","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.58],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":292,"s":[321.599]},{"t":362,"s":[155.599]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.34],"y":[1]},"o":{"x":[0.66],"y":[0]},"t":292,"s":[758]},{"t":372,"s":[649]}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Void","np":20,"mn":"Pseudo/289611","ix":1,"en":1,"ef":[{"ty":0,"nm":"Width","mn":"Pseudo/289611-0001","ix":1,"v":{"a":0,"k":100,"ix":1}},{"ty":0,"nm":"Height","mn":"Pseudo/289611-0002","ix":2,"v":{"a":0,"k":100,"ix":2}},{"ty":0,"nm":"Offset X","mn":"Pseudo/289611-0003","ix":3,"v":{"a":0,"k":0,"ix":3}},{"ty":0,"nm":"Offset Y","mn":"Pseudo/289611-0004","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":6,"nm":"About","mn":"Pseudo/289611-0005","ix":5,"v":0},{"ty":6,"nm":"Plague of null layers.","mn":"Pseudo/289611-0006","ix":6,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0007","ix":7,"v":0},{"ty":6,"nm":"Following projects","mn":"Pseudo/289611-0008","ix":8,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0009","ix":9,"v":0},{"ty":6,"nm":"through time.","mn":"Pseudo/289611-0010","ix":10,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0011","ix":11,"v":0},{"ty":6,"nm":"Be free of the past.","mn":"Pseudo/289611-0012","ix":12,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0013","ix":13,"v":0},{"ty":6,"nm":"Void - 1.0.0","mn":"Pseudo/289611-0014","ix":14,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0015","ix":15,"v":0},{"ty":6,"nm":"© 2022 Battle Axe Inc","mn":"Pseudo/289611-0016","ix":16,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0017","ix":17,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0018","ix":18,"v":0}]}],"ip":0,"op":426,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":3,"ty":3,"nm":"OVERSHOOT CHARACTER","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.34],"y":[1]},"o":{"x":[0.66],"y":[0]},"t":227,"s":[-32.599]},{"t":329,"s":[7.401]}],"ix":3},"y":{"a":0,"k":0,"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Void","np":20,"mn":"Pseudo/289611","ix":1,"en":1,"ef":[{"ty":0,"nm":"Width","mn":"Pseudo/289611-0001","ix":1,"v":{"a":0,"k":100,"ix":1}},{"ty":0,"nm":"Height","mn":"Pseudo/289611-0002","ix":2,"v":{"a":0,"k":100,"ix":2}},{"ty":0,"nm":"Offset X","mn":"Pseudo/289611-0003","ix":3,"v":{"a":0,"k":0,"ix":3}},{"ty":0,"nm":"Offset Y","mn":"Pseudo/289611-0004","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":6,"nm":"About","mn":"Pseudo/289611-0005","ix":5,"v":0},{"ty":6,"nm":"Plague of null layers.","mn":"Pseudo/289611-0006","ix":6,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0007","ix":7,"v":0},{"ty":6,"nm":"Following projects","mn":"Pseudo/289611-0008","ix":8,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0009","ix":9,"v":0},{"ty":6,"nm":"through time.","mn":"Pseudo/289611-0010","ix":10,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0011","ix":11,"v":0},{"ty":6,"nm":"Be free of the past.","mn":"Pseudo/289611-0012","ix":12,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0013","ix":13,"v":0},{"ty":6,"nm":"Void - 1.0.0","mn":"Pseudo/289611-0014","ix":14,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0015","ix":15,"v":0},{"ty":6,"nm":"© 2022 Battle Axe Inc","mn":"Pseudo/289611-0016","ix":16,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0017","ix":17,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0018","ix":18,"v":0}]}],"ip":0,"op":426,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Text Matte","parent":3,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.999],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":-609,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":-599,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":549,"s":[100]},{"t":555,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.58],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":130,"s":[-83]},{"i":{"x":[0.999],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":197,"s":[-238]},{"i":{"x":[0.8],"y":[0.15]},"o":{"x":[0.3],"y":[0]},"t":227,"s":[-238]},{"i":{"x":[0.1],"y":[1]},"o":{"x":[0.05],"y":[0.7]},"t":237.666,"s":[-125.6]},{"t":291,"s":[43]}],"ix":3},"y":{"k":[{"s":[110.1],"t":53,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[109.629],"t":54,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[108.115],"t":55,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[105.387],"t":56,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[101.233],"t":57,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[95.393],"t":58,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[87.556],"t":59,"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"s":[77.356],"t":60,"i":{"x":[1],"y":[1]Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"v":"5.10.0","fr":60,"ip":0,"op":1652,"w":1280,"h":800,"nm":"SUW_Tablet_Overview_Preview","ddd":0,"assets":[{"id":"comp_0","nm":"Part01_Thumb_Tablet_Overview_V02","fr":60,"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"Tablet_PointerFinger_UpdatedDesign","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[640,400,0],"ix":2,"l":2},"a":{"a":0,"k":[640,400,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":25,"nm":"Elevation","np":8,"mn":"ADBE Drop Shadow","ix":1,"en":1,"ef":[{"ty":2,"nm":"Shadow Color","mn":"ADBE Drop Shadow-0001","ix":1,"v":{"a":0,"k":[0,0,0,0.25],"ix":1}},{"ty":0,"nm":"Opacity","mn":"ADBE Drop Shadow-0002","ix":2,"v":{"a":0,"k":63.75,"ix":2}},{"ty":0,"nm":"Direction","mn":"ADBE Drop Shadow-0003","ix":3,"v":{"a":0,"k":180,"ix":3}},{"ty":0,"nm":"Distance","mn":"ADBE Drop Shadow-0004","ix":4,"v":{"a":0,"k":4,"ix":4}},{"ty":0,"nm":"Softness","mn":"ADBE Drop Shadow-0005","ix":5,"v":{"a":0,"k":8,"ix":5}},{"ty":7,"nm":"Shadow Only","mn":"ADBE Drop Shadow-0006","ix":6,"v":{"a":0,"k":0,"ix":6}}]}],"w":1280,"h":800,"ip":290,"op":590,"st":290,"bm":0},{"ddd":0,"ind":2,"ty":3,"nm":"HAND REPO","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[950,344,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Size","np":3,"mn":"ADBE Point Control","ix":1,"en":1,"ef":[{"ty":3,"nm":"Point","mn":"ADBE Point Control-0001","ix":1,"v":{"a":0,"k":[100,100],"ix":1}}]}],"ip":0,"op":1800,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":3,"nm":"OVERSHOOT THUMB","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.8],"y":[0.15]},"o":{"x":[0.3],"y":[0]},"t":246,"s":[83]},{"i":{"x":[0.1],"y":[1]},"o":{"x":[0.05],"y":[0.7]},"t":263,"s":[163]},{"t":348,"s":[283]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.999],"y":[1]},"o":{"x":[0.42],"y":[0]},"t":246,"s":[322]},{"t":295,"s":[386]}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Void","np":20,"mn":"Pseudo/289611","ix":1,"en":1,"ef":[{"ty":0,"nm":"Width","mn":"Pseudo/289611-0001","ix":1,"v":{"a":0,"k":100,"ix":1}},{"ty":0,"nm":"Height","mn":"Pseudo/289611-0002","ix":2,"v":{"a":0,"k":100,"ix":2}},{"ty":0,"nm":"Offset X","mn":"Pseudo/289611-0003","ix":3,"v":{"a":0,"k":0,"ix":3}},{"ty":0,"nm":"Offset Y","mn":"Pseudo/289611-0004","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":6,"nm":"About","mn":"Pseudo/289611-0005","ix":5,"v":0},{"ty":6,"nm":"Plague of null layers.","mn":"Pseudo/289611-0006","ix":6,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0007","ix":7,"v":0},{"ty":6,"nm":"Following projects","mn":"Pseudo/289611-0008","ix":8,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0009","ix":9,"v":0},{"ty":6,"nm":"through time.","mn":"Pseudo/289611-0010","ix":10,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0011","ix":11,"v":0},{"ty":6,"nm":"Be free of the past.","mn":"Pseudo/289611-0012","ix":12,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0013","ix":13,"v":0},{"ty":6,"nm":"Void - 1.0.0","mn":"Pseudo/289611-0014","ix":14,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0015","ix":15,"v":0},{"ty":6,"nm":"© 2022 Battle Axe Inc","mn":"Pseudo/289611-0016","ix":16,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0017","ix":17,"v":0},{"ty":6,"nm":"Void","mn":"Pseudo/289611-0018","ix":18,"v":0}]}],"ip":0,"op":426,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":6,"ty":3,"nm":"HAND NULL","parent":4,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.39],"y":[1]},"o":{"x":[0.59],"y":[0]},"t":3,"s":[10]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.15],"y":[0]},"t":59,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.6],"y":[0]},"t":95,"s":[-3]},{"i":{"x":[0.15],"y":[1]},"o":{"x":[0.37],"y":[0]},"t":122,"s":[-4]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.166],"y":[0]},"t":170,"s":[15]},{"i":{"x":[0.6],"y":[1]},"o":{"x":[0.5],"y":[0]},"t":201,"s":[15]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":231,"s":[12]},{"i":{"x":[0.22],"y":[0.993]},"o":{"x":[0.41],"y":[0]},"t":246,"s":[15.59]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":290,"s":[40]},{"t":321,"s":[40]}],"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.2],"y":[1]},"o":{"x":[0.06],"y":[0.36]},"t":0,"s":[260]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":73,"s":[123]},{"i":{"x":[0.6],"y":[1]},"o":{"x":[0.5],"y":[0]},"t":201,"s":[123]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":231,"s":[70]},{"i":{"x":[0.8],"y":[0.15]},"o":{"x":[0.3],"y":[0]},"t":246,"s":[70]},{"i":{"x":[0.1],"y":[1]},"o":{"x":[0.05],"y":[0.7]},"t":264.166,"s":[154.8]},{"t":355,"s":[282]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.194],"y":[0]},"t":0,"s":[273.366]},{"i":{"x":[0.2],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":63,"s":[162]},{"i":{"x":[0.15],"y":[1]},"o":{"x":[0.37],"y":[0]},"t":122,"s":[162]},{"i":{"x":Line truncated
|
||||
@@ -47,7 +47,9 @@
|
||||
<color name="gesture_home_tutorial_swipe_up_rect">#3857C7</color>
|
||||
<color name="gesture_back_tutorial_exiting_app">#F3A5B9</color>
|
||||
<color name="gesture_back_tutorial_background">#3857C7</color>
|
||||
<color name="gesture_overview_tutorial_background">#E2F3AF</color>
|
||||
<color name="gesture_overview_tutorial_swipe_rect">#7E44AD</color>
|
||||
<color name="gesture_overview_background">#BFC8CB</color>
|
||||
|
||||
<!-- Mock hotseat -->
|
||||
<color name="mock_app_icon">#BDC1C6</color>
|
||||
|
||||
@@ -156,6 +156,8 @@
|
||||
<string name="overview_gesture_intro_subtitle">To switch between apps, swipe up from the bottom of your screen, hold, then release.</string>
|
||||
<!-- Introduction subtitle for the Overview gesture tutorial that will be spoken by screen readers. [CHAR LIMIT=100] -->
|
||||
<string name="overview_gesture_spoken_intro_subtitle">To switch between apps, swipe up with 2 fingers from the bottom of your screen, hold, then release.</string>
|
||||
<!-- Title of the gesture tutorial section educating users on how to switch between apps. [CHAR LIMIT=100] -->
|
||||
<string name="overview_gesture_tutorial_title">Switch apps</string>
|
||||
|
||||
<!-- Title shown during interactive part of Assistant gesture tutorial. [CHAR LIMIT=30] -->
|
||||
<string name="assistant_gesture_tutorial_playground_title" translatable="false">Tutorial: Assistant</string>
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.quickstep.interaction;
|
||||
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -22,11 +24,16 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.ColorInt;
|
||||
import android.content.Context;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.ViewAnimator;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -85,6 +92,45 @@ public class AnimatedTaskView extends ConstraintLayout {
|
||||
setToSingleRowLayout(false);
|
||||
}
|
||||
|
||||
void animateToFillScreen(@Nullable Runnable onAnimationEndCallback) {
|
||||
|
||||
AnimatorSet set = new AnimatorSet();
|
||||
ArrayList<Animator> animations = new ArrayList<>();
|
||||
|
||||
// center view
|
||||
animations.add(ObjectAnimator.ofFloat(this, TRANSLATION_X, 0));
|
||||
|
||||
// calculate full screen scaling, scale should be 1:1 for x and y
|
||||
Matrix matrix = getAnimationMatrix();
|
||||
float[] matrixValues = new float[9];
|
||||
matrix.getValues(matrixValues);
|
||||
float scaleX = matrixValues[Matrix.MSCALE_X];
|
||||
float scaleToFullScreen = 1 / scaleX;
|
||||
|
||||
// scale view to full screen
|
||||
ValueAnimator scale = ValueAnimator.ofFloat(1f, scaleToFullScreen);
|
||||
scale.addUpdateListener(animation -> {
|
||||
float value = (float) animation.getAnimatedValue();
|
||||
mFullTaskView.setScaleX(value);
|
||||
mFullTaskView.setScaleY(value);
|
||||
});
|
||||
|
||||
animations.add(scale);
|
||||
set.playSequentially(animations);
|
||||
|
||||
set.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
super.onAnimationEnd(animation);
|
||||
if (onAnimationEndCallback != null) {
|
||||
onAnimationEndCallback.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
set.start();
|
||||
}
|
||||
|
||||
AnimatorSet createAnimationToMultiRowLayout() {
|
||||
if (mTaskViewOutlineProvider == null) {
|
||||
// This is an illegal state.
|
||||
@@ -184,6 +230,11 @@ public class AnimatedTaskView extends ConstraintLayout {
|
||||
|
||||
void setFakeTaskViewFillColor(@ColorInt int colorResId) {
|
||||
mFullTaskView.setBackgroundColor(colorResId);
|
||||
|
||||
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()){
|
||||
mTopTaskView.getBackground().setTint(colorResId);
|
||||
mBottomTaskView.getBackground().setTint(colorResId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+62
-11
@@ -16,12 +16,17 @@
|
||||
package com.android.quickstep.interaction;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.TargetApi;
|
||||
import android.graphics.PointF;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.anim.AnimatedFloat;
|
||||
@@ -40,10 +45,11 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
TutorialType tutorialType) {
|
||||
super(fragment, tutorialType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntroductionTitle() {
|
||||
return R.string.overview_gesture_intro_title;
|
||||
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
|
||||
? R.string.overview_gesture_tutorial_title
|
||||
: R.string.overview_gesture_intro_title;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,19 +71,29 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
|
||||
@Override
|
||||
protected int getMockAppTaskLayoutResId() {
|
||||
return mTutorialFragment.isLargeScreen()
|
||||
? R.layout.gesture_tutorial_tablet_mock_conversation_list
|
||||
: R.layout.gesture_tutorial_mock_conversation_list;
|
||||
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
|
||||
? R.layout.gesture_tutorial_mock_task_view
|
||||
: mTutorialFragment.isLargeScreen()
|
||||
? R.layout.gesture_tutorial_tablet_mock_conversation_list
|
||||
: R.layout.gesture_tutorial_mock_conversation_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGestureLottieAnimationId() {
|
||||
// TODO(b/253521660): Change to correct LottieAnimationView
|
||||
return R.raw.home_gesture_tutorial_animation;
|
||||
return mTutorialFragment.isLargeScreen()
|
||||
? R.raw.overview_gesture_tutorial_tablet_animation
|
||||
: R.raw.overview_gesture_tutorial_animation;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getSwipeActionColorResId() {
|
||||
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
|
||||
? R.color.gesture_overview_background
|
||||
: R.color.gesture_overview_tutorial_swipe_rect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMockPreviousAppTaskThumbnailColorResId() {
|
||||
return R.color.gesture_overview_tutorial_swipe_rect;
|
||||
}
|
||||
|
||||
@@ -127,9 +143,31 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
break;
|
||||
case OVERVIEW_GESTURE_COMPLETED:
|
||||
mTutorialFragment.releaseFeedbackAnimation();
|
||||
animateTaskViewToOverview();
|
||||
onMotionPaused(true /*arbitrary value*/);
|
||||
showSuccessFeedback();
|
||||
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
|
||||
onMotionPaused(true /*arbitrary value*/);
|
||||
animateTaskViewToOverview(() -> {
|
||||
mFakeTaskView.setVisibility(View.INVISIBLE);
|
||||
if(!mTutorialFragment.isLargeScreen()){
|
||||
mFakePreviousTaskView.animateToFillScreen(() -> {
|
||||
mFakeLauncherView.setBackgroundColor(
|
||||
mContext.getColor(
|
||||
R.color.gesture_overview_tutorial_swipe_rect
|
||||
));
|
||||
showSuccessFeedback();
|
||||
});
|
||||
} else {
|
||||
mFakeLauncherView.setBackgroundColor(
|
||||
mContext.getColor(
|
||||
R.color.gesture_overview_tutorial_swipe_rect
|
||||
));
|
||||
showSuccessFeedback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
animateTaskViewToOverview(null);
|
||||
onMotionPaused(true /*arbitrary value*/);
|
||||
showSuccessFeedback();
|
||||
}
|
||||
break;
|
||||
case HOME_OR_OVERVIEW_NOT_STARTED_WRONG_SWIPE_DIRECTION:
|
||||
case HOME_OR_OVERVIEW_CANCELLED:
|
||||
@@ -146,11 +184,24 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
}
|
||||
}
|
||||
|
||||
public void animateTaskViewToOverview() {
|
||||
/**
|
||||
* runnable executed with slight delay to ease the swipe animation after landing on overview
|
||||
* @param runnable
|
||||
*/
|
||||
public void animateTaskViewToOverview(@Nullable Runnable runnable) {
|
||||
PendingAnimation anim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS);
|
||||
anim.setFloat(mTaskViewSwipeUpAnimation
|
||||
.getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL);
|
||||
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
if (runnable != null) {
|
||||
new Handler().postDelayed(runnable, 300);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ArrayList<Animator> animators = new ArrayList<>();
|
||||
|
||||
if (mTutorialFragment.isLargeScreen()) {
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public class OverviewGestureTutorialFragment extends TutorialFragment {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
super.onAnimationStart(animation);
|
||||
controller.animateTaskViewToOverview();
|
||||
controller.animateTaskViewToOverview(null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -678,7 +678,8 @@ abstract class TutorialController implements BackGestureAttemptCallback,
|
||||
? R.dimen.gesture_tutorial_tablet_feedback_margin_top
|
||||
: R.dimen.gesture_tutorial_feedback_margin_top);
|
||||
|
||||
mFakeTaskbarView.setVisibility(mTutorialFragment.isLargeScreen() ? View.VISIBLE : GONE);
|
||||
mFakeTaskbarView.setVisibility((mTutorialFragment.isLargeScreen()
|
||||
&& !ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) ? View.VISIBLE : GONE);
|
||||
|
||||
RelativeLayout.LayoutParams hotseatLayoutParams =
|
||||
(RelativeLayout.LayoutParams) mFakeHotseatView.getLayoutParams();
|
||||
|
||||
Reference in new issue
Block a user