Skip to content

Commit 4b9ba7b

Browse files
Alberto Manzano TorregrosaAlberto Manzano Torregrosa
Alberto Manzano Torregrosa
authored and
Alberto Manzano Torregrosa
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 11ce289 commit 4b9ba7b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

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

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

427427
SlidingUpPanelLayout.LayoutParams params;
428-
params = new SlidingUpPanelLayout.LayoutParams(screenWidth, screenHeight + mPanelHeight);
428+
params = new SlidingUpPanelLayout.LayoutParams(screenWidth, screenHeight + mPanelHeight - getNotificationBarHeight());
429429

430430
slidingUpPanelLayout.setLayoutParams(params);
431431
} else {
@@ -850,14 +850,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
850850

851851
child.measure(childWidthSpec, childHeightSpec);
852852

853-
if (mPanelOffScreen) {
854-
// In order to place the panel off the screen,
855-
// the sliding distance will be the height of the entire sliding view
856-
// minus the panel height and the notification bar
857-
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight - getNotificationBarHeight();
858-
} else {
859-
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight;
860-
}
853+
mSlideRange = mSlideableView.getMeasuredHeight() - mPanelHeight;
861854
}
862855

863856
setMeasuredDimension(widthSize, heightSize);

0 commit comments

Comments
 (0)