eowise / recyclerview-stickyheaders

DEPRECATED. Android library that integrate sticky section headers in your RecyclerView
http://eowise.github.io/recyclerview-stickyheaders
MIT License
960 stars 148 forks source link

Handle Orientation Changes #16

Closed rubengees closed 9 years ago

rubengees commented 9 years ago

It would be great if you could handle orientation changes. When I rotate my Device the Header is not drawn correctly. Check Screenshots

screenshot_2014-11-21-21-10-45 screenshot_2014-11-21-21-10-55

leruaa commented 9 years ago

I don't reproduce this issue on my Android 5.0 phone with the samples. What is your Android version ? Do you reproduce that with the samples ?

rubengees commented 9 years ago

I haven't tried the Samples yet, but the version on my Phone is 4.4.4

This is part of my manifest:

android:configChanges="keyboardHidden|orientation|screenSize"
leruaa commented 9 years ago

I've done some tests about this, and it appears that when onConfigurationChanged() is called, the new size of RecyclerView is not known, so the layout cannot be refreshed.

By the way, it seems that using android:configChanges="keyboardHidden|orientation|screenSize" is not recommended (See there, there and there).

rubengees commented 9 years ago

Okay, thank you for pointing this out.