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

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.

Related

Facebook Android App News Feed Layout

I am trying to implement a vertical listview with horizontal scroll on each item just like the facebook newsfeed. Suggested apps can be seen by scrolling to right and some part of next item is also visible.
here is the screenshot :
http://i.stack.imgur.com/7JRfM.png
So I am just stuck here and don't know how to proceed.
You're probably going to need to write some custom code (which is a pretty good rule of thumb whenever you're trying to do something Facebook did on Android; they do some crazy stuff).
I don't believe you can nest ListViews in Android. There is "ExpandableListView", which lets you expand items to show more, although this isn't quite the same thing.
I would advise to just create a vertical ListView, and have the items be horizontal LinearLayouts that you can inflate yourself. You can also try making them horizontal ScrollViews (although I think this may have the same limitation as using nested ListViews).
Good luck!

What's the difference between HorizontalScrollView & ViewPager?

I'm new programming in Android and i have many doubts about what type of classes can i use in my first app.
I want to do a level menu like cut the rope or angry birds. Only a title and a slider menu.
I think that can do with the two classes, but I'm not sure which is better, can you tell me the difference and which is better to use?
Many thanks.
ViewPager allows you to flip between pages of data (between views). You supply an adapter to generate the pages that the view shows.
But HorizontalScrollView is a container for other views that you can scrolled through, allowing it to be larger than the physical display.
I would go with horizontal scroll view.
EDIT : See FoamyGuy's answer in Angry Birds like scrolling menu where he exactly explains how to achieve such effect.

Scrollable and zoomable view with webviews

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);

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.

PopupWindow with swiping scrollable views

I'm trying to create a Popupindow in which the views can be changed by swiping. Each view should also be scrollable when larger than the popup window. I also want to move only one view when swiping. I can't find any simple way to do that (the Gallery move several views when swiping).
Is there any widget I missed or do I have to implement everything to achieve that (with ViewFlipper and gesture detection for instance)?
Anybody can help with the best way to do that?
Thanks
I've found and ended up using the fantastic HorizontalPager.

Categories

Resources