mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Merge "Fix nav buttons in task bar disppearing when unfolding from landscape small screen" into udc-qpr-dev
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user