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

Commit 27d77690 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Fix task bar crash in gesture nav mode with task bar / nav bar unification on

a11yButton is reserved for 3-button mode so it can be null. Also TaskbarNavLayoutter is used for large screen both in gesture nav and 3-button mode, so need to check isContextualButtonShowing to add contextual buttons

Fixes: 300849078
Test: Make sure that it doesn't crash in large screen gesture nav mode
Change-Id: I9d0694b7f4c95461f24efb2af1af905e68e3cd8d
parent d45403ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ abstract class AbstractNavButtonLayoutter(
        protected val startContextualContainer: ViewGroup,
        protected val imeSwitcher: ImageView?,
        protected val rotationButton: RotationButton?,
        protected val a11yButton: ImageView
        protected val a11yButton: ImageView?
) : NavButtonLayoutter {
    protected val homeButton: ImageView? = navButtonContainer.findViewById(R.id.home)
    protected val recentsButton: ImageView? = navButtonContainer.findViewById(R.id.recent_apps)
+4 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class KidsNavLayoutter(
        startContextualContainer: ViewGroup,
        imeSwitcher: ImageView?,
        rotationButton: RotationButton?,
        a11yButton: ImageView
        a11yButton: ImageView?
) :
    AbstractNavButtonLayoutter(
            resources,
@@ -114,7 +114,9 @@ class KidsNavLayoutter(
            startContextualContainer.addView(imeSwitcher)
            imeSwitcher.layoutParams = getParamsToCenterView()
        }
        if (a11yButton != null) {
            endContextualContainer.addView(a11yButton)
        }
        if (rotationButton != null) {
            endContextualContainer.addView(rotationButton.currentView)
            rotationButton.currentView.layoutParams = getParamsToCenterView()
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class NavButtonLayoutFactory {
                navButtonsView: FrameLayout,
                imeSwitcher: ImageView?,
                rotationButton: RotationButton?,
                a11yButton: ImageView,
                a11yButton: ImageView?,
                resources: Resources,
                isKidsMode: Boolean,
                isInSetup: Boolean,
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class PhoneGestureLayoutter(
        startContextualContainer: ViewGroup,
        imeSwitcher: ImageView?,
        rotationButton: RotationButton?,
        a11yButton: ImageView
        a11yButton: ImageView?
) :
        AbstractNavButtonLayoutter(
                resources,
+4 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ open class PhoneLandscapeNavLayoutter(
        startContextualContainer: ViewGroup,
        imeSwitcher: ImageView?,
        rotationButton: RotationButton?,
        a11yButton: ImageView,
        a11yButton: ImageView?,
) :
    AbstractNavButtonLayoutter(
            resources,
@@ -113,7 +113,9 @@ open class PhoneLandscapeNavLayoutter(
            startContextualContainer.addView(imeSwitcher)
            imeSwitcher.layoutParams = getParamsToCenterView()
        }
        if (a11yButton != null) {
            startContextualContainer.addView(a11yButton)
        }
        if (rotationButton != null) {
            startContextualContainer.addView(rotationButton.currentView)
            rotationButton.currentView.layoutParams = getParamsToCenterView()
Loading