-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Text in prompt on wrong position when activity smaller then screen and not centered #17
Comments
Hi, it sounds like the prompt should be checking if the view has enough height to display the text above (or below) the target and if it doesn't then display the text it to the side. The other option is to add functionality to disable clipping to the activity bounds so that it could draw outside the activity bounds. Let me know how you get on searching for a solution. I shall look at expanding the dialog functionality in the sample app to cover having the dialog in different positions and sizes. |
Its ok to draw the prompt inside the bounds. I'm perfectly happy with the prompt. It is only shown in the activity bounds. Just the text is not there. I think if he knew the parent is not full screen parent decorview but is a coordinatorlayout smaller than the screen, it should be fine. |
Changes I did:
1 problem left: Any idea? |
Hey, thanks for your work. I shall have a look at it and see what I can do to fix it |
Debugged a little further and I saw that the mClipToView when having the onGlobalLayout has a different left and top (left: 64 iso 510 and top: 64 iso 1536). It's then used to update everything and the activity is now larger and almost full screen. mClipToView is still the same mClipToView as before (according to my watches in Android Studio). No idea why it changed yet... |
Still need to do some more testing but changing the text positioning at the end of mTextPositionAbove = mView.mCentreTop > mView.mClipBoundsTop + ((mView.mClipBoundsBottom - mView.mClipBoundsTop) / 2);
mTextPositionRight = mView.mCentreLeft > mView.mClipBoundsLeft + ((mView.mClipBoundsRight - mView.mClipBoundsLeft) / 2); I think this can (and should) be improved further so that it can position the text better when there is limited room |
So only this without my changes? |
Currently without, yes |
@ElineDeMeyer did the changes that I suggested work for you? |
Yes, please include these or an improved solution in one of your next releases :) |
Thanks for your help, it is very much appreciated! The fix is released in v1.5.0 |
When you have an activity like in your DialogActivity but it is not in the center of the screen (eg at the bottom) the prompt is shown ok but the text in it is positioned wrong.
In my example the targetView is on the top right of my activity but my activity is at bottom center of the window. The targetView is still in the bottom right part of the window.
Parameters tell met the text will be shown above/left of the target but that is not in my activity anymore.
I'm searching for a solution in order to help you out :)
The text was updated successfully, but these errors were encountered: