Loading quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt +6 −5 Original line number Diff line number Diff line Loading @@ -65,18 +65,19 @@ abstract class AbstractNavButtonLayoutter( fun getParamsToCenterView(): FrameLayout.LayoutParams { val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) params.gravity = Gravity.CENTER return params; } open fun repositionContextualContainer(contextualContainer: ViewGroup, barAxisMargin: Int, open fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) contextualContainerParams.apply { marginStart = barAxisMargin marginEnd = barAxisMargin marginStart = barAxisMarginStart marginEnd = barAxisMarginEnd topMargin = 0 bottomMargin = 0 } Loading quickstep/src/com/android/launcher3/taskbar/navbutton/KidsNavLayoutter.kt +4 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.graphics.Color import android.graphics.drawable.PaintDrawable import android.view.Gravity import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.FrameLayout import android.widget.ImageView import android.widget.LinearLayout Loading Loading @@ -103,8 +104,9 @@ class KidsNavLayoutter( val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, 0, Gravity.END) repositionContextualContainer(startContextualContainer, contextualMargin, Gravity.START) repositionContextualContainer(endContextualContainer, WRAP_CONTENT, 0, 0, Gravity.END) repositionContextualContainer(startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneLandscapeNavLayoutter.kt +12 −9 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ open class PhoneLandscapeNavLayoutter( } } repositionContextualButtons() repositionContextualButtons(contextualButtonHeight.toInt()) } open fun addThreeButtons() { Loading @@ -116,13 +116,15 @@ open class PhoneLandscapeNavLayoutter( navButtonContainer.addView(backButton) } open fun repositionContextualButtons() { open fun repositionContextualButtons(buttonSize: Int) { endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(startContextualContainer, contextualMargin, Gravity.TOP) val roundedCornerContentMargin = resources.getDimensionPixelSize( R.dimen.taskbar_phone_rounded_corner_content_margin) val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding) repositionContextualContainer(startContextualContainer, buttonSize, roundedCornerContentMargin + contentPadding, 0, Gravity.TOP) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading @@ -137,15 +139,16 @@ open class PhoneLandscapeNavLayoutter( } } override fun repositionContextualContainer(contextualContainer: ViewGroup, barAxisMargin: Int, override fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginTop: Int, barAxisMarginBottom: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) ViewGroup.LayoutParams.MATCH_PARENT, buttonSize) contextualContainerParams.apply { marginStart = 0 marginEnd = 0 topMargin = barAxisMargin bottomMargin = barAxisMargin topMargin = barAxisMarginTop bottomMargin = barAxisMarginBottom } contextualContainerParams.gravity = gravity or Gravity.CENTER_HORIZONTAL contextualContainer.layoutParams = contextualContainerParams Loading quickstep/src/com/android/launcher3/taskbar/navbutton/PhonePortraitNavLayoutter.kt +2 −3 Original line number Diff line number Diff line Loading @@ -110,9 +110,8 @@ class PhonePortraitNavLayoutter( endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, contextualMargin, Gravity.END) repositionContextualContainer(endContextualContainer, contextualButtonWidth.toInt(), 0, roundedCornerContentMargin + contentPadding, Gravity.END) if (imeSwitcher != null) { endContextualContainer.addView(imeSwitcher) Loading quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneSeascapeNavLayoutter.kt +6 −4 Original line number Diff line number Diff line Loading @@ -50,13 +50,15 @@ class PhoneSeascapeNavLayoutter( navButtonContainer.addView(recentsButton) } override fun repositionContextualButtons() { override fun repositionContextualButtons(buttonSize: Int) { endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, contextualMargin, Gravity.BOTTOM) val roundedCornerContentMargin = resources.getDimensionPixelSize( R.dimen.taskbar_phone_rounded_corner_content_margin) val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding) repositionContextualContainer(endContextualContainer, buttonSize, 0, roundedCornerContentMargin + contentPadding, Gravity.BOTTOM) if (imeSwitcher != null) { endContextualContainer.addView(imeSwitcher) Loading Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt +6 −5 Original line number Diff line number Diff line Loading @@ -65,18 +65,19 @@ abstract class AbstractNavButtonLayoutter( fun getParamsToCenterView(): FrameLayout.LayoutParams { val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) params.gravity = Gravity.CENTER return params; } open fun repositionContextualContainer(contextualContainer: ViewGroup, barAxisMargin: Int, open fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) contextualContainerParams.apply { marginStart = barAxisMargin marginEnd = barAxisMargin marginStart = barAxisMarginStart marginEnd = barAxisMarginEnd topMargin = 0 bottomMargin = 0 } Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/KidsNavLayoutter.kt +4 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.graphics.Color import android.graphics.drawable.PaintDrawable import android.view.Gravity import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.FrameLayout import android.widget.ImageView import android.widget.LinearLayout Loading Loading @@ -103,8 +104,9 @@ class KidsNavLayoutter( val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, 0, Gravity.END) repositionContextualContainer(startContextualContainer, contextualMargin, Gravity.START) repositionContextualContainer(endContextualContainer, WRAP_CONTENT, 0, 0, Gravity.END) repositionContextualContainer(startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneLandscapeNavLayoutter.kt +12 −9 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ open class PhoneLandscapeNavLayoutter( } } repositionContextualButtons() repositionContextualButtons(contextualButtonHeight.toInt()) } open fun addThreeButtons() { Loading @@ -116,13 +116,15 @@ open class PhoneLandscapeNavLayoutter( navButtonContainer.addView(backButton) } open fun repositionContextualButtons() { open fun repositionContextualButtons(buttonSize: Int) { endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(startContextualContainer, contextualMargin, Gravity.TOP) val roundedCornerContentMargin = resources.getDimensionPixelSize( R.dimen.taskbar_phone_rounded_corner_content_margin) val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding) repositionContextualContainer(startContextualContainer, buttonSize, roundedCornerContentMargin + contentPadding, 0, Gravity.TOP) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading @@ -137,15 +139,16 @@ open class PhoneLandscapeNavLayoutter( } } override fun repositionContextualContainer(contextualContainer: ViewGroup, barAxisMargin: Int, override fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginTop: Int, barAxisMarginBottom: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) ViewGroup.LayoutParams.MATCH_PARENT, buttonSize) contextualContainerParams.apply { marginStart = 0 marginEnd = 0 topMargin = barAxisMargin bottomMargin = barAxisMargin topMargin = barAxisMarginTop bottomMargin = barAxisMarginBottom } contextualContainerParams.gravity = gravity or Gravity.CENTER_HORIZONTAL contextualContainer.layoutParams = contextualContainerParams Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/PhonePortraitNavLayoutter.kt +2 −3 Original line number Diff line number Diff line Loading @@ -110,9 +110,8 @@ class PhonePortraitNavLayoutter( endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, contextualMargin, Gravity.END) repositionContextualContainer(endContextualContainer, contextualButtonWidth.toInt(), 0, roundedCornerContentMargin + contentPadding, Gravity.END) if (imeSwitcher != null) { endContextualContainer.addView(imeSwitcher) Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneSeascapeNavLayoutter.kt +6 −4 Original line number Diff line number Diff line Loading @@ -50,13 +50,15 @@ class PhoneSeascapeNavLayoutter( navButtonContainer.addView(recentsButton) } override fun repositionContextualButtons() { override fun repositionContextualButtons(buttonSize: Int) { endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, contextualMargin, Gravity.BOTTOM) val roundedCornerContentMargin = resources.getDimensionPixelSize( R.dimen.taskbar_phone_rounded_corner_content_margin) val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding) repositionContextualContainer(endContextualContainer, buttonSize, 0, roundedCornerContentMargin + contentPadding, Gravity.BOTTOM) if (imeSwitcher != null) { endContextualContainer.addView(imeSwitcher) Loading