Loading packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootViewBinder.kt +1 −29 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ package com.android.systemui.scene.ui.view import android.view.Gravity import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.widget.FrameLayout import androidx.activity.OnBackPressedDispatcher import androidx.activity.OnBackPressedDispatcherOwner import androidx.activity.setViewTreeOnBackPressedDispatcherOwner Loading @@ -39,7 +37,6 @@ import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.statusbar.notification.stack.shared.flexiNotifsEnabled import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer import java.time.Instant import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch Loading Loading @@ -98,7 +95,7 @@ object SceneWindowRootViewBinder { ) val legacyView = view.requireViewById<View>(R.id.legacy_window_root) view.addView(createVisibilityToggleView(legacyView)) legacyView.isVisible = false // This moves the SharedNotificationContainer to the WindowRootView just after // the SceneContainerView. This SharedNotificationContainer should contain NSSL Loading @@ -123,29 +120,4 @@ object SceneWindowRootViewBinder { } } } private var clickCount = 0 private var lastClick = Instant.now() /** * A temporary UI to toggle on/off the visibility of the given [otherView]. It is toggled by * tapping 5 times in quick succession on the device camera (top center). */ // TODO(b/291321285): Remove this when the Flexiglass UI is mature enough to turn off legacy // SysUI altogether. private fun createVisibilityToggleView(otherView: View): View { val toggleView = View(otherView.context) otherView.isVisible = false toggleView.layoutParams = FrameLayout.LayoutParams(200, 200, Gravity.CENTER_HORIZONTAL) toggleView.setOnClickListener { val now = Instant.now() clickCount = if (now.minusSeconds(2) > lastClick) 1 else clickCount + 1 if (clickCount == 5) { otherView.isVisible = !otherView.isVisible clickCount = 0 } lastClick = now } return toggleView } } Loading
packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootViewBinder.kt +1 −29 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ package com.android.systemui.scene.ui.view import android.view.Gravity import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.widget.FrameLayout import androidx.activity.OnBackPressedDispatcher import androidx.activity.OnBackPressedDispatcherOwner import androidx.activity.setViewTreeOnBackPressedDispatcherOwner Loading @@ -39,7 +37,6 @@ import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.statusbar.notification.stack.shared.flexiNotifsEnabled import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer import java.time.Instant import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch Loading Loading @@ -98,7 +95,7 @@ object SceneWindowRootViewBinder { ) val legacyView = view.requireViewById<View>(R.id.legacy_window_root) view.addView(createVisibilityToggleView(legacyView)) legacyView.isVisible = false // This moves the SharedNotificationContainer to the WindowRootView just after // the SceneContainerView. This SharedNotificationContainer should contain NSSL Loading @@ -123,29 +120,4 @@ object SceneWindowRootViewBinder { } } } private var clickCount = 0 private var lastClick = Instant.now() /** * A temporary UI to toggle on/off the visibility of the given [otherView]. It is toggled by * tapping 5 times in quick succession on the device camera (top center). */ // TODO(b/291321285): Remove this when the Flexiglass UI is mature enough to turn off legacy // SysUI altogether. private fun createVisibilityToggleView(otherView: View): View { val toggleView = View(otherView.context) otherView.isVisible = false toggleView.layoutParams = FrameLayout.LayoutParams(200, 200, Gravity.CENTER_HORIZONTAL) toggleView.setOnClickListener { val now = Instant.now() clickCount = if (now.minusSeconds(2) > lastClick) 1 else clickCount + 1 if (clickCount == 5) { otherView.isVisible = !otherView.isVisible clickCount = 0 } lastClick = now } return toggleView } }