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

Commit 05528141 authored by Jonathon Axford's avatar Jonathon Axford Committed by Android (Google) Code Review
Browse files

Merge "Reduce legacy lockscreen bottom area on small land screens - follow-up" into main

parents f69dd302 54acb5fc
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ constructor(
    private var keyguardIndicationArea: View? = null
    private var binding: KeyguardBottomAreaViewBinder.Binding? = null
    private var lockIconViewController: LockIconViewController? = null
    private var isLockscreenLandscapeEnabled: Boolean = false

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

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

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

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

        if (isLockscreenLandscapeEnabled) {
            updateIndicationAreaBottomMargin()
        }
    }

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

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 javax.inject.Inject

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

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

    override fun onViewAttached() {
    }