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

Commit ed968650 authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Center taskbar nav buttons in small screen" into udc-qpr-dev

parents e3d61883 dcae0e86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ open class PhoneLandscapeNavLayoutter(
        navContainerParams.apply {
            width = taskbarDimensions.x
            height = ViewGroup.LayoutParams.MATCH_PARENT
            gravity = Gravity.CENTER
            topMargin = endStartMargins
            bottomMargin = endStartMargins
            marginEnd = 0
@@ -65,6 +64,7 @@ open class PhoneLandscapeNavLayoutter(
        navButtonContainer.addView(backButton)

        navButtonContainer.layoutParams = navContainerParams
        navButtonContainer.gravity = Gravity.CENTER_HORIZONTAL

        // Add the spaces in between the nav buttons
        val spaceInBetween: Int =
+11 −7
Original line number Diff line number Diff line
@@ -46,23 +46,27 @@ class PhonePortraitNavLayoutter(
            DimensionUtils.getTaskbarPhoneDimensions(dp, resources,
                    TaskbarManager.isPhoneMode(dp))
        val endStartMargins = resources.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
        navContainerParams.width = taskbarDimensions.x
        navContainerParams.height = ViewGroup.LayoutParams.MATCH_PARENT
        navContainerParams.gravity = Gravity.CENTER_VERTICAL

        // Ensure order of buttons is correct
        navButtonContainer.removeAllViews()
        navButtonContainer.orientation = LinearLayout.HORIZONTAL
        navContainerParams.topMargin = 0
        navContainerParams.bottomMargin = 0
        navContainerParams.marginEnd = endStartMargins
        navContainerParams.marginStart = endStartMargins

        navContainerParams.apply {
            width = taskbarDimensions.x
            height = ViewGroup.LayoutParams.MATCH_PARENT
            topMargin = 0
            bottomMargin = 0
            marginEnd = endStartMargins
            marginStart = endStartMargins
        }

        // Swap recents and back button in case we were landscape prior to this
        navButtonContainer.addView(backButton)
        navButtonContainer.addView(homeButton)
        navButtonContainer.addView(recentsButton)

        navButtonContainer.layoutParams = navContainerParams
        navButtonContainer.gravity = Gravity.CENTER_VERTICAL

        // Add the spaces in between the nav buttons
        val spaceInBetween =