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

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

Merge "Fix nav buttons in task bar disppearing when unfolding from landscape...

Merge "Fix nav buttons in task bar disppearing when unfolding from landscape small screen" into udc-qpr-dev
parents aad3a8e3 a7e48fa6
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -42,16 +42,15 @@ open class PhoneLandscapeNavLayoutter(

    override fun layoutButtons(dp: DeviceProfile, isContextualButtonShowing: Boolean) {
        // TODO(b/230395757): Polish pending, this is just to make it usable
        val navContainerParams = navButtonContainer.layoutParams as FrameLayout.LayoutParams
        val endStartMargins = resources.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
        val taskbarDimensions = DimensionUtils.getTaskbarPhoneDimensions(dp, resources,
                TaskbarManager.isPhoneMode(dp))
        navButtonContainer.removeAllViews()
        navButtonContainer.orientation = LinearLayout.VERTICAL

        val navContainerParams = FrameLayout.LayoutParams(
                taskbarDimensions.x, ViewGroup.LayoutParams.MATCH_PARENT)
        navContainerParams.apply {
            width = taskbarDimensions.x
            height = ViewGroup.LayoutParams.MATCH_PARENT
            topMargin = endStartMargins
            bottomMargin = endStartMargins
            marginEnd = 0
@@ -64,7 +63,7 @@ open class PhoneLandscapeNavLayoutter(
        navButtonContainer.addView(backButton)

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

        // Add the spaces in between the nav buttons
        val spaceInBetween: Int =
+3 −4
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ class PhonePortraitNavLayoutter(

    override fun layoutButtons(dp: DeviceProfile, isContextualButtonShowing: Boolean) {
        // TODO(b/230395757): Polish pending, this is just to make it usable
        val navContainerParams = navButtonContainer.layoutParams as FrameLayout.LayoutParams
        val taskbarDimensions =
            DimensionUtils.getTaskbarPhoneDimensions(dp, resources,
                    TaskbarManager.isPhoneMode(dp))
@@ -51,9 +50,9 @@ class PhonePortraitNavLayoutter(
        navButtonContainer.removeAllViews()
        navButtonContainer.orientation = LinearLayout.HORIZONTAL

        val navContainerParams = FrameLayout.LayoutParams(
                taskbarDimensions.x, ViewGroup.LayoutParams.MATCH_PARENT)
        navContainerParams.apply {
            width = taskbarDimensions.x
            height = ViewGroup.LayoutParams.MATCH_PARENT
            topMargin = 0
            bottomMargin = 0
            marginEnd = endStartMargins
@@ -66,7 +65,7 @@ class PhonePortraitNavLayoutter(
        navButtonContainer.addView(recentsButton)

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

        // Add the spaces in between the nav buttons
        val spaceInBetween =
+3 −4
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ class TaskbarNavLayoutter(

    override fun layoutButtons(dp: DeviceProfile, isContextualButtonShowing: Boolean) {
        // Add spacing after the end of the last nav button
        val navButtonParams = navButtonContainer.layoutParams as FrameLayout.LayoutParams
        var navMarginEnd = resources.getDimension(dp.inv.inlineNavButtonsEndSpacing).toInt()
        val contextualWidth = endContextualContainer.width
        // If contextual buttons are showing, we check if the end margin is enough for the
@@ -50,10 +49,10 @@ class TaskbarNavLayoutter(
            navMarginEnd += resources.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing) / 2
        }

        val navButtonParams = FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)
        navButtonParams.apply {
            gravity = Gravity.END
            width = FrameLayout.LayoutParams.WRAP_CONTENT
            height = ViewGroup.LayoutParams.MATCH_PARENT
            gravity = Gravity.END or Gravity.CENTER_VERTICAL
            marginEnd = navMarginEnd
        }
        navButtonContainer.orientation = LinearLayout.HORIZONTAL