Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6adc1f9 authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

Revert "Adds LongPressHandlingView to KeyguardRootView."

This reverts commit 00f10864.

Reason for revert: b/296921279

Change-Id: Icd2390f0248f91e663cb48b86e6aacdcfd2577b9
parent 00f10864
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -89,9 +89,8 @@ class LongPressHandlingView(
    }

    @SuppressLint("ClickableViewAccessibility")
    override fun onTouchEvent(event: MotionEvent): Boolean {
        super.onTouchEvent(event)
        return interactionHandler.onTouchEvent(event.toModel())
    override fun onTouchEvent(event: MotionEvent?): Boolean {
        return interactionHandler.onTouchEvent(event?.toModel())
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import androidx.constraintlayout.widget.ConstraintSet.BOTTOM
import androidx.constraintlayout.widget.ConstraintSet.END
import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID
import com.android.systemui.R
import com.android.systemui.keyguard.shared.model.KeyguardSection
import com.android.systemui.keyguard.data.repository.KeyguardSection
import javax.inject.Inject

class DefaultCommunalWidgetSection @Inject constructor() : KeyguardSection {
+3 −33
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import com.android.keyguard.KeyguardStatusViewController
import com.android.keyguard.dagger.KeyguardStatusViewComponent
import com.android.systemui.CoreStartable
import com.android.systemui.R
import com.android.systemui.animation.view.LaunchableLinearLayout
import com.android.systemui.common.ui.view.LongPressHandlingView
import com.android.systemui.communal.ui.adapter.CommunalWidgetViewAdapter
import com.android.systemui.communal.ui.binder.CommunalWidgetViewBinder
import com.android.systemui.communal.ui.viewmodel.CommunalWidgetViewModel
@@ -36,7 +34,6 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteract
import com.android.systemui.keyguard.ui.binder.KeyguardAmbientIndicationAreaViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardBlueprintViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder
import com.android.systemui.keyguard.ui.binder.KeyguardLongPressViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardSettingsViewBinder
@@ -45,7 +42,6 @@ import com.android.systemui.keyguard.ui.view.layout.KeyguardBlueprintCommandList
import com.android.systemui.keyguard.ui.viewmodel.KeyguardAmbientIndicationViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardLongPressViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordancesCombinedViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSettingsMenuViewModel
@@ -84,7 +80,6 @@ constructor(
    private val falsingManager: FalsingManager,
    private val vibratorHelper: VibratorHelper,
    private val keyguardStateController: KeyguardStateController,
    private val keyguardLongPressViewModel: KeyguardLongPressViewModel,
    private val keyguardSettingsMenuViewModel: KeyguardSettingsMenuViewModel,
    private val activityStarter: ActivityStarter,
    private val occludingAppDeviceEntryMessageViewModel: OccludingAppDeviceEntryMessageViewModel,
@@ -117,7 +112,7 @@ constructor(
        bindLeftShortcut()
        bindRightShortcut()
        bindAmbientIndicationArea()
        bindSettingsPopupMenu(notificationPanel)
        bindSettingsPopupMenu()
        bindCommunalWidgetArea()

        KeyguardBlueprintViewBinder.bind(keyguardRootView, keyguardBlueprintViewModel)
@@ -207,34 +202,12 @@ constructor(
        }
    }

    private fun bindSettingsPopupMenu(legacyParent: ViewGroup) {
    private fun bindSettingsPopupMenu() {
        if (featureFlags.isEnabled(Flags.MIGRATE_SPLIT_KEYGUARD_BOTTOM_AREA)) {
            // Remove the legacy long-press view from the NotificationPanelView where it used to be
            // before this refactor such that we only have one long-press view at the bottom of
            // KeyguardRootView.
            val legacyLongPressView = legacyParent.requireViewById<View>(R.id.keyguard_long_press)
            legacyParent.removeView(legacyLongPressView)

            val longPressView: LongPressHandlingView =
                keyguardRootView.requireViewById(R.id.keyguard_long_press)
            val settingsMenuView: LaunchableLinearLayout =
                keyguardRootView.requireViewById(R.id.keyguard_settings_button)

            // Bind the long-press view that (1) triggers the showing of the settings popup menu and
            // (2) captures touch events outside of the shown settings popup menu to hide it.
            KeyguardLongPressViewBinder.bind(
                view = longPressView,
                viewModel = keyguardLongPressViewModel,
                onSingleTap = {},
                falsingManager = falsingManager,
                settingsMenuView = settingsMenuView,
            )

            // Bind the settings popup menu.
            settingsPopupMenuHandle?.dispose()
            settingsPopupMenuHandle =
                KeyguardSettingsViewBinder.bind(
                    settingsMenuView,
                    keyguardRootView,
                    keyguardSettingsMenuViewModel,
                    vibratorHelper,
                    activityStarter,
@@ -243,9 +216,6 @@ constructor(
            keyguardRootView.findViewById<View?>(R.id.keyguard_settings_button)?.let {
                keyguardRootView.removeView(it)
            }
            keyguardRootView.findViewById<View?>(R.id.keyguard_long_press)?.let {
                keyguardRootView.removeView(it)
            }
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -99,3 +99,11 @@ interface KeyguardBlueprint {

    fun apply(constraintSet: ConstraintSet)
}

/**
 * Lower level modules that determine constraints for a particular section in the lockscreen root
 * view.
 */
interface KeyguardSection {
    fun apply(constraintSet: ConstraintSet)
}
+0 −27
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.keyguard.shared.model

import androidx.constraintlayout.widget.ConstraintSet

/**
 * Lower level modules that determine constraints for a particular section in the lockscreen root
 * view.
 */
interface KeyguardSection {
    fun apply(constraintSet: ConstraintSet)
}
Loading