Fix #1318
This commit is contained in:
parent
0c2c0eea83
commit
96cfc4b4c1
|
@ -422,8 +422,13 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
if (!ViewCompat.getFitsSystemWindows(homeMenu)) {
|
if (!ViewCompat.getFitsSystemWindows(homeMenu)) {
|
||||||
homeContent.setPadding(0, insets.systemWindowInsetTop, 0, 0)
|
homeContent.setPadding(0, insets.systemWindowInsetTop, 0, 0)
|
||||||
}
|
}
|
||||||
|
(toolbar.layoutParams as? MarginLayoutParams)?.bottomMargin = insets.systemWindowInsetBottom
|
||||||
(actionsButton.layoutParams as? MarginLayoutParams)?.bottomMargin =
|
(actionsButton.layoutParams as? MarginLayoutParams)?.bottomMargin =
|
||||||
actionsButtonBottomMargin + insets.systemWindowInsetBottom
|
actionsButtonBottomMargin + if (preferences[tabPositionKey] == SharedPreferenceConstants.VALUE_TAB_POSITION_TOP) {
|
||||||
|
insets.systemWindowInsetBottom
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
return insets
|
return insets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,16 +628,22 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
}
|
}
|
||||||
notifyControlBarOffsetChanged()
|
notifyControlBarOffsetChanged()
|
||||||
} else {
|
} else {
|
||||||
|
val layoutparams = toolbar.layoutParams
|
||||||
|
val toolbarMarginBottom = if (layoutparams is MarginLayoutParams) {
|
||||||
|
layoutparams.bottomMargin
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
val translationY = if (mainTabs.columns > 1 || !toolbar.isVisible) {
|
val translationY = if (mainTabs.columns > 1 || !toolbar.isVisible) {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
(toolbar.height * (offset - 1)).toInt()
|
((toolbar.height + toolbarMarginBottom) * (offset - 1)).toInt()
|
||||||
}
|
}
|
||||||
toolbar.translationY = -translationY.toFloat()
|
toolbar.translationY = -translationY.toFloat()
|
||||||
windowOverlay.translationY = -translationY.toFloat()
|
windowOverlay.translationY = -translationY.toFloat()
|
||||||
val lp = actionsButton.layoutParams
|
val lp = actionsButton.layoutParams
|
||||||
if (lp is MarginLayoutParams) {
|
if (lp is MarginLayoutParams) {
|
||||||
actionsButton.translationY = (lp.bottomMargin + toolbar.height + actionsButton.height) * (1 - offset)
|
actionsButton.translationY = (lp.bottomMargin + toolbar.height + actionsButton.height + toolbarMarginBottom) * (1 - offset)
|
||||||
} else {
|
} else {
|
||||||
actionsButton.translationY = actionsButton.height * (1 - offset)
|
actionsButton.translationY = actionsButton.height * (1 - offset)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue