Loading quickstep/src/com/android/quickstep/interaction/TutorialFragment.java +24 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.quickstep.interaction.GestureSandboxActivity.KEY_USE_T import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Insets; Loading Loading @@ -86,6 +87,8 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc private boolean mIsFoldable; private boolean mOnAttachedToWindowPendingCreate; @Nullable private Runnable mOnAttachedOnGlobalLayoutCallback = null; public static TutorialFragment newInstance( TutorialType tutorialType, boolean gestureComplete, boolean fromTutorialMenu) { TutorialFragment fragment = getFragmentForTutorialType(tutorialType, fromTutorialMenu); Loading Loading @@ -349,13 +352,27 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { changeController(mTutorialType); runOnAttached(() -> changeController(mTutorialType)); mRootView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); } } private void runOnAttached(Runnable callback) { mOnAttachedOnGlobalLayoutCallback = callback; if (getContext() != null) { onAttached(); } } private void onAttached() { if (mOnAttachedOnGlobalLayoutCallback != null) { mOnAttachedOnGlobalLayoutCallback.run(); mOnAttachedOnGlobalLayoutCallback = null; } } @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (mTutorialController != null && !isGestureComplete()) { Loading @@ -377,6 +394,12 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc | mNavBarGestureHandler.onInterceptTouch(motionEvent); } @Override public void onAttach(@NonNull Context context) { super.onAttach(context); onAttached(); } @Override void onAttachedToWindow() { if (mEdgeBackGestureHandler == null) { Loading Loading
quickstep/src/com/android/quickstep/interaction/TutorialFragment.java +24 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.quickstep.interaction.GestureSandboxActivity.KEY_USE_T import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Insets; Loading Loading @@ -86,6 +87,8 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc private boolean mIsFoldable; private boolean mOnAttachedToWindowPendingCreate; @Nullable private Runnable mOnAttachedOnGlobalLayoutCallback = null; public static TutorialFragment newInstance( TutorialType tutorialType, boolean gestureComplete, boolean fromTutorialMenu) { TutorialFragment fragment = getFragmentForTutorialType(tutorialType, fromTutorialMenu); Loading Loading @@ -349,13 +352,27 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { changeController(mTutorialType); runOnAttached(() -> changeController(mTutorialType)); mRootView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); } } private void runOnAttached(Runnable callback) { mOnAttachedOnGlobalLayoutCallback = callback; if (getContext() != null) { onAttached(); } } private void onAttached() { if (mOnAttachedOnGlobalLayoutCallback != null) { mOnAttachedOnGlobalLayoutCallback.run(); mOnAttachedOnGlobalLayoutCallback = null; } } @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (mTutorialController != null && !isGestureComplete()) { Loading @@ -377,6 +394,12 @@ abstract class TutorialFragment extends GestureSandboxFragment implements OnTouc | mNavBarGestureHandler.onInterceptTouch(motionEvent); } @Override public void onAttach(@NonNull Context context) { super.onAttach(context); onAttached(); } @Override void onAttachedToWindow() { if (mEdgeBackGestureHandler == null) { Loading