Skip to content

Commit 14f6d42

Browse files
Alberto Manzano Torregrosaalberto.manzano
Alberto Manzano Torregrosa
authored and
alberto.manzano
committed
Fix to not lose space below when the panel is expanded. If a view had alignParentBottom="true", we were missing "notificationbarheight" pixels. Now it aligns correctly.
1 parent a1a4e81 commit 14f6d42

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

library/src/main/java/com/sothree/slidinguppanel/SlidingUpPanelLayout.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public void setExpandedPanelOffScreen(View slidingUpPanelLayout) {
402402
final int screenWidth = size.x;
403403

404404
SlidingUpPanelLayout.LayoutParams params;
405-
params = new SlidingUpPanelLayout.LayoutParams(screenWidth, screenHeight + mPanelHeight);
405+
params = new SlidingUpPanelLayout.LayoutParams(screenWidth, screenHeight + mPanelHeight - getNotificationBarHeight());
406406

407407
slidingUpPanelLayout.setLayoutParams(params);
408408
} else {
@@ -839,14 +839,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
839839

840840
child.measure(childWidthSpec, childHeightSpec);
841841

842-
if (mPanelOffScreen) {
843-
// In order to place the panel off the screen,
844-
// the sliding distance will be the height of the entire sliding view
845-
// minus the panel height and the notification bar
846-
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight - getNotificationBarHeight();
847-
} else {
848-
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight;
849-
}
842+
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight;
850843
}
851844

852845
setMeasuredDimension(widthSize, heightSize);

0 commit comments

Comments
 (0)