-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window displayWidth and displayHeight invalid on device rotate #13
Comments
here's my workaround for this (for classes extending StandOutWindow):
|
Does not seem to work. BTW, can we know what this drawable "ic_nos" refers to ? |
Never mind. found another way to fix this. |
I also find the way to rotate window. Currently window only allow for portrait orientation. I can capture orientation changing by overriding onConfigurationChanged method.But Xposition never change. |
Now i can do screen rotation without doing any brocast receiver for orientation changing.I only update window.setPosition method. In that method , you need to define displaywidth and height to get latest width and height. |
That is what I did as well.
|
i'm facing the same problem but still i've not found a solution by myself. rotating the screen do not update screen width/height so i can not wander a window around. someone have shared the code somewhere??? thanks |
You need to update in Standout Library. In Library, there has setPosition method in winodw.java. You need to called Display Height and width in those method. as follows, private Editor setPosition(int x, int y, boolean skip) {
|
tankyou. i'vecopied it in getlayoutparams so w/h are always up to date |
@yikhinzaw thanks, you code works if correct what i think is a mistake.
|
Maybe caching the displayWidth and displayHeight isn't the way to go.
https://github.com/pingpongboss/StandOut/blob/master/library/src/wei/mark/standout/ui/Window.java#L80
Rotating the screen should also check the window size and bounds to make sure they fit in the screen if need be.
The text was updated successfully, but these errors were encountered: