Flipboard / bottomsheet

Android component which presents a dismissible view from the bottom of the screen
BSD 3-Clause "New" or "Revised" License
4.52k stars 596 forks source link

problem when oreientation changed (change to landscape) #169

Open mt73564 opened 7 years ago

mt73564 commented 7 years ago

When I changed the orientation to landscape, and pressed the "show" button, the bottomsheet only pop up part of its length when compared to the one in portrait. bottomsheet fragment May I ask why this happens?

kamranr123 commented 7 years ago

in my case (screen size is 5) nothing shown, unless i slide it up manually after i slide it down, it wouldn't dismiss completely

arieshao commented 7 years ago

same here, and in Pad it show like bottomSheetLayout.setPeekSheetTranslation()

h6ah4i commented 7 years ago

I also noticed this issue after upgraded to v1.5.3, so I just reverted to use v1.5.2 for now.

It seems this commit had changed the behavior to adapt Material Design spec.

The initial height of a bottom sheet is relative to the height of the list items (or grid rows) it contains. A bottom sheet should not initially have a height beyond its 16:9 ratio keyline, depending on how much content it contains. Bottom sheets may be swiped up to fill the height of the screen, with content that then scrolls internally.


However, the spec also says "The minimum height of a bottom sheet is relative to the height of the list items it contains." I guess current implementation lacks this minimal height handling.

bernaferrari commented 7 years ago

Months later, still same problem..

ZacSweers commented 7 years ago

PRs welcome!

bernaferrari commented 7 years ago

@hzsweers done! #181

arunkrishna2992 commented 6 years ago

Is this issue resolved? I'm still getting this.

bernaferrari commented 6 years ago

Nope, no one accepted my PR.

nazarcybulskij commented 6 years ago

resolved this issue
in BottomSheetLayout.java

line 163 replaced peekKeyline = point.y - (screenWidth / (16.0f / 9.0f)) by peekKeyline = point.y / (16.0f / 9.0f)

joejensen8 commented 6 years ago

Is this being worked on? I see an open PR for this. https://github.com/Flipboard/bottomsheet/pull/184

dajver commented 5 years ago

still doesn't work for me, can't see layout on landscape...

bernaferrari commented 5 years ago

Because the project is abandoned

dajver commented 5 years ago

I have found way to fix this problem, in the BottomSheetLayout have to change some params

in the method getPeekSheetTranslation change return from return peek == 0 ? getDefaultPeekTranslation() : peek; to return getSheetView().getHeight();

Then in the method showWithSheetView need to change condition which check isTablet, from params = new LayoutParams(isTablet ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL); to params = new LayoutParams(LayoutParams.MATCH_PARENT , LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL);

And this will fix the problem with landscape

vzhilong commented 5 years ago

same problem here