-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
HorizontalScrollView #48
Comments
It's just a WebView. See the web view API. The vertical scroll works for you because the content overflows the browser container height, that's all. It's just a HTML. Of course putting it inside scrollable element does not work because the WebView is a fixed size. The interaction happens inside. Browse closed issues here on examples on how to work with WebView...#47 . Similar code will help you with scrolling. Of course, if your content does not overflow horizontally, the slider will not show up (Idk how much CSS support is in there, I feel like I saw somewhere WebView being discontinued). |
Ok, trying HorizontalScrollView was indeed a bit dumb. But the rest is a bit more complicated. Secondly, I discovered that horizontal scrolling works when I measure the width of the MathView everytime I set the text:
this is the mathView (I made my own setText function). scroll_example.mp4
The first line of the stacktrace: Do you have an idea why this happens? And why has measuring something to do with the ability to scroll? Thank you Edit: On my physical device (API 31, the virtual one is 25) it seems to get bigger too but it does not crash. |
Sorry, no idea and no don't have time to investigate either. The measuring makes WebView update its viewport I guess so it calls some function that does the update. |
One wild guess is that it might be the problem of the rendering script, I don't know how you update the contents but safest would be to try to 'reload the whole page' on content update (re-initalize the page) and see whether it solves the problem for you |
That makes sense. Thank you for your answers and the amount of time you spent, I'll try to find the exact sources or a way to work around the problem. Should I close the issue now or when I've found the solution? I'm not very familiar with the rules on gitHub |
Once you've found the fix/workaround |
Haven't found the solution yet (gotta go to school now, but I hope I find one after), but I think I identified the exact problem. And this happens when calling setDisplayText():
Loaddata seems to act like invalidate(), which makes sense, because normally invalidate is called when the text or color should change, but not the size. So I think I need to call something like requestLayout(), because the size changes. That's why it worked a bit with calling measure(). |
I noticed that there is a vertical scrollview already implemented in this MathView. Is horizontal scrolling possible too?
I played around with tons of parameters but I couldn't figure out how to achieve horizontal scrolling. Unfortunately, putting the MathView in a HorizontalScrollView didn't seem to work neither.
I can see a horizontal scrollbar if I press the plus or minus sign that shows up during vertical scrolling, but the scrollbar and the text don't move.
Any working examples or advice appreciated.
The text was updated successfully, but these errors were encountered: