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

Commit 54acb5fc authored by axfordjc's avatar axfordjc
Browse files

Reduce legacy lockscreen bottom area on small land screens - follow-up

Follow-up to ag/24745109
- added additional flag guarding
- added line (128) missed in ag/24745109
- indication area moved downwards (reduced margins)

This is a required feature for landscape lockscreen for small screens

Guarded by flag "lockscreen.enable_landscape" (b/293252410)

Bug: 296571001
Bug: 293252410

Test: LockIconViewControllerTest
Change-Id: Ib07e0084bb00e94b723f82505a605aca74574be7
parent 3544524b
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -62,6 +62,7 @@ constructor(
    private var keyguardIndicationArea: View? = null
    private var keyguardIndicationArea: View? = null
    private var binding: KeyguardBottomAreaViewBinder.Binding? = null
    private var binding: KeyguardBottomAreaViewBinder.Binding? = null
    private var lockIconViewController: LockIconViewController? = null
    private var lockIconViewController: LockIconViewController? = null
    private var isLockscreenLandscapeEnabled: Boolean = false


    /** Initializes the view. */
    /** Initializes the view. */
    @Deprecated("Deprecated as part of b/278057014")
    @Deprecated("Deprecated as part of b/278057014")
@@ -115,15 +116,26 @@ constructor(
        }
        }
    }
    }


    fun setIsLockscreenLandscapeEnabled(isLockscreenLandscapeEnabled: Boolean) {
        this.isLockscreenLandscapeEnabled = isLockscreenLandscapeEnabled
    }

    override fun onFinishInflate() {
    override fun onFinishInflate() {
        super.onFinishInflate()
        super.onFinishInflate()
        ambientIndicationArea = findViewById(R.id.ambient_indication_container)
        ambientIndicationArea = findViewById(R.id.ambient_indication_container)
        keyguardIndicationArea = findViewById(R.id.keyguard_indication_area)
    }
    }


    override fun onConfigurationChanged(newConfig: Configuration) {
    override fun onConfigurationChanged(newConfig: Configuration) {
        super.onConfigurationChanged(newConfig)
        super.onConfigurationChanged(newConfig)
        binding?.onConfigurationChanged()
        binding?.onConfigurationChanged()


        if (isLockscreenLandscapeEnabled) {
            updateIndicationAreaBottomMargin()
        }
    }

    private fun updateIndicationAreaBottomMargin() {
        keyguardIndicationArea?.let {
        keyguardIndicationArea?.let {
            val params = it.layoutParams as FrameLayout.LayoutParams
            val params = it.layoutParams as FrameLayout.LayoutParams
            params.bottomMargin =
            params.bottomMargin =
+10 −1
Original line number Original line Diff line number Diff line
@@ -16,11 +16,20 @@


package com.android.systemui.statusbar.phone
package com.android.systemui.statusbar.phone


import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.flags.Flags
import com.android.systemui.util.ViewController
import com.android.systemui.util.ViewController
import javax.inject.Inject
import javax.inject.Inject


class KeyguardBottomAreaViewController @Inject constructor(view: KeyguardBottomAreaView) :
class KeyguardBottomAreaViewController
    @Inject constructor(view: KeyguardBottomAreaView, featureFlags: FeatureFlagsClassic) :
    ViewController<KeyguardBottomAreaView> (view) {
    ViewController<KeyguardBottomAreaView> (view) {

    init {
        view.setIsLockscreenLandscapeEnabled(
                featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE))
    }

    override fun onViewAttached() {
    override fun onViewAttached() {
    }
    }