I have a Custom Horizontal Scroll View in a Html page , now this horizontal scrolling based on java script library , now when i load the html pager in a webview i cant scroll horizontally because the viewpager take the touch event to move between pages .
You will need to implement onInterceptTouchEvent(MotionEvent), determine if the touch is within the horizontal scroll section of your WebView, and then call requestDisallowInterceptTouchEvent(boolean) on the parent of the WebView (assuming that is the ViewPager).
Determining if the touch is within the horizontal scroller may be tricky, but you can probably accomplish that with some JS callbacks that the WebView listens for.
Before all of that, you may want to consider the UX implications of this though. It may be confusing / disorienting to the user to have horizontal scrolling content in a horizontal scrolling view.
Related
I want to develop an app that includes GridView and I want it to be some thing like horizontal ListView above a gridvew .Horizontal view displays images downloaded from url.I saw this touturial ( horizontal scrollview used)
and saw this to put the GridView inside scrollView because i want to put the gridview(episode #2) and horizontal view (episode #1) in vertical scrollview(episode #3) . I need to scroll the horizontal view vertically when a user is scrolling the gridview and not to have fixed position at the top of the screen.
I have no idea how to do this (use horizontal ScrollView or horizontal Listview)?
after vertical scrolling I want it to be like this (horizontal view must get scrolled vertically):
This is a custom interaction, so you probably will not be able to use a "standard" tool for this. You may want something like the FloatingActionButton (an example here: http://antonioleiva.com/collapsing-toolbar-layout/) but you also want it to scroll, so you may need to extend that class.
Also, you could use touch events to do a custom animation on the area, because you will need to track when it is displayed and the direction/distance of the motion event to collapse/expand it. You also would need to know anchors on the list, to determine when it should reappear...
This is a cool design concept, but usually "cool" = "difficult" because it's not standard.
I have multiple WebViews showed in ViewPager, as pages, but i faced a problem if part of WebView content is Horizontal Scrollable content, I have tested it on iOS, and the WebView consume the TouchEvent, so the ViewPager doesn't scroll, but in android the ViewPager keeps scrolling, I tried to get the consume the TouchEvent, but I couldn't determine if the content is horizontal scrollable or not.
====
Edit 1:
the width of the content matches the webview, without scrollbars, but they put frame or i dont know what its name, the content inside it is horizontal scrollable. (Interactive Magazine)
Little sample online http://www.quackit.com/html/codes/horizontal_scroll.cfm (scroll down to result box)
I am developing Android application which contains the reading of epub books. In that I need to place two pages in book view. If those pages exceed the screen size user have to scroll and view the books and have to pinch zoom the book and user can pan the book for reading.
At first I tried to place two webview inside the Relativelayout. I can achieve this by placing relativelayout inside the scrollview and horizontal scrollview to scroll in both horizontal and vertical.
But problem occur in the swipping of pages and pinchzoom is not working inside the scrollview; it remains in the first page itself. I don't know where I am going wrong.
Are you putting WebView inside ScrollView? It functions funny that way. You'll have to disable the outside ScrollView if you're doing so.
You can modify ScrollView to be lockable, as in here.
I have several HTML pages that I'd like to be able to scroll horizontally, kind of like how you would read a book or a magazine. But instead of a totally smooth scrolling horizontally, I would like each page to kind of click into place as I scroll.
What is the best way I can go about doing this?
Maybe use a ViewFlipper with multipe WebViews and add animations when you flipp through your views.
Also you would have to add a GestureDetector and implement the onFling() method.
Depending on how many webpages you have you might want to limit the amount of WebView instances and resuse them and just load another page when they are shown.
I have problem in scrolling of webview vertically when it's scrolled along vertically,where this webview is with in scrollview tag,how can i enable the scrolling for webview and to disable the scrolling of whole layout when its on webview contained layout.
Because of the way touch events are consume in android it is not recommended or even really possible to have two Views that consume and react to the same move events in the same axis. In other words, you cannot put a WebView in a ScrollView. You would not be able to put a ListView in a ScrollView and have it work either since they both scroll vertically.