Merge "Add taskbar pinning education for new users and update other steps" into main

This commit is contained in:
Saumya Prakash
2023-11-30 20:08:13 +00:00
committed by Android (Google) Code Review
12 changed files with 48 additions and 32 deletions
@@ -29,6 +29,7 @@ import androidx.core.view.updateLayoutParams
import com.airbnb.lottie.LottieAnimationView
import com.android.launcher3.R
import com.android.launcher3.Utilities
import com.android.launcher3.config.FeatureFlags.enableTaskbarPinningEdu
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_EDU_OPEN
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
import com.android.launcher3.taskbar.TaskbarManager.isPhoneMode
@@ -41,16 +42,19 @@ import java.io.PrintWriter
const val TOOLTIP_STEP_SWIPE = 0
/** Second EDU step for explaining Taskbar functionality when unstashed. */
const val TOOLTIP_STEP_FEATURES = 1
/** Third EDU step for explaining Taskbar pinning. */
const val TOOLTIP_STEP_PINNING = 2
/**
* EDU is completed.
*
* This value should match the maximum count for [TASKBAR_EDU_TOOLTIP_STEP].
*/
const val TOOLTIP_STEP_NONE = 2
const val TOOLTIP_STEP_NONE = 3
/** Current step in the tooltip EDU flow. */
@Retention(AnnotationRetention.SOURCE)
@IntDef(TOOLTIP_STEP_SWIPE, TOOLTIP_STEP_FEATURES, TOOLTIP_STEP_NONE)
@IntDef(TOOLTIP_STEP_SWIPE, TOOLTIP_STEP_FEATURES, TOOLTIP_STEP_PINNING, TOOLTIP_STEP_NONE)
annotation class TaskbarEduTooltipStep
/** Controls stepping through the Taskbar tooltip EDU. */
@@ -114,19 +118,19 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
tooltip?.run {
val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation)
val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation)
val settingsAnim = requireViewById<LottieAnimationView>(R.id.settings_animation)
val settingsEdu = requireViewById<View>(R.id.settings_edu)
val pinningAnim = requireViewById<LottieAnimationView>(R.id.pinning_animation)
val pinningEdu = requireViewById<View>(R.id.pinning_edu)
splitscreenAnim.supportLightTheme()
suggestionsAnim.supportLightTheme()
settingsAnim.supportLightTheme()
pinningAnim.supportLightTheme()
if (DisplayController.isTransientTaskbar(activityContext)) {
splitscreenAnim.setAnimation(R.raw.taskbar_edu_splitscreen_transient)
suggestionsAnim.setAnimation(R.raw.taskbar_edu_suggestions_transient)
settingsEdu.visibility = GONE
pinningEdu.visibility = if (enableTaskbarPinningEdu()) VISIBLE else GONE
} else {
splitscreenAnim.setAnimation(R.raw.taskbar_edu_splitscreen_persistent)
suggestionsAnim.setAnimation(R.raw.taskbar_edu_suggestions_persistent)
settingsEdu.visibility = VISIBLE
pinningEdu.visibility = GONE
}
// Set up layout parameters.
@@ -135,13 +139,16 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
if (DisplayController.isTransientTaskbar(activityContext)) {
width =
resources.getDimensionPixelSize(
R.dimen.taskbar_edu_features_tooltip_width_transient
if (enableTaskbarPinningEdu())
R.dimen.taskbar_edu_features_tooltip_width_with_three_features
else R.dimen.taskbar_edu_features_tooltip_width_with_two_features
)
bottomMargin += activityContext.deviceProfile.taskbarHeight
} else {
width =
resources.getDimensionPixelSize(
R.dimen.taskbar_edu_features_tooltip_width_persistent
R.dimen.taskbar_edu_features_tooltip_width_with_two_features
)
}
}