I need to create listview which should displays as a photo slider. I mean that it have to be only one item at the screen. And when user starts swiping up or down item above or below become be visible, but doesn't fill the screen. And when user swipes it at some defined point, this item fulfills the screen. And so forth.
As a photo slider. You open it and see only one photo at the screen. Then you click on the photo and start swipe down. Accordingly to your swiping photo which is in bottom of current fulfills the screen. I want to implement such a principle at my listview items.
I attached the files which can describe what I want to implement. So position 1 - start position of the listview. Then user touches the screen and start to swipe left. You can see that on the 2-nd picture - user sees the item 1 yet, but also see 2-nd item. And, finally, when he swipe over 2-nd item to the end, he sees only it on the screen. I'm sorry for such strange explanation, but I think that it can make my question more clearly.
Besides, I want to implement vertical swiping, not horizontal at my listview and it should be only one item on it.
I am still not sure if I got you, but from what I could gather? Are you looking for a View Pager? If yes, then a nice tutorial is given at this link. View Pager is used in the home page of the google play app. Try opening it and slide right left top bottom and see if thats what you want? Also, from the images it seems as if the headers have been added to the View Pager, that can easily be added by using view pager indicator. I hope i was of some help to you. If you have some doubt please feel free to ask.
Related
Is it possible on selected CardView swipe up or click (if swipe up not possible) to make CardView fill ~90% of the screen. And when clicked again, it shrinks down to its original form.
The important part is that it has to be on the same view as google maps are, so transition to other activity won't work for me and also I will be adding addition content to CardView when it will be enlarged.
I don't need exactly specifics on how to do it, but at least where to start.
Right now you can swipe left and right, and it will add shadow to object and enlarge current item.
Link to .xml and transform class code: https://pastebin.com/0trtw1E1
Basically, i'm trying to implement https://github.com/mciekurs2/ViewPagerCards, but with a little bit of a twist.
I want to zoom in the loaded layout of a viewPager page onTouchListner event. Something like this: ios app design.
Let me clarify the steps here:
ViewPager gets loaded
User can see the all pages by swiping right or left
To get the detail user clicks on a page and it will get zoom in to cover the full screen (Have a look at the ios app link)
User tap on the opened page and it retains it's position again (second steps)
How can I achieve this scenario? I tried to search it but couldn't get enough information. Any help would be appreciable.
If view is a list you can use expendable list
I am animating views between two RecyclerView. The first one is something like a list of folders showing the first item as cover, clicking it opens a new view showing the folders content animating the cover to the first item. Clicking back animates all visible views back to the folder where they came from (the cover being the top most view). This looks great as long as the opened folder shows the first item. If I scroll down the first item will be offscreen and the back animation does not look that good anymore because the cover view is not animated (I'm only animating all visible views currently).
What I think would work is following: the LayoutManager could position the first item at a position shortly offscreen and keeps it as a special view in it's pool so that u always can access the first view and when I animate back to the folder view I can animate the cover in addition to all other currently visible items ( the cover will be animated from top of the screen).
This means I need following:
the LayoutManager must handle the first item as a special one that is not recycled (I may need it any time for the back animation)
the first item must always be layed out (either at the default position in the list, if it is visible or offscreen directly above the screen), again because I may need it at any time for the back animation
Can someone help me where to start here? I think this is possible with extending the LayoutManager but I don't know where to start...
Have you tried the following?
recView.getRecycledViewPool().setMaxRecycledViews(TYPE_XXXX, 0);
I'm trying to implement an Android swipe transition on an image within my layout so the user can get some feedback while they are selecting the image.
So, the user would ideally place their finger on the image, and drag it right, and have the image track it until the user has sufficiently dragged it far enough right, just like it is shown here (from the Android dropdown menu in the second item):
http://farm8.staticflickr.com/7301/8716433318_d58aaaa567.jpg
Thanks!
This should be easily implemented with a ViewPager
I have a menu that is made up of a HorizontalScrollView that has a LinearLayout with TextViews. When a user swipes/scrolls I want to be able to show and not show a leading and trailing image that represents that there are more options. So, when the application starts, the far left image is not shown but the far right image is. Once the user swipes to go right, the far left image is shown. When you get to the very last option to the right, the right image is gone.
I have tried to use the SimpleOnGestureListener but it seems that the position reported is where the user is instead of the position of the list. I was thinking I could just do something like:
if(scrollX < 200.0) {
tempL.setVisibility(View.INVISIBLE);
} else tempL.setVisibility(View.VISIBLE);
I even implemented both onFling and onScroll methods to try but did not get the expected results. Also, the position is only reported when the user scrolls again. So, a fling position may be 1278 and go all the way to 0 but 0 is not reported until the user tries to fling again.
Thanks.
You can use gallery for this. It has some limitations though, but I guess it would suit your requirement better than a horizontal Scroll View.