Scrollable and zoomable view with webviews - android

Let me start by saying - I know there are quite a lot of posts on this issue. I've been digging and testing it quite a bit, but couldn't come up with the proper solution to my specific requirements.
I need to have a master view with several webviews inside it, and more than one should be visible at a single moment. For this master view - I need to be able to scroll it (to reveal invisible webviews) and to zoom (in order to focus on a single webview).
I've tried TableLayout, but had problems with the zoom (and painting issues with the scrolling). I've tried scroll views, but also read it's not recommended.
Any ideas or recommendation regarding how to achieve this?
Thanks,
yakobom

A simple approach could be to have only one webview with the root html doc containing multiple iframes. Load each page in one of the iframes.
This way the scrolling/zooming could be handled by the webview itself.

Scrollable view can be achieved by adding a scroll view in .xml file and placing remaining text views, edit texts in that scroll view..

to scrolling webview:
mWebView2.getSettings().setJavaScriptEnabled(true);
mWebView2.getSettings().setLoadWithOverviewMode(true);
mWebView2.getSettings().setUseWideViewPort(true);
mWebView2.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
mWebView2.setScrollbarFadingEnabled(true);
to zooming webview:
webView.setInitialScale(50);
webPlanSettings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
webPlanSettings.setUseWideViewPort(true);

Related

Xamarin Forms / Android ScrollView with Paging, same as UIScrollView.PagingEnabled

I want to create a scroll view with pages that can be scrolled vertically and horizontally as well.
The scroller should be just like a slideshow on a website, to slide between images (content). Something like ScrollView, but to stop at a certain point when scrolled.
I am using this in Xamarin.Forms, so I'll need to create a custom renderer (Android) and set the content of the pages from Forms.
I tried ViewPagers, but I want to be able to set the content from Forms page, not from predefined layouts...
I just couldn't find a clear example/tutorial so I can understand how to approach this problem. I also think about overriding some methods from ScrollViewRenderer class, to intercept and only slide to a certain point, but have no idea which methods and properties to change.
Something like CarouselPage on XF, which can be used inside a layout.
Any help or examples would really be appreciated. Thanks!
I'm searching for 2 days for a solution for this problem.

android animate views inside a scroll view while scrolling

Is there example android code or sample android app which demonstrate animation of the views while scrolling.
For example. In a scroll view some items are not visible when you scroll the items will start to come inside the screen that time i just want to animate that view.
any help would be greatly appreciated.
Thanks.
Download this app. Here you will find tons of libraries of your use. I also seen the library which your are asking in this app. You will find source code links in the app as well.
https://play.google.com/store/apps/details?id=com.desarrollodroide.repos&hl=en
Or You can do one more thing
Just add on scroll listener and some more listeners are there by which you can detect which portion of your scroll view is visible.
Then You can add animation to those views.
Try Listview animation library.
Modify it and use.
https://github.com/nhaarman/ListViewAnimations

Android WebView: How do I horizontally scroll between different pages?

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.

Horizontal Scrollview with pages in Android

I am looking for a behavior very similar to ios where we can scroll horizontally to see multiple pages (like a walkthrough/demo). In ios we can do it with UIScrollView and PageControl but not sure how can that be done in Android?
I don't mind if it's not possible to add the bullets of PageControl. I am more concerned about the pages type behavior of scrollview.
Take a look at this article on viewPager, I think it has the something as you require.
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
You can use ViewFlipper in android to scroll or swipe between the different layouts....
Try searching "android ViewFlipper onFling()" on google..
http://www.codeshogun.com/blog/tag/view-flipper/

Android -- Displaying HorizontalScrollView of WebViews

So, the idea is to be able to view a very simple html page (text and one image) that can scroll vertically and place this view in a horizontal list that scrolls and snaps to the closest html page.
I've read over and over that, for performance reasons, it isn't a good idea to place web/scroll views inside list views. I'm trying to avoid writing a new view from scratch but am lost as to what direction I should go.
To get the snapping to occur, you may want to consider using a Gallery. It essentially works the same as the list view but is horizontal.
To avoid using a webview, consider using the Html.fromSource function. See this post for details.

Categories

Resources