fix: add padding to last item in recycler (#293)
* fix: add padding to last item in recycler Stop guessing numbers to compensate for a view we can measure. by adding a method to measure them. * fix: avoid scrolling artifacts in nested
This commit is contained in:
parent
19b5b11b07
commit
77c57846ed
10 changed files with 47 additions and 8 deletions
|
@ -270,6 +270,29 @@ fun Activity.setNavigationTheme() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets clipToPadding false and sets the combined height of navigation bars as bottom padding.
|
||||
*
|
||||
* When nesting multiple scrolling views, only call this method on the inner most scrolling view.
|
||||
*/
|
||||
fun ViewGroup.setBaseline(navBar: AnimatedBottomBar) {
|
||||
navBar.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED)
|
||||
clipToPadding = false
|
||||
setPadding(paddingLeft, paddingTop, paddingRight, navBarHeight + navBar.measuredHeight)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets clipToPadding false and sets the combined height of navigation bars as bottom padding.
|
||||
*
|
||||
* When nesting multiple scrolling views, only call this method on the inner most scrolling view.
|
||||
*/
|
||||
fun ViewGroup.setBaseline(navBar: AnimatedBottomBar, overlayView: View) {
|
||||
navBar.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED)
|
||||
overlayView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED)
|
||||
clipToPadding = false
|
||||
setPadding(paddingLeft, paddingTop, paddingRight, navBarHeight + navBar.measuredHeight + overlayView.measuredHeight)
|
||||
}
|
||||
|
||||
fun Activity.reloadActivity() {
|
||||
Refresh.all()
|
||||
finish()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue