Closed mhutti1 closed 7 years ago
Steps to reproduce:
What you get:
What we want:
I tried to get this to work using CoordinatorLayout
, AppBarLayout
, etc. but apparently WebViews don't play nicely with NestedScrollView (http://stackoverflow.com/a/37913484). Would it be sufficient to just to listen for scroll events in the content WebView and to have the toolbar disappear when the WebView scrolls down and vice versa? It wouldn't have the nice animations and behavior that the scrolling behavior with CoordinatorLayout
and the support design library offer.
Yes this is fine. If you feel you are up to it you can try implement scroll animation behaviour by looking here https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/page/ViewHideHandler.java but it might be a bit tricky.
I've tried to incorporate org.wikipedia.page.ViewHideHandler
into Kiwix (see above commit), but the result is very glitchy. The main problem is that the WebView has to move in some cases while the user is dragging to scroll, which leads to inaccurate scrolling changes and flickering. One alternative would be to shrink the WebView's height while keeping it stationary relative to the bottom of the screen.
We wouldn't have to worry about the movement of the toolbar and the scrolling if CoordinatorLayout scroll behavior worked with WebViews. I've found an implementation of a WebView class that is supposed to work with the scroll behavior (https://github.com/takahirom/webview-in-coordinatorlayout) which looks very promising and I'm also trying to get that to work.
@GEOFBOT Great work, either solutions should work, once you have something working (even if its a bit glitchy) you can submit a pull request and I can review and see if I can help.
Will have a look, can not wait to see this :)
I think the feature looks good in general. On my side I only see a "flash" if I click on the title (to get the searchbox). But if this is fixed, this ticket get my vote to be closed (further problems can be handle in separate tickets).
@EladKeyshawn Can you look into 8e4f3ad06a29e33f11aa36407069df07d4560cc0 . Its causing the search activity to flash in a weird way when launching.
@mhutti1 Do you have any idea why the method overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out); works only works from search activity to main and not the opposite? cause that's what causing it.
@EladKeyshawn perhaps because we arn't overriding the finish method of KiwixMobileActivity.
@mhutti1 I tried now and still doesn't work... so for now I just removed the code causing the flash.
@EladKeyshawn Ok cool
This would allow users with small screens to have a better reading experience.