Loading quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt +16 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.MATCH_PARENT import android.view.animation.Interpolator import android.window.OnBackInvokedDispatcher import androidx.core.view.updateLayoutParams import com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE import com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE Loading Loading @@ -66,11 +67,14 @@ constructor( /** Container where the tooltip's body should be inflated. */ lateinit var content: ViewGroup private set private lateinit var arrow: View /** Callback invoked when the tooltip is being closed. */ var onCloseCallback: () -> Unit = {} private var openCloseAnimator: AnimatorSet? = null /** Used to set whether users can tap outside the current tooltip window to dismiss it */ var allowTouchDismissal = true /** Animates the tooltip into view. */ fun show() { Loading Loading @@ -134,14 +138,25 @@ constructor( override fun isOfType(type: Int): Boolean = type and TYPE_TASKBAR_EDUCATION_DIALOG != 0 override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean { if (ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev)) { if ( ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev) && allowTouchDismissal ) { close(true) } return false } override fun onAttachedToWindow() { super.onAttachedToWindow() findOnBackInvokedDispatcher() ?.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() findOnBackInvokedDispatcher()?.unregisterOnBackInvokedCallback(this) Settings.Secure.putInt(mContext.contentResolver, LAUNCHER_TASKBAR_EDUCATION_SHOWING, 0) } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -86,10 +86,13 @@ open class TaskbarEduTooltipController(context: Context) : !activityContext.isPhoneMode && !activityContext.isTinyTaskbar } private val isOpen: Boolean get() = tooltip?.isOpen ?: false val isBeforeTooltipFeaturesStep: Boolean get() = isTooltipEnabled && tooltipStep <= TOOLTIP_STEP_FEATURES private lateinit var controllers: TaskbarControllers // Keep track of whether the user has seen the Search Edu Loading Loading @@ -152,6 +155,7 @@ open class TaskbarEduTooltipController(context: Context) : tooltipStep = TOOLTIP_STEP_NONE inflateTooltip(R.layout.taskbar_edu_features) tooltip?.run { allowTouchDismissal = false val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation) val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation) val pinningAnim = requireViewById<LottieAnimationView>(R.id.pinning_animation) Loading Loading @@ -216,6 +220,7 @@ open class TaskbarEduTooltipController(context: Context) : inflateTooltip(R.layout.taskbar_edu_pinning) tooltip?.run { allowTouchDismissal = true requireViewById<LottieAnimationView>(R.id.standalone_pinning_animation) .supportLightTheme() Loading Loading @@ -260,6 +265,7 @@ open class TaskbarEduTooltipController(context: Context) : userHasSeenSearchEdu = true inflateTooltip(R.layout.taskbar_edu_search) tooltip?.run { allowTouchDismissal = true requireViewById<LottieAnimationView>(R.id.search_edu_animation).supportLightTheme() val eduSubtitle: TextView = requireViewById(R.id.search_edu_text) showDisclosureText(eduSubtitle) Loading Loading @@ -332,7 +338,9 @@ open class TaskbarEduTooltipController(context: Context) : } /** Closes the current [tooltip]. */ fun hide() = tooltip?.close(true) fun hide() { tooltip?.close(true) } /** Initializes [tooltip] with content from [contentResId]. */ private fun inflateTooltip(@LayoutRes contentResId: Int) { Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltip.kt +16 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.MATCH_PARENT import android.view.animation.Interpolator import android.window.OnBackInvokedDispatcher import androidx.core.view.updateLayoutParams import com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE import com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE Loading Loading @@ -66,11 +67,14 @@ constructor( /** Container where the tooltip's body should be inflated. */ lateinit var content: ViewGroup private set private lateinit var arrow: View /** Callback invoked when the tooltip is being closed. */ var onCloseCallback: () -> Unit = {} private var openCloseAnimator: AnimatorSet? = null /** Used to set whether users can tap outside the current tooltip window to dismiss it */ var allowTouchDismissal = true /** Animates the tooltip into view. */ fun show() { Loading Loading @@ -134,14 +138,25 @@ constructor( override fun isOfType(type: Int): Boolean = type and TYPE_TASKBAR_EDUCATION_DIALOG != 0 override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean { if (ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev)) { if ( ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev) && allowTouchDismissal ) { close(true) } return false } override fun onAttachedToWindow() { super.onAttachedToWindow() findOnBackInvokedDispatcher() ?.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() findOnBackInvokedDispatcher()?.unregisterOnBackInvokedCallback(this) Settings.Secure.putInt(mContext.contentResolver, LAUNCHER_TASKBAR_EDUCATION_SHOWING, 0) } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarEduTooltipController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -86,10 +86,13 @@ open class TaskbarEduTooltipController(context: Context) : !activityContext.isPhoneMode && !activityContext.isTinyTaskbar } private val isOpen: Boolean get() = tooltip?.isOpen ?: false val isBeforeTooltipFeaturesStep: Boolean get() = isTooltipEnabled && tooltipStep <= TOOLTIP_STEP_FEATURES private lateinit var controllers: TaskbarControllers // Keep track of whether the user has seen the Search Edu Loading Loading @@ -152,6 +155,7 @@ open class TaskbarEduTooltipController(context: Context) : tooltipStep = TOOLTIP_STEP_NONE inflateTooltip(R.layout.taskbar_edu_features) tooltip?.run { allowTouchDismissal = false val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation) val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation) val pinningAnim = requireViewById<LottieAnimationView>(R.id.pinning_animation) Loading Loading @@ -216,6 +220,7 @@ open class TaskbarEduTooltipController(context: Context) : inflateTooltip(R.layout.taskbar_edu_pinning) tooltip?.run { allowTouchDismissal = true requireViewById<LottieAnimationView>(R.id.standalone_pinning_animation) .supportLightTheme() Loading Loading @@ -260,6 +265,7 @@ open class TaskbarEduTooltipController(context: Context) : userHasSeenSearchEdu = true inflateTooltip(R.layout.taskbar_edu_search) tooltip?.run { allowTouchDismissal = true requireViewById<LottieAnimationView>(R.id.search_edu_animation).supportLightTheme() val eduSubtitle: TextView = requireViewById(R.id.search_edu_text) showDisclosureText(eduSubtitle) Loading Loading @@ -332,7 +338,9 @@ open class TaskbarEduTooltipController(context: Context) : } /** Closes the current [tooltip]. */ fun hide() = tooltip?.close(true) fun hide() { tooltip?.close(true) } /** Initializes [tooltip] with content from [contentResId]. */ private fun inflateTooltip(@LayoutRes contentResId: Int) { Loading