ListView scroll to coordinates - android

I need to scroll list view to some point (e.g. I need to scroll 250px)
I tried next code
container.setAdapter(crewAdapter);
container.scrollTo(0, scroll);
So now it looks good. But when I start scroll by touch scrollview 'jump' to 0 and scroll by finger from top. How to solve it?

Related

Change focus in RecyclerView in single vertical click

I am building an app for Android TV by using Nested RecyclerView. Root is vertical RecyclerView which has rows with Horizontal RecyclerView.
I want to change the focus on the single click and want to keep the scroll position static. But scrolling is always happening at the bottom of the view for horizontal and vertical both.
I am using the focus listener to scroll to top
verticalRLVLayout.scrollToPositionWithOffset(rowNumber,0);
horizantalRLVLayout.scrollToPositionWithOffset(columnNumber, 0);
This is not working always and i don't see this is the best option.
Is there any way by which if we have fixed height of each row the single click will change the focus always.
Going upward in the RecyclerView, causes new row to slide towards right and focus goes to last visible tile on the previous row. Why this is happening, any idea ?
Thanks

Create HorizontalScrollView moving on swipe gestures

I have no idea how to implement a HorizontalScrollView that scrolls on swipes. And it should scroll to specific position. The positions are one the picture. The first one is how it appears from the beginning. Then when you swipe right, the scrll view slides to the beginning and number appears. Then when you swipe left you come back to the first position. And after swipe left from the first position, scroll view scrolls to the end and shows sharing options.
I think this should be implemented with ViewPager rather than Horizontal ScrollView.
Take a look to the official documentation

Dispatch a scroll event from listview to scrollview

I have a ListView in which every row contains the following
-2 images
-1 textview
-1 scrollview that will display a bunch of tags
I searched the internet and I found out that is really hard to dispatch the scroll event from a listview to it's children, especially when they scroll on the same axis.
I was thinking if there is a possibility to find out if the touch event was on the scrollview and if it is, then I should dispatch the scroll event, else I will scroll the list.
Do you have any ideas how can I implement that?
EDIT:
I tried to to override the onTouchEvent method from the ListView but It doesn't work. When I drag over the scroll view the content disappears and when I scroll the listview, the content of the scroll view remains smudged on the screen.
Any ideas?

can we make horizontal scroll view infinte or loop around

I want to make horizontal scroll view infinite or atleast give the effect of being infinite.
Any idea how to do so?
can we listen to android horizontal scroll view as to when screen is scrolled.Is there any callback method that is called?
Can we know if the end of scroll has been reached?

ViewPager in a ListView - how to lock the scrolling axis?

I have a ViewPager widget in every row of a ListView. This provides a shelf-like UI, so the user can scroll around searching for a shelf vertically, and then scroll horizontally amongst the contents of a shelf. This works.
But the scrolling experience is terrible: if I start to drag a shelf's ViewPager, scroll it horizontally, and accidentally drag a bit upwards/downwards, then the ListView "traps" this dragging action, and start to scroll vertically, ending my horizontal drag. In this state, the drag action won't "return" to the ViewPager, the ListView has it, and that's it. I have to start another drag action to affect the ViewPager again. So I guess the ListView has precedence in these cases.
How can this be fixed? I'd like to achieve the exact opposite: If the ViewPager inside a list row starts reacting to a horizontal drag, then it should trap that action, and this drag should stop affecting the ListView, no matter how the user moves his/her finger vertically. Can this be done?
I've found a solution in this thread. There the problem is to handle touch events properly for a HorizontalScrollView inside a regular ScrollView, but the solution to that problem seems to apply to this one too.

Categories

Resources