Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +1 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ private fun NavBarAmbientCue( onClick = { if (actions.size == 1 && actions[0].oneTapEnabled) { scope.launch { delay(ONE_TAP_DELAY_MS) delay(actions[0].oneTapDelayMs) actions[0].onClick() } } else { Loading @@ -261,5 +261,3 @@ private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 16 private const val ACTIONS_HORIZONTAL_PADDING = 32 private const val ACTIONS_TOP_PADDING = 32 private const val ONE_TAP_DELAY_MS = 500L packages/SystemUI/src/com/android/systemui/ambientcue/data/repository/AmbientCueRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,11 @@ constructor( chip.extras?.getParcelable<ActivityId>(EXTRA_ACTIVITY_ID) val actionType = chip.extras?.getString(EXTRA_ACTION_TYPE) val oneTapEnabled = chip.extras?.getBoolean(EXTRA_ONE_TAP_ENABLED) val oneTapDelayMs = chip.extras?.getLong( EXTRA_ONE_TAP_DELAY_MS, DEFAULT_ONE_TAP_DELAY_MS, ) ActionModel( icon = IconModel( Loading Loading @@ -230,6 +235,7 @@ constructor( taskId = activityId?.taskId ?: INVALID_TASK_ID, actionType = actionType, oneTapEnabled = oneTapEnabled == true, oneTapDelayMs = oneTapDelayMs ?: DEFAULT_ONE_TAP_DELAY_MS, ) } if (DEBUG) { Loading Loading @@ -406,6 +412,8 @@ constructor( const val EXTRA_ATTRIBUTION_DIALOG_PENDING_INTENT = "attributionDialogPendingIntent" @VisibleForTesting const val EXTRA_ACTION_TYPE = "actionType" private const val EXTRA_ONE_TAP_ENABLED = "oneTapEnabled" private const val EXTRA_ONE_TAP_DELAY_MS = "oneTapDelayMs" private const val DEFAULT_ONE_TAP_DELAY_MS = 200L // Timeout to hide cuebar if it wasn't interacted with private const val TAG = "AmbientCueRepository" Loading packages/SystemUI/src/com/android/systemui/ambientcue/shared/model/ActionModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ data class ActionModel( val taskId: Int = INVALID_TASK_ID, val actionType: String? = null, val oneTapEnabled: Boolean = false, val oneTapDelayMs: Long = 0L, ) data class IconModel(val drawable: Drawable, val iconId: String) packages/SystemUI/src/com/android/systemui/ambientcue/ui/viewmodel/ActionViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ data class ActionViewModel( val onLongClick: () -> Unit, val actionType: ActionType, val oneTapEnabled: Boolean = false, val oneTapDelayMs: Long = 0L, ) enum class ActionType { Loading packages/SystemUI/src/com/android/systemui/ambientcue/ui/viewmodel/AmbientCueViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ constructor( else -> ActionType.Unknown }, oneTapEnabled = action.oneTapEnabled, oneTapDelayMs = action.oneTapDelayMs, ) } }, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +1 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ private fun NavBarAmbientCue( onClick = { if (actions.size == 1 && actions[0].oneTapEnabled) { scope.launch { delay(ONE_TAP_DELAY_MS) delay(actions[0].oneTapDelayMs) actions[0].onClick() } } else { Loading @@ -261,5 +261,3 @@ private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 16 private const val ACTIONS_HORIZONTAL_PADDING = 32 private const val ACTIONS_TOP_PADDING = 32 private const val ONE_TAP_DELAY_MS = 500L
packages/SystemUI/src/com/android/systemui/ambientcue/data/repository/AmbientCueRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,11 @@ constructor( chip.extras?.getParcelable<ActivityId>(EXTRA_ACTIVITY_ID) val actionType = chip.extras?.getString(EXTRA_ACTION_TYPE) val oneTapEnabled = chip.extras?.getBoolean(EXTRA_ONE_TAP_ENABLED) val oneTapDelayMs = chip.extras?.getLong( EXTRA_ONE_TAP_DELAY_MS, DEFAULT_ONE_TAP_DELAY_MS, ) ActionModel( icon = IconModel( Loading Loading @@ -230,6 +235,7 @@ constructor( taskId = activityId?.taskId ?: INVALID_TASK_ID, actionType = actionType, oneTapEnabled = oneTapEnabled == true, oneTapDelayMs = oneTapDelayMs ?: DEFAULT_ONE_TAP_DELAY_MS, ) } if (DEBUG) { Loading Loading @@ -406,6 +412,8 @@ constructor( const val EXTRA_ATTRIBUTION_DIALOG_PENDING_INTENT = "attributionDialogPendingIntent" @VisibleForTesting const val EXTRA_ACTION_TYPE = "actionType" private const val EXTRA_ONE_TAP_ENABLED = "oneTapEnabled" private const val EXTRA_ONE_TAP_DELAY_MS = "oneTapDelayMs" private const val DEFAULT_ONE_TAP_DELAY_MS = 200L // Timeout to hide cuebar if it wasn't interacted with private const val TAG = "AmbientCueRepository" Loading
packages/SystemUI/src/com/android/systemui/ambientcue/shared/model/ActionModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ data class ActionModel( val taskId: Int = INVALID_TASK_ID, val actionType: String? = null, val oneTapEnabled: Boolean = false, val oneTapDelayMs: Long = 0L, ) data class IconModel(val drawable: Drawable, val iconId: String)
packages/SystemUI/src/com/android/systemui/ambientcue/ui/viewmodel/ActionViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ data class ActionViewModel( val onLongClick: () -> Unit, val actionType: ActionType, val oneTapEnabled: Boolean = false, val oneTapDelayMs: Long = 0L, ) enum class ActionType { Loading
packages/SystemUI/src/com/android/systemui/ambientcue/ui/viewmodel/AmbientCueViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ constructor( else -> ActionType.Unknown }, oneTapEnabled = action.oneTapEnabled, oneTapDelayMs = action.oneTapDelayMs, ) } }, Loading