Loading packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +0 −12 Original line number Diff line number Diff line Loading @@ -21,16 +21,13 @@ import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.scene.data.repository.SceneContainerRepository import com.android.systemui.scene.shared.logger.SceneLogger import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn Loading Loading @@ -109,10 +106,6 @@ constructor( /** Whether the scene container is visible. */ val isVisible: StateFlow<Boolean> = repository.isVisible private val _remoteUserInput: MutableStateFlow<RemoteUserInput?> = MutableStateFlow(null) /** A flow of motion events originating from outside of the scene framework. */ val remoteUserInput: StateFlow<RemoteUserInput?> = _remoteUserInput.asStateFlow() /** * Returns the keys of all scenes in the container. * Loading Loading @@ -160,11 +153,6 @@ constructor( repository.setTransitionState(transitionState) } /** Handles a remote user input. */ fun onRemoteUserInput(input: RemoteUserInput) { _remoteUserInput.value = input } /** * Notifies that the UI has transitioned sufficiently to the given scene. * Loading packages/SystemUI/src/com/android/systemui/scene/shared/model/RemoteUserInput.ktdeleted 100644 → 0 +0 −35 Original line number Diff line number Diff line package com.android.systemui.scene.shared.model import android.view.MotionEvent /** A representation of user input that is used by the scene framework. */ data class RemoteUserInput( val x: Float, val y: Float, val action: RemoteUserInputAction, ) { companion object { fun translateMotionEvent(event: MotionEvent): RemoteUserInput { return RemoteUserInput( x = event.x, y = event.y, action = when (event.actionMasked) { MotionEvent.ACTION_DOWN -> RemoteUserInputAction.DOWN MotionEvent.ACTION_MOVE -> RemoteUserInputAction.MOVE MotionEvent.ACTION_UP -> RemoteUserInputAction.UP MotionEvent.ACTION_CANCEL -> RemoteUserInputAction.CANCEL else -> RemoteUserInputAction.UNKNOWN } ) } } } enum class RemoteUserInputAction { DOWN, MOVE, UP, CANCEL, UNKNOWN, } packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt +0 −9 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.systemui.scene.ui.view import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.view.View import com.android.systemui.scene.shared.model.Scene import com.android.systemui.scene.shared.model.SceneContainerConfig Loading Loading @@ -39,14 +38,6 @@ class SceneWindowRootView( ) } override fun onTouchEvent(event: MotionEvent?): Boolean { return event?.let { viewModel.onRemoteUserInput(event) true } ?: false } override fun setVisibility(visibility: Int) { // Do nothing. We don't want external callers to invoke this. Instead, we drive our own // visibility from our view-binder. Loading packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt +0 −10 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ package com.android.systemui.scene.ui.viewmodel import android.view.MotionEvent import com.android.systemui.dagger.SysUISingleton import com.android.systemui.scene.domain.interactor.SceneInteractor import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel import javax.inject.Inject Loading @@ -34,9 +32,6 @@ class SceneContainerViewModel constructor( private val interactor: SceneInteractor, ) { /** A flow of motion events originating from outside of the scene framework. */ val remoteUserInput: StateFlow<RemoteUserInput?> = interactor.remoteUserInput /** * Keys of all scenes in the container. * Loading Loading @@ -68,11 +63,6 @@ constructor( interactor.setTransitionState(transitionState) } /** Handles a [MotionEvent] representing remote user input. */ fun onRemoteUserInput(event: MotionEvent) { interactor.onRemoteUserInput(RemoteUserInput.translateMotionEvent(event)) } companion object { private const val SCENE_TRANSITION_LOGGING_REASON = "user input" } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +8 −11 Original line number Diff line number Diff line Loading @@ -28,8 +28,7 @@ import com.android.systemui.Gefingerpoken import com.android.systemui.R import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.scene.domain.interactor.SceneInteractor import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.ui.view.WindowRootView import com.android.systemui.shade.ShadeController import com.android.systemui.shade.ShadeLogger import com.android.systemui.shade.ShadeViewController Loading @@ -56,7 +55,7 @@ class PhoneStatusBarViewController private constructor( private val centralSurfaces: CentralSurfaces, private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val sceneInteractor: Provider<SceneInteractor>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?, private val userChipViewModel: StatusBarUserChipViewModel, Loading @@ -80,7 +79,8 @@ class PhoneStatusBarViewController private constructor( statusOverlayHoverListenerFactory.createDarkAwareListener(statusContainer)) if (moveFromCenterAnimationController == null) return val statusBarLeftSide: View = mView.requireViewById(R.id.status_bar_start_side_except_heads_up) val statusBarLeftSide: View = mView.requireViewById(R.id.status_bar_start_side_except_heads_up) val systemIconArea: ViewGroup = mView.requireViewById(R.id.status_bar_end_side_content) val viewsToAnimate = arrayOf( Loading Loading @@ -179,11 +179,8 @@ class PhoneStatusBarViewController private constructor( // If scene framework is enabled, route the touch to it and // ignore the rest of the gesture. if (featureFlags.isEnabled(Flags.SCENE_CONTAINER)) { sceneInteractor.get() .onRemoteUserInput(RemoteUserInput.translateMotionEvent(event)) // TODO(b/291965119): remove once view is expanded to cover the status bar sceneInteractor.get().setVisible(true, "swipe down from status bar") return false windowRootView.get().dispatchTouchEvent(event) return true } if (event.action == MotionEvent.ACTION_DOWN) { Loading Loading @@ -247,7 +244,7 @@ class PhoneStatusBarViewController private constructor( private val centralSurfaces: CentralSurfaces, private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val sceneInteractor: Provider<SceneInteractor>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val viewUtil: ViewUtil, private val configurationController: ConfigurationController, Loading @@ -269,7 +266,7 @@ class PhoneStatusBarViewController private constructor( centralSurfaces, shadeController, shadeViewController, sceneInteractor, windowRootView, shadeLogger, statusBarMoveFromCenterAnimationController, userChipViewModel, Loading Loading
packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +0 −12 Original line number Diff line number Diff line Loading @@ -21,16 +21,13 @@ import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.scene.data.repository.SceneContainerRepository import com.android.systemui.scene.shared.logger.SceneLogger import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn Loading Loading @@ -109,10 +106,6 @@ constructor( /** Whether the scene container is visible. */ val isVisible: StateFlow<Boolean> = repository.isVisible private val _remoteUserInput: MutableStateFlow<RemoteUserInput?> = MutableStateFlow(null) /** A flow of motion events originating from outside of the scene framework. */ val remoteUserInput: StateFlow<RemoteUserInput?> = _remoteUserInput.asStateFlow() /** * Returns the keys of all scenes in the container. * Loading Loading @@ -160,11 +153,6 @@ constructor( repository.setTransitionState(transitionState) } /** Handles a remote user input. */ fun onRemoteUserInput(input: RemoteUserInput) { _remoteUserInput.value = input } /** * Notifies that the UI has transitioned sufficiently to the given scene. * Loading
packages/SystemUI/src/com/android/systemui/scene/shared/model/RemoteUserInput.ktdeleted 100644 → 0 +0 −35 Original line number Diff line number Diff line package com.android.systemui.scene.shared.model import android.view.MotionEvent /** A representation of user input that is used by the scene framework. */ data class RemoteUserInput( val x: Float, val y: Float, val action: RemoteUserInputAction, ) { companion object { fun translateMotionEvent(event: MotionEvent): RemoteUserInput { return RemoteUserInput( x = event.x, y = event.y, action = when (event.actionMasked) { MotionEvent.ACTION_DOWN -> RemoteUserInputAction.DOWN MotionEvent.ACTION_MOVE -> RemoteUserInputAction.MOVE MotionEvent.ACTION_UP -> RemoteUserInputAction.UP MotionEvent.ACTION_CANCEL -> RemoteUserInputAction.CANCEL else -> RemoteUserInputAction.UNKNOWN } ) } } } enum class RemoteUserInputAction { DOWN, MOVE, UP, CANCEL, UNKNOWN, }
packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt +0 −9 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.systemui.scene.ui.view import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.view.View import com.android.systemui.scene.shared.model.Scene import com.android.systemui.scene.shared.model.SceneContainerConfig Loading Loading @@ -39,14 +38,6 @@ class SceneWindowRootView( ) } override fun onTouchEvent(event: MotionEvent?): Boolean { return event?.let { viewModel.onRemoteUserInput(event) true } ?: false } override fun setVisibility(visibility: Int) { // Do nothing. We don't want external callers to invoke this. Instead, we drive our own // visibility from our view-binder. Loading
packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt +0 −10 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ package com.android.systemui.scene.ui.viewmodel import android.view.MotionEvent import com.android.systemui.dagger.SysUISingleton import com.android.systemui.scene.domain.interactor.SceneInteractor import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel import javax.inject.Inject Loading @@ -34,9 +32,6 @@ class SceneContainerViewModel constructor( private val interactor: SceneInteractor, ) { /** A flow of motion events originating from outside of the scene framework. */ val remoteUserInput: StateFlow<RemoteUserInput?> = interactor.remoteUserInput /** * Keys of all scenes in the container. * Loading Loading @@ -68,11 +63,6 @@ constructor( interactor.setTransitionState(transitionState) } /** Handles a [MotionEvent] representing remote user input. */ fun onRemoteUserInput(event: MotionEvent) { interactor.onRemoteUserInput(RemoteUserInput.translateMotionEvent(event)) } companion object { private const val SCENE_TRANSITION_LOGGING_REASON = "user input" } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +8 −11 Original line number Diff line number Diff line Loading @@ -28,8 +28,7 @@ import com.android.systemui.Gefingerpoken import com.android.systemui.R import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.scene.domain.interactor.SceneInteractor import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.ui.view.WindowRootView import com.android.systemui.shade.ShadeController import com.android.systemui.shade.ShadeLogger import com.android.systemui.shade.ShadeViewController Loading @@ -56,7 +55,7 @@ class PhoneStatusBarViewController private constructor( private val centralSurfaces: CentralSurfaces, private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val sceneInteractor: Provider<SceneInteractor>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?, private val userChipViewModel: StatusBarUserChipViewModel, Loading @@ -80,7 +79,8 @@ class PhoneStatusBarViewController private constructor( statusOverlayHoverListenerFactory.createDarkAwareListener(statusContainer)) if (moveFromCenterAnimationController == null) return val statusBarLeftSide: View = mView.requireViewById(R.id.status_bar_start_side_except_heads_up) val statusBarLeftSide: View = mView.requireViewById(R.id.status_bar_start_side_except_heads_up) val systemIconArea: ViewGroup = mView.requireViewById(R.id.status_bar_end_side_content) val viewsToAnimate = arrayOf( Loading Loading @@ -179,11 +179,8 @@ class PhoneStatusBarViewController private constructor( // If scene framework is enabled, route the touch to it and // ignore the rest of the gesture. if (featureFlags.isEnabled(Flags.SCENE_CONTAINER)) { sceneInteractor.get() .onRemoteUserInput(RemoteUserInput.translateMotionEvent(event)) // TODO(b/291965119): remove once view is expanded to cover the status bar sceneInteractor.get().setVisible(true, "swipe down from status bar") return false windowRootView.get().dispatchTouchEvent(event) return true } if (event.action == MotionEvent.ACTION_DOWN) { Loading Loading @@ -247,7 +244,7 @@ class PhoneStatusBarViewController private constructor( private val centralSurfaces: CentralSurfaces, private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val sceneInteractor: Provider<SceneInteractor>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val viewUtil: ViewUtil, private val configurationController: ConfigurationController, Loading @@ -269,7 +266,7 @@ class PhoneStatusBarViewController private constructor( centralSurfaces, shadeController, shadeViewController, sceneInteractor, windowRootView, shadeLogger, statusBarMoveFromCenterAnimationController, userChipViewModel, Loading