WebView content inside of bottom sheet of the ModalBottomSheetLayout is not scrollable - android

I am trying to implement WebView in a ModalBottomSheetLayout. Issue is that WebView content is not scrolling inside bottom sheet. It works fine in normal compose view. Couldn't find anything workable. Is there a way to make it working?

Related

SystemWebView on Android doesn't scroll

So I have my activity (extending CordovaActivity) on Android, which loads the content, but I am unable to scroll.
I already tried to add this code into my activity:
// Display vertical scrollbar and hide horizontal scrollBar
super.appView.getView().setVerticalScrollBarEnabled(true);
super.appView.getView().setHorizontalScrollBarEnabled(false);
// set scrollbar style
super.appView.getView().setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
but didn't help.
Does anyone has an experience / solution to How can I make my Cordova WebView scrollable?

Android WebView pinchToZoom doesn't work correctly inside ScrollView

I have WebView inside a ScrollView and the WebView zoom functionality doesn't work correctly, because the ScrolView take focus and scrolls instead to zoom WebView.
I was thinking, that putting WebView inside ScrollView isn't the best idea, but unfortunately I don't know how else I can achieve wanted result.
I need to have few TextViews on the top of the screen and under them WebView which will show HTML content, but when I didn't use ScollView I can't see the whole content (scroll down of course).
So anybody has an idea how I can achieve scrolling without ScrollView or zooming WebView in ScrollView correctly?
Thank you!

WebViews inside ViewPager glitch: scrolls like sliding a stack of cards

My pager has one webview inside each fragment. The webviews themselves don't scroll, i.e. their content fit entirely in them.
The problem is the scrolling of the pager doesn't behave as expected. The webview content only follows the scrolling when going through the right edge of the screen (i.e. moving out/in to/from the right). When a webview is going through the left edge though it's content stays still (so that it looks like the next page is sliding over it, like cards).
I tried having other components (TextView, ImageView) along with the WebView on each page. They all slide normally while the WebView content keeps getting stuck on the left.
Is this a known problem? Is there a workaround?
Turns out the issue was CSS related.
I had "position:fixed" on all web content. After changing it to "absolute" the problem was solved.
In my point of view it's still an unexpected behavior, because "fixed" is supposed to position things relative to the browser window. What is expected is that, as the webview is scrolled left, the "browser window" moves past the device screen.

WebView and ViewPager, and Horizontal Scrollable Content

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)

Android ScrollView containing LinearLayout with WebView scroll behavior

I have a view hierarchy like this, a vertical ScrollView with a vertical LinearLayout containing two children:
ScrollView ->orientation:vertical, width:fill_parent, height: fill_parent
LinearLayout -> orientation:vertical, width:fill_parent, height: fill_parent
WebView -> width:fill_parent, height: fill_parent
GoogleAdView -> width:wrap_content, height:wrap_content
When scrolling to the bottom of the webview and clicking on any link there, though the page loads , the scrollbar stays at the bottom rather than moving to the top. I can programatically set the scroll using scroll.fullScroll(ScrollView.FOCUS_UP), but that causes the scrollbar to jump up visibly. I have tried hiding the scrollbar before the page loads with scrollView.setVerticalScrollBarEnabled(false) and then re-enabling it after the page loads before calling scroll.fullScroll(ScrollView.FOCUS_UP) but that still causes the scrollbar to "jump".
The WebView by itself handles scrolling much more nicely on page changes, looks like it hides the scrollbar and then makes it appear on top of the page after load. Is there a way to maintain this with ScrollView?
You cannot reliably put a WebView in a ScrollView.
Either embed your ad in your Web content, leave the banner fixed on the screen, or work out some other trigger to animate hiding the ad (e.g., goes away after 5 seconds).
I've solved this by adding the AD inside the webview. Unfortunately you won't be able to use any Ad network SDK's, but it's a much better user experience.
Use javascript injection to insert your ads after the webview loads.
The trick is to use loadDataWithBaseURL when loading content into the WebView. Simply doing a loadData doesn't cause the scroll offset to reset.

Categories

Resources