How to set WebView properly in fixed size properly - android

I implement webview in recyclerview item and Webview result does not set properly.
Click here for image

I think you are trying to build the tab minimising functionality similar to chrome/firefox, instead of using webview inside the minimised items, you can map every page to an image and store it internal storage, also, you don't want the user to interact with pages in minimised state, so webview is not required.

Related

How to avoid refresh in a webview app with navigation drawer?

So, the thing is that, if I am in a webview on the app and then tap another option of the menu (also in webview) and then go back to the first option this one will refresh the content, I want to avoid that, because if a put a login screen and the user taps another option and goes back they will have the login screen again even if they are already logged.
I already tried this answer but didn't work.
I suspect the problem is that the WebView is not wired into the lifecycle of your activity/fragment and can not distinguish between the first time it is loaded and subsequent times it is loaded. Additionally if the WebView is destroyed (highly probable) the WebView must reload the data.
Ensure that you are saving and restoring the state of your Activity/Fragment correctly and keep track of which webviews are loaded (you can use a HashMap, or boolean or whatever you like). https://developer.android.com/guide/components/activities/activity-lifecycle.html#saras
When you go to load your webviews consult the data from step 1 to determine if you need to reload the content. You may need to pass some data to the HTML to indicate the state (first load etc).

How to detect when the scrollbar has reached the top or bottom of webpage?

I am working with WebView and my problem is that whenever the scrollbar reaches to the end or top of WebView it should indicate this to me with some boolean value so that I can display the next and previous page correspondingly.
I am working on a project and I want to show a HTML file as a html reader so I want to know whenever the scrollbar reaches the end of webpage so I can load the further pages.
I do recommend you iScroll:
http://cubiq.org/iscroll-4
It's easy to use and it works fairly perfect on every mobile platforms.

Eclipse Android Webview, how to center the content

I am nearly done with my first app, but I am still working on some little issues.
My main problem is that I am loading a normal html page, but I have no access to the html code.
Now I want to center the page in the webview module, because the page is also centered, so that when I am loading the page, I have to scroll all the time to the right side and that is really anoying.
So how do I do that, that the webview modul automatically loads the page already centered and the user of the app sees the middle of the page?
You mean, you dont want horizontal scroll,for that try this :
mwebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

Android: setVisibility(View.GONE) reducing the font size and image size on the webview

I have an android application that hits the WebView and displays the content. But as per the requirement initially I should hide the WebView and later on I should show it to the user.
So, initially I call setVisibility(View.GONE); and hide the visibility of the WebView. And, then I call setVisibility(View.VISIBLE); to show the WebView to the user.
1)When I am doing in this sequence, the size of the content(font and images) on the WebView are getting reduced.
2)If I don't call setVisibility(View.GONE); and directly show it to the user then size of the content(font and images) on the WebView is bigger.
I want to achieve 2 scenario by initially hiding the WebView. Means I want to hide the WebView initially, and then show to the user with bigger sized content on WebView.
How do I achieve this?
I have got this working finally!!!
Instead of using setVisibility(View.GONE); to make the webview invisible, I am using setVisibility(View.INVISIBLE);.
This way I was able to achieve the proper size of items on the webview. Dont know the exact reason for this mismatch, but it is working as expected with this change.
I can't tell just how much the sizes are changing, but have you tried using WebView.zoomIn/WebView.zoomOut? You can also set the default with WebView.getSettings().setDefaultZoom.

Problem with contents of WebView in Android

I created a WebView in android inside an Activity of an TabActivity
but when I load the contents inside the WebView and I scroll the WebView (that is not full screen) or I change the tab, some contents of WebView like flash scripts or built-in controls
do not disappear covering the elements of the layout
I tried to disable plugins in WebView without success, and I need the zoom function so I have to keep the built-in controls enabled
how can I solve this? thanks

Categories

Resources