android.widget.Gallery inside a ViewPager? - android

I need to place a android.widget.Gallery inside a view pager at the bottom. The user will read and scroll all the way to the bottom and than see more pictures to view inside the Gallery at the bottom. I want to be able to scroll horizontally through the Gallery w/o switching pages. So when the user is interacting with the Gallery, I don't want the horizontal swipe of the ViewPager to take over and switch pages. How can this be done?

I don't recommend horizontal scrolling item in a horizontal scrolling viewpager.
To try this you have a couple options, lots of items: 1.) search horizontal list view. less items: 2.) horizontal scrollview. I guess option 3.) use gallery even though depreciated.
However, I encourage you to try it, it just doesn't work very well with two items scrolling the same way.
For the same reason it's not a good idea to have a vertical scroll inside another vertical scroll.
About the only way this can work is if you give the user a separate full screen non-horizontally scrolling window with your horizontally scrolling item.

Related

Android RecyclerView Custom Stacking Scroll

So i have this requirement for a custom scroll for a linear layout and i have no idea where to start. The scroll will be like this:
instead of recyclerView items leave the screen, the top most item will remain fixed, and the items will overlap it when scrolled. So instead of scrolling out of the screen, or scrolling into the screen, they will scroll out from the first card and into the first car.
I would seek for advices with alternatives, as i have relatively short time to do it. I would avoid doing a custom layout manager unless really necessary (its tricky to do so).

How put Horizontal View and Gridview inside Vertical Scrollview

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.

Scrolling grid view hides other control on top of activity in android

On scrolling down gridView.
I want to scroll my three tabs on top as shown in second image.
And on scrolling up back shows that again like first image.
I have checked paralloid library, but not sure if it solves this problem or not.
Same functionality i found in google+ android app. In profile page on scrolling tab scroll till they reach on top. after that list view scrolls.
GridView already has scrolling built into it, so its children should scroll separately than its siblings by default. No extra library should be needed for scrolling down, although scrolling horizontally is a separate issue.

Android ViewPager set current element always on center

I need a vertical ViewPager that has selected view always on center.
Something like Android's gallery widget works (selected element is always in center).
I have tried to implement vertical Gallery, but since it's deprecated...I would like to have this functionality via ViewPager.
Is there a way to manage that selected view is always on the center?
Also how to manage scroll amount of ViewPager?
For example...when I scroll trough the content I want to scroll for exactly one element's height.
Also I need mechanism how to define exact amouth of pixels for scrolling list view.
When list scroll I don't want it to only show next item, but to scroll for exact amount of pixels to always show the part of the following item.
Tnx for your help!
Im not sure if i understund the question. Isn't it as easy as this?
viewPager.setCurrentItem(viewager.getAdapter().getCount()/2)
About scrolling the pager to an specific amount of pixels,
You have to signal the ViewPager by calling beginFakeDrag() and endFakeDrag() on it. After starting a fake drag you can use fakeDragBy(float) to drag the ViewPager by the given amount of pixels

How to create lazy loading in Horizontal scrollview

My application loads 10 image-thumbnails from server and set them into horizontal scrollview. When I swipe it to the last image, I would like to add lazy-loading element in the back of my horizontal scrollview and download next 10 more image in the background process.
My problem is -----> How I know the last image in horizontal scrollview shows on the screen?
I think the horizontal scrollview is so different from listview, because the listview uses adapter to control inside elements.
Thanks you so much
Maybe you can use a ViewPager http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
This uses an adapter behind the scenes and you can do the trick where you set the count to a very large number.

Categories

Resources