Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

problem when oreientation changed (change to landscape) #169

Open
mt73564 opened this issue Jan 18, 2017 · 14 comments
Open

problem when oreientation changed (change to landscape) #169

mt73564 opened this issue Jan 18, 2017 · 14 comments

Comments

@mt73564
Copy link

mt73564 commented Jan 18, 2017

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
Copy link

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
Copy link

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

@h6ah4i
Copy link

h6ah4i commented Jun 25, 2017

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
Copy link

Months later, still same problem..

@ZacSweers
Copy link
Contributor

PRs welcome!

@bernaferrari
Copy link

@hzsweers done! #181

@arunkrishna2992
Copy link

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

@bernaferrari
Copy link

Nope, no one accepted my PR.

@nazarcybulskij
Copy link

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
Copy link

Is this being worked on? I see an open PR for this. #184

@dajver
Copy link

dajver commented Mar 21, 2019

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

@bernaferrari
Copy link

Because the project is abandoned

@dajver
Copy link

dajver commented Mar 21, 2019

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
Copy link

vzhilong commented Aug 9, 2019

same problem here

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests