Hi Friends.
I have one horizontal ListView containing images.
Now I want to move next Image when User Swipe on the Screen.
My problem is normally when user swipe on screen lots of item of ListView is moved on Screen. I want to bind that Item. If user Swipe on screen only next Item should be displayed.
How to achieve this?
Related
I am working on an android application where I need to show some offers in horizontal scroll view. These offers are in the form of clickable buttons.
Here is the list example:
Notes about this pic:
This is a horizontal scroll list of clickable buttons.
This list can have multiple buttons and at a time, we can show only 2 buttons with full width like shown in the pic.
Here is the 2nd pic:
Notes about this 2nd pic:
This show that one button is in the center.
What I want:
I want when user scroll the horizontal list then button that is displayed with full width in scroll view should animate to the center when user removes his hands from scrolling view. With that said, I can scroll by tapping and it should be smoothly but when I leave doing scrolling then the button that seems to come in center should be animated to center position like in 2nd image.
I tried this given solution but this works when I click on a button.
Android : Locating the item at center position of the screen after selecting it ,In the horizontalscrollview
This is exactly similar but I want the button in the center when I
leave doing scrolling.
Any help?
I have a recycler view which has its items in a card view. The recycler view gets its data from a sql database within the app . Now I want to implement two features to this recycler view items. First , whenever the individual cards are tapped , I want them to enlarge and display more data and should shrink back when tapped again. It is not like the case of expandable list view where it expands into a child list view. I want the height of the card to increase and just show some more information and buttons. Second I want the items to swipe left . I know there is a feature for that in recycler view , but I want to customise the swipe feature. Swipe from right should be locked , and when swiped from left , It should not go off list completely. It should show two buttons and should go off list only when one of the buttons is clicked. I have been looking , but there is no proper explaination anywhere. Please guide me through this process.
For your first question, set the adapter layout_height to wrap_content and set the buttons visibility to GONE. Implement the OnClick listener in the RecyclerView adapter and set the visibility of the buttons to VISIBLE if GONE and GONE if VISIBLE or use a boolean to alternate the visibility.
For your second question, this might help:
https://www.learn2crack.com/2016/02/custom-swipe-recyclerview.html
How can I make my Android SwipeableCardViews more like the IOS 7 mail app (swipe to show buttons)
https://github.com/daimajia/AndroidSwipeLayout
There is a horizontal recyclerview in my app and I want the sideways swipe to just bring next item to the centre. So when user swipes on the screen, the list should not scroll on for several items but just scroll to next item regardless of the swipe distance. Would it be possible to achieve this effect?
I have a grid view which shows some items. The user can scroll down and up. I want to be able to show a button at the very end of the grid view when the user has scrolled to the end. This button will not show when the user is not at the bottom of the grid. How can this be done ?
When the user is not at the end, the grid should look like this
and upon reaching the end of the gridview, a button should be added as a footer to gridview.
Gridview doesn't allow you to add a footer view but you can program it.
take a look at this answer from Frank.
He has added a scrolllistner and only shows the button when you are getting close to the end.
I have a list of about 100 items. In each list item I need a framelayout with 2 relative layouts. When a button called "Flip" is clicked then one relative layout will flip out and the other relative layout will flip in. And each item has full width of the screen. So, I need to show the item in a horizontal scroll view. Now, I want to keep at most 3 items every moment. When user scrolls to the first item then we have to update the 3 items. The first item will be the 2nd item. And we have to add another item at the front. In this way we have to update the items when user scrolls to the last item. I have tried many ways. I have used Gallery for the horizontal scroll view. And used the onItemSelected method. But, if I scroll the Gallery fast then it crashes. So, please someone help me to implement the 3 items idea.
It sounds like you need a ListView. Is there a reason you are trying to reinvent it?
Also don't you mean a vertical scroll view? Why are using a horizontal?