Change focus in RecyclerView in single vertical click - android

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

Related

RecyclerView items shown horizontaly with blocking on Item

i have a RecyclerView which single item is CardView type. I want to display that Cardviewes with match_parent width, and go next by finger swipe. I set an horizontal orientation in LinearLayout and everything is OK, but i can scroll it like a regular List but i want to make that finger swipe is scrolling that items and block on next one without scrolling through whole list. Is this possible in some way ?

NestedScrollView with recycler set scroll position

I have a NestedScrollView with a RecyclerView inside.
Each item within the RecyclerView has an EditText.
If the user LongClicks an EditText I want the screen to scroll such that the position of the editetext within the recyclerview scrolls to the top of the screen....
tried a lot of methods but think the nestedscrollview combined with recycler might be hindering this...
The reason i want this behaviour is that suppose an item in the recyclerview is near the bottom of the screen, if i click this the keyboard enters and it will be hidden, hence i want it to shift to the top, that way the edittext is visible

verticalHorizontal scroll Listview for android TV app

I had a requirement of implementing a Header List view with horizontal scroll items as rows (similar to UI shown by using Browse fragment of leanback library) for android TV app . I browsed on net and used verticalHorizontalscroll view using Two way View example and added a header text.As the app is for android TV , both Horizontal and Vertical scrolling should happen on keys Navigation and should show a selector to the focused item.
The vertical Scrolling and Horizontal scrolling is not happening properly.
VericalScrolling:
while scrolling up and down using Keys the entire row is not scrolling it is showing only half of the row on screen. When i set setItemsCanFocus is true it taking two key presses to scroll entire row. One for scrolling row and one for scrolling the header text.
HorizontalScrolling: Horizontal scrolling is not happening until we set setItemsCanFocus is true only after this it is showing selector on focused item . It is taking multiple Right key presses to scroll one item to right.
Please anyone tell me how can i get smooth scrolling both horizontal and vertical along with selector for TV. Is there any other way i can implement this.
Thanks,

How to create an infinite carousel horizontal scroll bar in android?

In my android app, I have a horizontal scroll bar, and I can scroll all the way to the left and right. Go too far and you can't scroll anymore.
How can I change it that, you can keep scrolling left or right for as long as you want. Basically when u see the last thing in the horizontal scroll, then if you keep scrolling, you see the first item, and it loops like this. Similarly if you scroll to the left after seeing the first item, you see the last item.
Is this possible to do in android?
Thanks

How to find scrollview scrolled position dynamically in Android?

Hi,I am new to android.my requirement is when user scrolling the scroll view,based on scrolled height i want to change images on screen. for this i want the event which will call immediately when scroll is changing,and once user reach end position i want set it to first position programatically. it is continuous loop.
You may use the listView instead of scrollView. So you can use onScrollChangeListener.

Categories

Resources